gpt4 book ai didi

.net - sgen.exe生成错误 “Unable to load one or more of the requested types”

转载 作者:行者123 更新时间:2023-12-04 13:33:17 32 4
gpt4 key购买 nike

我正在构建一个包含几个解决方案的解决方案。除了其中一个以外,其他所有构建都没有任何问题。有问题的发出以下消息:

Error 2 Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. J:\MyPlugins\MyPlugin1\SGEN MyPlugin1

I turned on the verbose output in Visual Studio and I got the following: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\sgen.exe /assembly:



我使用FusionLog检查了输出,并正确加载了所有内容。原来这是一条红鲱鱼。我决定在显示详细信息的情况下再次运行该构建。我得到以下内容:

Microsoft (R) Xml Serialization support utility [Microsoft (R) .NET Framework, Version 4.0.30319.17929] Copyright (C) Microsoft Corporation. All rights reserved. If you would like more help, please type "sgen /?". SGEN : error : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. The command exited with code 1. Done executing task "SGen" -- FAILED.

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\sgen.exe /assembly:":\MyPlugins\MyPlugin1.dll" /proxytypes /reference:"J:\MyPlugins\MyPlugin1\packages\FluentValidation.3.4.6.0\lib\Net40\FluentValidation.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll" /reference:"J:\MyPlugins\MyPlugin1\Libraries\Core\bin\Release\Core.dll" /reference:"J:\MyPlugins\MyPlugin1\Libraries\Services\bin\Release\Services.dll" /reference:"J:\MyPlugins\MyPlugin1\Presentation\Web.Framework\bin\Release\Web.Framework.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.EnterpriseServices.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Web.dll" /reference:"C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Mvc.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Web.Services.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Xml.dll"



是什么导致此错误,以及如何在不关闭SGEN的情况下解决该错误?仅供引用,我没有编写代码。

最佳答案

一个对我有用的很棒的技巧,摘自:http://hashtagfail.com/post/5255977780/sgen-loaderexceptions-error

The reason why this happens is that in Release builds, Visual Studio attempts to generate a serialization assembly containing the types in your solution, to improve XmlSerializer serialization performance, should you choose to serialize your types. This can be disabled by going to the Build tab of the project properties and setting “Generate serialization assembly” to “Off”.

关于.net - sgen.exe生成错误 “Unable to load one or more of the requested types”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14372195/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com