Geeks With Blogs

News
View Szymon Kobalczyk's profile on LinkedIn

Szymon Kobalczyk's Blog A Developer's Notebook

Anyone who used VS2005 Beta 2 knows that is multitude of irritating bugs. But this one is just one too much for me. Yesterday I started receiving following error from code accessing some property in app.config:

System.Configuration.ConfigurationErrorsException: An error occurred executing the configuration section handler for applicationSettings/XYZ.Properties.Settings.

thrown from System.Configuration.RuntimeConfigurationRecord.GetRuntimeObject() method.

This error actually has inner exception:

System.ArgumentException: Invalid directory on URL.

that is thrown in System.Security.Policy.PolicyLevel.GenericResolve().

So I guess it has something to do with security settings.

There are two strange things. First, this doesn't happen in simple test application I made. Second, this doesn't occur on any other computer ruining my application.

Today I spent whole morning first searching net. I only found one post from few days ago with exactly same error but I don't understand the solution. The only thing I can remember, that I changed recently on my machine is installing VS Tools for Office 2005. I uninstalled it but this didn't helped. So I tried to reinstall .NET 2.0 Framework and VisualStudio. Still no luck.

If any of you had same problem please let me know if there is any solution. Otherwise I guess the only alternative would be to reinstall whole system.

 

UPDATED: After all the reinstallation (including VisualStudio and all .NET Betas) I went to .NET 2.0 configuration panel and looked into Runtime Security Policy settings. There was an entry in User Code Groups titled VSTOProjects (I was playing with VisualStudio Tools for Office day before). There was also entry for the sample project I created. Because I tried to restore everything to clean system I removed this entries. And that was it!

So I guess the error was coming in fact not from any errors in my application but the security policy system couldn't initialize itself due to invalid entry (hence the error of “Invalid directory or url“).

Posted on Saturday, August 27, 2005 8:48 AM Development | Back to top


Comments on this post: Frustrating bug in VS2005 Beta 2.

# re: Frustrating bug in VS2005 Beta 2.
Requesting Gravatar...
i have error. The configuration is read only.
how to resolve it.

//snehal 23-4-2007 add connection string dynamically and culture wise.
ConnectionStringSettings css = null;
if (System.Globalization.CultureInfo.CurrentCulture.Name == "da-DK")
{
css = new ConnectionStringSettings("RecipiesGUI.Properties.Settings.ConnectionString", "data source="db\\Danish\\FoodAndDrink"", "System.Data.SQLite");
}
else if(System.Globalization.CultureInfo.CurrentCulture.Name == "en-US")
{
css = new ConnectionStringSettings("RecipiesGUI.Properties.Settings.ConnectionString", "data source="db\\English\\FoodAndDrink"", "System.Data.SQLite");
}
ConfigurationManager.ConnectionStrings.Add(css);
//end snehal
Left by snehal kadiya on Apr 23, 2007 8:19 AM

Your comment:
 (will show your gravatar)


Copyright © Szymon Kobalczyk | Powered by: GeeksWithBlogs.net