"application failed to start ... configuration is incorrect" after update?

I have a project in a windows application than in VS2008. Now I convert it to VS2010. When I want to start my project, I get the following message:

"This application failed to start because the configuration of the application is incorrect. View the manifest file for a possible error."

How do I run the application? Thanks.

+4
source share
6 answers

I had the same problem when my C # solution was created in a previous version and it did not work in the new version of VS.Net with the same error. Here are a few things to help you solve the problem.


  • Expand the Links element and check to see if any element is attached to it.
  • If (1), click Links-> Add Link and try adding a link containing a warning. The warning sign should now disappear.
  • If the links displayed in the Add Link dialog box are gray, you should probably get a reason for it to hang next to the link.
  • For me it was gray and it clearly states that the component is not compatible with the current .NET runtime. Right-click on Project → "Properties" and try to change the .NET Runtime and give a snapshot by compiling the entire solution and try to execute it.
  • If it still does not work, try viewing the event logs by going to Start-> Run-> Eventvwr
  • This should be a good way to debug this problem.

+9
source

Honestly ... I deleted the App.config file and rebuilt. And started to work.

+3
source

Not understanding what was going on, I was able to fix this problem for the Windows Forms project that I just converted from VS.Net 2008 to 2010.

After the conversion, the Target Framework still had .Net Framework 2. When I changed it to 4.0, my application could be launched and debugged. Then they noticed a new line in app.config:

<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup> 

So, for fun, I changed the Target Framework to 2.0, and the line changed to:

 <startup><supportedRuntime version="v2.0.50727"/></startup> 

The application will still work. Then I deleted the new line and the application started anyway!

Finally, I turned off all my changes and started the conversion again. Now the application will start immediately!

So, if you run into this problem, just try these steps and see if it helps you.

+1
source

In my case, the cause of this error was an invalid app.config . R# renamed the root element from <configuration> to something else (probably because there was another variable that I renamed with the same name).

I found this following the advice of Gopalakrishnan SA to look in the Event Viewer , where I found:

Failed to create context generation for "my.exe" .Error in the manifest file or policy file "my.exe.Config" on line 3. The root file of the application configuration file must be configured.

0
source

In my case, I forgot a simple note,

in requestedPrivileges you must put one requestedExecutionLevel , NOT MORE

0
source

Source: https://habr.com/ru/post/1386046/


All Articles