The application has failed to start because its side-by-side configuration is incorrect
Asked Answered
S

13

30

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembl y 'TheLibrary, Version=1.2.3905.36284, Culture=neutral, PublicKeyToken=14 04827c3a8f2601' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail. (Exception from HRESULT: 0x800736B1) File name: 'TheLibrary, Version=1.2.3905.36284, Culture=neutral, PublicKe yToken=1404827c3a8f2601' ---> System.Runtime.InteropServices.COMException (0x800 736B1): The application has failed to start because its side-by-side configurati on is incorrect. Please see the application event log for more detail. (Exceptio n from HRESULT: 0x800736B1)

When I look at the event log, I get this error.

Activation context generation failed for "C:\project\Debug\MyLibrary.dll". Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.

I used sxstrace to log the error and here is the result:

================= Begin Activation Context Generation. Input Parameter: Flags = 0 ProcessorArchitecture = x86 CultureFallBacks = en-US;en ManifestPath = C:\Windows\system32\cmd.exe AssemblyDirectory = C:\Windows\system32\ Application Config File = ----------------- INFO: Parsing Manifest File C:\Windows\system32\cmd.exe. INFO: Manifest Definition Identity is Microsoft.Windows.FileSystem.CMD,processorArchitecture="x86",type="win32",version="5.1.0.0". INFO: Activation Context generation succeeded. End Activation Context Generation.

================= Begin Activation Context Generation. Input Parameter: Flags = 0 ProcessorArchitecture = x86 CultureFallBacks = en-US;en ManifestPath = C:\Debug\TheLibrary.dll AssemblyDirectory = C:\Debug\ Application Config File = ----------------- INFO: Parsing Manifest File C:\Debug\TheLibrary.dll. INFO: Manifest Definition Identity is (null). INFO: Reference: Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" INFO: Resolving reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8". INFO: Resolving reference for ProcessorArchitecture x86. INFO: Resolving reference for culture Neutral. INFO: Applying Binding Policy. INFO: No publisher policy found. INFO: No binding policy redirect found. INFO: Begin assembly probing. INFO: Did not find the assembly in WinSxS. INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL. INFO: Attempt to probe manifest at C:\Debug\Microsoft.VC90.DebugCRT.DLL. INFO: Attempt to probe manifest at C:\Debug\Microsoft.VC90.DebugCRT.MANIFEST. INFO: Attempt to probe manifest at C:\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL. INFO: Attempt to probe manifest at C:\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST. INFO: Did not find manifest for culture Neutral. INFO: End assembly probing. ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8". ERROR: Activation Context generation failed. End Activation Context Generation.

Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture=...

Any ideas?

Scampi answered 18/10, 2010 at 17:37 Comment(2)
Program was built with VS 2008 and i installed Microsoft Visual C++ 2008 Redistributable Package (x86). but still didnt help.Scampi
For non-programmers getting here from Google, this error can sometimes happen if you launch a program before Windows finishes starting up. If you wait a few seconds and try launching the program again then it'll usually work fine afterwards.Outboard
P
18

Dependent Assembly Microsoft.VC90.DebugCRT,... could not be found

Yes, that can only be found on a machine that has Visual Studio installed. The DebugCRT is not distributable. And it doesn't make sense to write C or C++ code and deploy the debug build for it, it is a lot slower.

Deploy the Release build version of your DLL. And the VC++ Libraries, one of the check boxes in the Prerequisites of a Setup project.

Paulinepauling answered 18/10, 2010 at 17:56 Comment(3)
I don't have the source code of the assembly, is there any way to get Microsoft.VC90.DebugCRT without installing visual studio 2008?Clarineclarinet
"doesn't make sense to write C or C++ code and deploy the debug build for it" - strongly disagree on this point, it makes lot of sense when deploying is to VMs on you machines for example.Clemmie
Sigh, follow the MSDN guidelines on how to setup a remote debugging session. That doesn't have anything to do with deployment.Paulinepauling
T
56

We've just had this exact same error but the cause was so misleading compared to the error it's hopefully worth adding here as it comes top on google...

The "The application has failed to start because its side-by-side configuration is incorrect" error was occurring when starting a windows service. In our instance this was caused by the services application.config xml file not being valid - someone had edited it manually and pasted in an extra closing tag. Amending this resolved the "not related in any way whatsoever" error message.

The quickest way to check this would be to paste the xml file into one of the many on-line xml validators free on the web.

Tashinatashkent answered 26/9, 2016 at 10:57 Comment(5)
You are a lifesaver. This is exactly what the problem was in our case.Usury
I would have never thought to look at the config file if it weren't for this. Apparently I had an incorrect double "<<add key=..."Socalled
That was my case too : invalid app.config fileCissy
This error happened to me today too. It was an invalid exe.config file for the .NET based windows service that was running. Specifically, there was an ampersand & in one of the settings (a password) which is technically invalid XML so it has to be escaped with &amp;. I found the problem because the Windows Event Log actually stated the config file was not formatted correctly and pointed to the line number. As soon as I saw the & I facepalmed.Portage
@JeffMergler - wow that Event Log message is helpful! Some progress at last! :)Tashinatashkent
P
18

Dependent Assembly Microsoft.VC90.DebugCRT,... could not be found

Yes, that can only be found on a machine that has Visual Studio installed. The DebugCRT is not distributable. And it doesn't make sense to write C or C++ code and deploy the debug build for it, it is a lot slower.

Deploy the Release build version of your DLL. And the VC++ Libraries, one of the check boxes in the Prerequisites of a Setup project.

Paulinepauling answered 18/10, 2010 at 17:56 Comment(3)
I don't have the source code of the assembly, is there any way to get Microsoft.VC90.DebugCRT without installing visual studio 2008?Clarineclarinet
"doesn't make sense to write C or C++ code and deploy the debug build for it" - strongly disagree on this point, it makes lot of sense when deploying is to VMs on you machines for example.Clemmie
Sigh, follow the MSDN guidelines on how to setup a remote debugging session. That doesn't have anything to do with deployment.Paulinepauling
P
12

This is marked C#, so I'll give the C# answer: Something has mangled your projectname.exe.config file.

Pull it up in a text editor and chances are something won't be closed properly or there will be a few garbage characters at the end. You can figure out why that happened later. But for now, just fix it and you'll be able to launch.

Pecten answered 21/2, 2017 at 14:51 Comment(2)
I had to activate the option "View all characters" in Notepad++ to see these garbage characters at the end of the .config file.Treen
Had a similar problem here, found that I had edited the .config file manually to change a trace entry and left a closing comment in there.Perkin
P
6

You can just delete the manifest file from your application path, then the executable will work properly,

Pander answered 13/6, 2012 at 9:17 Comment(2)
In my case I had an error in my manifest file, I edited it and it solved my problem, thanks for your hint.Atrium
Why would you delete manifest instead addressing the root cause? Especially if you need that file and / or issue happens after manual edit.Heimer
D
3

For real checking if you are using Windows 7 (must be same for 8 and Vista)

Open from control panel system Administrative tool and select event viewer

Click windows logs-> Application

Find your error log under the column side-by-side

Note the line number where the error occurs.

Then with a editor such write or notepad open yourfilename.exe.manifest

Then from line number </ to /> delete the lines and save the file

Your problem is resolved.

Disconcert answered 6/9, 2015 at 22:7 Comment(0)
M
3

I found side by side error there is a mismatched or system error in app.config file. find bug in your app.config file correct it.

Maillot answered 2/4, 2018 at 11:9 Comment(1)
This was my issue.Edison
C
3

I wanted to pin-point one more reason why this error could arise: wrong encoding of *.config file.

The file needs to be in UTF-8, while you can actually get ANSI accidentally nowadays by creating configuration file manually using notepad.exe.

Carlotacarlotta answered 11/4, 2018 at 13:49 Comment(0)
H
2

I had this issue and it was a simple problem with the version value in assemblyIdentity element of the app.manifest file. Apparently version must have all four numbers (unless assemblyIdentity is ignored which is the case if the manifest is embedded).

So the fix here:

<assemblyIdentity name="MyApplication" version="1.0.1" publicKeyToken="D3567E058552E2DF" type="win32" processorArchitecture="x86" />

is to set

version="1.0.1.0"

After that, everything was hunky-dory.

Happy answered 20/3, 2018 at 20:52 Comment(0)
P
1

Following this answer, I was able to resolve the same on Microsoft Server 2019 issue by:

  1. Uninstalling Visual Studio and Microsoft C++ redistributable versions 2010 and above.
  2. Re-installing Microsoft C++ redistributable versions 2010 and above in ascending order
  3. Re-installing Visual Studio.

I hope this works for someone too.

Polycythemia answered 22/9, 2023 at 19:51 Comment(0)
F
0

Make sure that you don't have misplaced configurations, like an <httpsTransport> within an http web service binding.

Fortaleza answered 18/12, 2017 at 18:27 Comment(0)
V
0

In my case, I was working with a console application which is build in c# and I was using VS 2017. I tried to publish the code by right clicking on the project and select the publish option and then configure the required settings. it didn't published the exe on configured path but whenever I tried to compile or tried to build the application, I was getting this kind of error. I was googling that error message and I came across this question. This answer may seems irrelevant to the question but still I am posting my answer for the folks like me who got here because of facing problem like mine. So I found the salutation for my problem as below steps :

  1. Go to the project file, right click on it
  2. go to the properties options
  3. go to the signing option
  4. uncheck the checkbox named as 'Sign the ClickOnce manifests' its done. Now when I tried to build the console application again, it showed me a warning message, which I have ignored and it got build successfully, and working fine. I have shared whatever I had tried, trying to help here for people like me. Thanks
Vibration answered 22/10, 2021 at 15:49 Comment(0)
H
0

This is usually an error in App.config file.

Sometimes it happens that you just put an invalid tag or your XML is not of a valid format.

Try checking XML with some XML online validator.

Regarding the allowed tags, here you can find more:

https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/

If something from your App.config file is not present in the documentation, then it’s probably supposed to be placed in another part of the configuration. For example, in the app.manifest file. You can even google about freshly added code, like some tag or attribute, and figure out the error by comparing how the code you have aligns with your search results. This is a common error to accidentally switch files or mistype a tag.

Heimer answered 22/12, 2021 at 15:20 Comment(0)
M
0

Simply download chrome installer and run without uninstalling older version of chrome. It will automatically FIX the issue

Maronite answered 8/4 at 5:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.