Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

SecurityException #30

Open
mloeffen opened this issue Jun 25, 2012 · 1 comment
Open

SecurityException #30

mloeffen opened this issue Jun 25, 2012 · 1 comment

Comments

@mloeffen
Copy link

For deployment I've created a setup project (MSI) that installs DotNetMigrations locally. On older (Windows XP) machines this worked fine, but on machines with Windows 7 the application fails to initialize due to security exception when it is loading dmn.logs from the app.config. I fixed it by editing the last method in src\DotNetMigrations.Core\Provider\ConfigurableTypeCatalog.cs like so

private static ConfigurableTypeSection GetSection(string sectionName)
{
    Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
    ConfigurableTypeSection section = config.GetSection(sectionName) as ConfigurableTypeSection;

    if (section == null)
    {
        throw new ConfigurationErrorsException(string.Format("The configuration section {0} could not be found.", sectionName));
    }

    return section;
}

Using the OpenEXECofiguration fixes the SecurityException. This workaround was found here: http://stackoverflow.com/questions/2725432/net-4-0-application-on-network-share-causes-securityexception

@jpoehls
Copy link
Owner

jpoehls commented Jun 25, 2012

Sweet. Thanks!

At some point I'd like to create a Chocolatey package that could be used as a deployment option as well. http://chocolatey.org/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants