简体   繁体   English

应用程序无法启动,因为它的并行配置不正确

[英]The application has failed to start because its side-by-side configuration is incorrect

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.未处理的异常:System.IO.FileLoadException:无法加载文件或程序集“ TheLibrary ,版本=1.2.3905.36284,Culture=neutral,PublicKeyToken=14 04827c3a8f2601”或其依赖项之一。 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. (来自 HRESULT 的异常:0x800736B1)文件名:' TheLibrary ,版本=1.2.3905.36284,Culture=neutral,PublicKe yToken=1404827c3a8f2601'---> System.Runtime.InteropServices.COM01启动失败(0x88)因为它的并排配置是不正确的。 Please see the application event log for more detail.有关更多详细信息,请参阅应用程序事件日志。 (Exceptio n from HRESULT: 0x800736B1) (来自 HRESULT 的异常:0x800736B1)

When I look at the event log, I get this error.当我查看事件日志时,出现此错误。

Activation context generation failed for "C:\\project\\Debug\\MyLibrary.dll". “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.无法找到相关程序集 Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"。 Please use sxstrace.exe for detailed diagnosis.请使用 sxstrace.exe 进行详细诊断。

I used sxstrace to log the error and here is the result:我使用sxstrace记录错误,结果如下:

================= 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.输入参数:Flags = 0 ProcessorArchitecture = x86 CultureFallBacks = en-US;en ManifestPath = C:\\Windows\\system32\\cmd.exe AssemblyDirectory = C:\\Windows\\system32\\ Application Config File = --------- -------- 信息:解析清单文件 C:\\Windows\\system32\\cmd.exe。 INFO: Manifest Definition Identity is Microsoft.Windows.FileSystem.CMD,processorArchitecture="x86",type="win32",version="5.1.0.0".信息:清单定义标识是 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.输入参数:Flags = 0 ProcessorArchitecture = x86 CultureFallBacks = en-US;en ManifestPath = C:\\Debug\\TheLibrary.dll AssemblyDirectory = C:\\Debug\\ Application Config 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".信息:参考:Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" 信息:解析参考 Microsoft.VC90.DebugCRT,processorArchitecture="x86" ,publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"。 INFO: Resolving reference for ProcessorArchitecture x86.信息:正在解析 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.信息:在 WinSxS 中没有找到程序集。 INFO: Attempt to probe manifest at C:\\Windows\\assembly\\GAC_32\\Microsoft.VC90.DebugCRT\\9.0.21022.8__1fc8b3b9a1e18e3b\\Microsoft.VC90.DebugCRT.DLL.信息:尝试在 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.信息:尝试在 C:\\Debug\\Microsoft.VC90.DebugCRT.DLL 处探测清单。 INFO: Attempt to probe manifest at C:\\Debug\\Microsoft.VC90.DebugCRT.MANIFEST.信息:尝试在 C:\\Debug\\Microsoft.VC90.DebugCRT.MANIFEST 处探测清单。 INFO: Attempt to probe manifest at C:\\Debug\\Microsoft.VC90.DebugCRT\\Microsoft.VC90.DebugCRT.DLL.信息:尝试在 C:\\Debug\\Microsoft.VC90.DebugCRT\\Microsoft.VC90.DebugCRT.DLL 处探测清单。 INFO: Attempt to probe manifest at C:\\Debug\\Microsoft.VC90.DebugCRT\\Microsoft.VC90.DebugCRT.MANIFEST.信息:尝试在 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".错误:无法解析参考 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=...无法解析参考Microsoft.VC90.DebugCRT,processorArchitecture=...

Any ideas?有任何想法吗?

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...我们刚刚遇到了完全相同的错误,但与错误相比,原因是如此具有误导性,希望值得在此处添加,因为它在 google 上名列前茅......

The "The application has failed to start because its side-by-side configuration is incorrect" error was occurring when starting a windows service .启动 Windows 服务时出现“应用程序无法启动,因为其并行配置不正确”错误。 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.在我们的实例中,这是由服务 application.config xml 文件无效引起的- 有人手动编辑了它并将其粘贴到额外的结束标记中。 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.检查这一点的最快方法是将 xml 文件粘贴到网络上许多免费的在线 xml 验证器之一。

Dependent Assembly Microsoft.VC90.DebugCRT,... could not be found依赖程序集 Microsoft.VC90.DebugCRT,... 找不到

Yes, that can only be found on a machine that has Visual Studio installed.是的,只能在安装了 Visual Studio 的机器上找到。 The DebugCRT is not distributable. DebugCRT 不可分发。 And it doesn't make sense to write C or C++ code and deploy the debug build for it, it is a lot slower.它没有意义编写C或C ++代码,并为其部署调试版本,它是慢了很多

Deploy the Release build version of your DLL.部署 DLL 的发布版本。 And the VC++ Libraries, one of the check boxes in the Prerequisites of a Setup project.以及 VC++ 库,安装项目的先决条件中的复选框之一。

This is marked C#, so I'll give the C# answer: Something has mangled your projectname.exe.config file.这被标记为 C#,所以我会给出 C# 的答案:有些东西已经损坏了您的 projectname.exe.config 文件。

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.但是现在,只需修复它,您就可以启动了。

您可以从应用程序路径中删除清单文件,然后可执行文件将正常工作,

For real checking if you are using Windows 7 (must be same for 8 and Vista)真正检查您是否使用的是 Windows 7(8 和 Vista 必须相同)

Open from control panel system Administrative tool and select event viewer从控制面板系统管理工具打开并选择事件查看器

Click windows logs-> Application单击 windows 日志-> 应用程序

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然后用这样的编辑器写或记事本打开 yourfilename.exe.manifest

Then from line number </ to /> delete the lines and save the file然后从行号</ to />删除行并保存文件

Your problem is resolved.您的问题已解决。

I wanted to pin-point one more reason why this error could arise: wrong encoding of *.config file.我想找出可能出现此错误的另一个原因: *.config文件的错误编码。

The file needs to be in UTF-8 , while you can actually get ANSI accidentally nowadays by creating configuration file manually using notepad.exe .该文件需要为UTF-8 ,而现在您实际上可以通过使用notepad.exe手动创建配置文件来意外获得ANSI

I found side by side error there is a mismatched or system error in app.config file.我发现并排错误 app.config 文件中存在不匹配或系统错误。 find bug in your app.config file correct it.在您的 app.config 文件中找到错误更正它。

I had this issue and it was a simple problem with the version value in assemblyIdentity element of the app.manifest file.我遇到了这个问题,这是 app.manifest 文件的assemblyIdentity元素中version值的一个简单问题。 Apparently version must have all four numbers (unless assemblyIdentity is ignored which is the case if the manifest is embedded).显然version必须具有所有四个数字(除非assemblyIdentity被忽略,如果嵌入清单就是这种情况)。

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.在那之后,一切都是笨拙的。

确保您没有错位的配置,例如 http Web 服务绑定中的<httpsTransport>

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.就我而言,我正在使用一个在 c# 中构建的控制台应用程序,我使用的是 VS 2017。我尝试通过右键单击项目并选择发布选项来发布代码,然后配置所需的设置。 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.它没有在配置的路径上发布 exe,但是每当我尝试编译或构建应用程序时,我都会遇到这种错误。 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.取消选中名为“签署 ClickOnce 清单”的复选框。 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谢谢

This is usually an error in App.config file .这通常是App.config 文件中错误

Sometimes it happens that you just put an invalid tag or your XML is not of a valid format.有时,您只是放置了一个无效的标签,或者您的 XML 的格式无效。

Try checking XML with some XML online validator.尝试使用一些 XML 在线验证器检查 XML。

Regarding the allowed tags, here you can find more:关于允许的标签,您可以在此处找到更多信息:

https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/ https://docs.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 .如果您的 App.config 文件中的某些内容未出现在文档中,则可能应该将其放置在 configuration 的另一部分中 For example, in the app.manifest file.例如,在 app.manifest 文件中。 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 .这是意外切换文件错误键入标签的常见错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序无法启动,因为其并行配置不正确 - Application failed to start because its side-by-side configuration is incorrect 该应用程序无法启动,因为其并行配置不正确 - The application has failed to start because its side-by-side configuration is incorrect C#Dll导入失败:“应用程序无法启动,因为它的并行配置不正确” - C# Dll Import failure: “The application has failed to start because its side-by-side configuration is incorrect” 免费注册COM互操作:由于并排配置不正确,因此应用程序无法启动 - Registration Free COM Interop: The application has failed to start because its side-by-side configuration is incorrect 并排配置不正确,导致应用程序启动失败 - application has failed to start because the side by side configauration is incorrect 修复.NET应用程序中的并行错误 - Fix a side-by-side error in .NET application 并排显示数据表列 C# 控制台应用程序 - Displaying DataTable Columns Side-By-Side C# Console Application 如何解决导入期间 Viual Studio 中的并行配置错误 dll - How to solve side-by-side configuration error in Viual Studio during import dll COM互操作并排组件 - COM interop side-by-side assemblies 并排显示表单所有者表单 - Show Form side-by-side owner Form
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM