App.exe.config with .NET Framework 4 Deployment Machine Error

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hey there,
So Ive upgraded my application recently to .NET Framework 4 from .NET Framework 4 Client Profile so I could use Crystal Reports for Visual Studio 2010.
Everything worked fine, and I managed to update my application in 2 deployment machines by adding the line<br/>

<pre class="prettyprint" style=" <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup> <startup useLegacyV2RuntimeActivationPolicy="true <supportedRuntime version="v4.0"/></startup>[/code]
in my App.exe.config files. However, there is a strange problem with the third deployment machine Im trying to update.
I run my application update that replaces App.exe.config with a new one that already includes this line (same procedure I did with the other 2 deployment machines). The new App.exe.config is in my application installation folder as its supposed to be, the
new line is there. However, when I try to access Crystal Reports inside the application in the target machine I get an "application stopped working" error, most likely due to the fact that its not running .NET Framework 4 instead of .NET Framework 4 Client
Profile.
It also seems to me that the application is running from a .config file somewhere else (I have no idea from where). Ive tried uninstalling the application, deleting the installation folder, deleting most files Ive found suspicious in UserAppData folder
and still, the application would somehow load configuration info on the new installation (in my case, connectionstring info).
Since I was suspecting this would be the problem, I tried changing my App.exe and App.exe.config names in the instalation folder to App2.exe and App2.exe.config and you know what? It worked! But unfortunately only the first time. Next time I booted the application
apparently it wouldnt load the App2.exe.config file, but instead would load some other config file that didnt include the needed .NET Framework 4 config line (I presume). If I renamed them again, they would load Crystal Reports in my application successfully
again.<br/>

This is really weird for me, shouldnt the application only read (or at least prioritize) data in the App.exe.config file? I urgently need a permanent solution so I can deploy this update in a global scale.
Am I missing something? Is there any way to add this line in runtime to the .config file the application is currently using? Would that even work? Would it work after an application reboot? Im pretty lost.
Any help would be immensely appreciated.
<br/>
<br/>

View the full article
 
Back
Top