当解决方案平台是x64时,sgen失败了 [英] sgen fails when solution platform is x64

查看:91
本文介绍了当解决方案平台是x64时,sgen失败了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 - 希望有人可以帮助解决这个问题。

我有一个用.Net 2.0运行的C#编写的项目,它包含一些Web服务和客户端接口,这些接口通过标准Web引用来使用这些Web服务。我今天添加了一个x64平台来构建x64测试服务器的解决方案,但是由于运行sgen失败而无法生成客户端接口程序集以生成xml序列化程序集。

这里是sgen输出:

C:\Program Files \ Microsoft Visual Studio 8 \ SDK \v2.0\bin\sgen.exe / assembly:" S:\ xyz \ obj \x64\Release\xyz.dll" / proxytypes /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2。 0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework \v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll / compiler:/ delaysign-
错误:尝试加载格式不正确的程序集:S:\abc\bin\x64 \Release\abc.dll。
- 无法加载文件或程序集'file:/// S:\abc\bin\x64 \Release\abc.dll'或其依赖项之一。尝试加载具有不正确格式的程序。
C:\ WINDOWS \ MicroS.NET \ Framework \v2.0.50727 \ Microsoft.Common.targets(1892,9):错误MSB6006: " sgen.exe"退出代码1.
完成构建项目"xyz.csproj" - FAILED。


当平台是AnyCPU时,一切都建立并运行正常,但x64平台无法正常工作。

我在32位机器上执行构建 - 是否有尝试为64位计算机构建解决方案时,在32位计算机上运行agen的问题?希望不是,因为其他一切都还可以。我被困 - 任何建议都会被感激地收到。

欢呼



















div>

Mark,



您可能会看到此问题,因为您没有针对CLR框架的64位版本进行构建。 尝试使用C:\ WINDOWS \ Microsoftoft.NET \ Framework64 \ v2.0.50727作为参考CLR路径。这假设你已经安装了这个版本。



这有帮助吗?



-Chris


Hi  - hope someone can help with this one.

I have a project written in C# running under .Net 2.0 that contains some web services and client interfaces that make use of those web services via standard web references.
I have today added an x64 platform to build the solution for an x64 test server, however the client interface assemblies will not build due a failure running sgen to generate the xml serialization assemblies.

Here is the sgen output:

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\sgen.exe /assembly:"S:\xyz\obj\x64\Release\xyz.dll" /proxytypes /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /compiler:/delaysign-
Error: An attempt was made to load an assembly with an incorrect format: S:\abc\bin\x64\Release\abc.dll.
  - Could not load file or assembly 'file:///S:\abc\bin\x64\Release\abc.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1892,9): error MSB6006: "sgen.exe" exited with code 1.
Done building project "xyz.csproj" -- FAILED.


Everything builds and runs ok when the platform is AnyCPU, but x64 platform will not work.

I am performing the build on a 32bit machine - is there a problem running agen on a 32 bit machine when trying t build a solution for a 64 bit one? Hopefully not, cos everything else is ok.
I'm stuck - any suggestions would be gratefully received.

cheers
Mark

解决方案

Mark,

 

You may see this problem because you are not building against the 64bits version of the CLR framework. Try using C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727 for your reference CLR path. This assumes you have this version installed already.

 

Does this help?

 

-Chris


这篇关于当解决方案平台是x64时,sgen失败了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆