May 20 2008
app.config closes on Save in VS 2008
working with .NET 3.5, ADO.NET Entity Framework and VS 2008, there are a couple of bizarre (also annoying) actions, you can see.
- an App.config/Web.config file is automatically closed by the VS 2008, when you Save the file.
- if multiple config files are open, only the first one is closed.
this doesn’t happen to all XML files. only parent application configuration files. it does not seem to affect the child config files. (linked files which have their own section, which do not have a root <configuration> section)
so initially I thought, the closing action seems to be related to a configuration file which has this:
<?xml version=”1.0″ encoding=”utf-8″?>
<configuration> — blah — </configuration>
but that is also not totally true, because the App.config if renamed, does not close on Save.
so it has got something to do with the file name too.
it seems many of the developers have hit this annoying issue, and the problem seems to be the ADO.NET Entity Framework.
in order to verify this, I performed the following steps:
- I checked the ADO.NET entity tools installed on my box, and found the following:
- ADO.NET Entity Framework 1.0 (Pre-release Version Beta 3)
- ADO.NET Entity Framework Tools Preview ( #1.a is a pre-requisite for this)
- I uninstalled ADO.NET Entity Framework Tools Preview, and checked the app.config/web.config behavior. spot on.. the file did not close. this is the culprit.
- to verify further, I uninstalled ADO.NET Entity Framework 1.0 and checked. the file did not close on SAVE.
- then I installed ADO.NET Entity Framework 1.0, and tried saving the config file. it did not close.
- I installed ADO.NET Entity Framework Tools Preview, and tried saving the config file. it closed.
ADO.NET Entity Framework Tools Preview, is the one, messing up with the configuration file save action.
Notes:
- During its installation, ADO.NET Entity Framework Tools Preview, prompts for VS 2008 to be closed, if it is open. goes on to show that, it installs some related packages/plug-ins which have the side effect.
- to resolve this issue, I renamed my app.config file, to <Assembly>.EXE.Config and worked with it.
- for applications where renaming did not make sense, I just use an external editor. I got tired of editing a small value, saving it (close) in VS 2008 IDE, and finding it and opening it again.
- ADO.NET Entity Framework 1.0 (Pre-release Version Beta 3) can be downloaded here.
- ADO.NET Entity Framework Tools Preview can be downloaded here.
- this bug has been logged with the ADO.NET Entity Framework team.
there’s a solution to every problem; given enough time and money..
Same problem here. Any word on a fix not work around?
Thanks
i don’t know the ETA as of now..
but since the bug has been logged, i assume it should be fixed in the next release of ADO.NET EF Tools…
thanks
Great! Thank you very much!
I always wanted to write in my site something like that. Can I take part of your post to my blog?
Of course, I will add backlink?
Regards, Reader
ok, but please add the backlink..
what do you blog about?