本文介绍了SGEN失败:尝试在VS2008中加载格式不正确的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我可以找到几个类似的问题,但是没有一个答案或确切的条件适用于我的情况。我有一个为x64构建的.NET 3.5项目。


  2. 我也有一个x64混合模式引用(也针对.NET 3.5)。在Visual Studio 2008中,我创建了一个Web引用,它使SGEN在发布版本中执行以创建助手DLL。


    如果我不要引用混合模式DLL ,这工作正常。如果我引用混合模式DLL,我得到这个错误(xxx只是一个占位符):

    lockquote

    SGEN:错误:用
    不正确的格式加载程序集:
    C:\ code\xxx\trunk\xxx\common\xxx\build\winx64\lib\xxx

    这是发出的命令:

    有什么想法?

    解决方案

    是否尝试过更改生成序列化程序集,如?在我的情况下,这是票。



    只需转到您的项目属性,它在生成。




    I was able to find several similar questions asked and answered, but none of the answers or exact conditions applied to my situation.

    1. I have a .NET 3.5 project being built for x64.
    2. I also have an x64 mixed mode reference (also targeting .NET 3.5).
    3. In Visual Studio 2008, I created a Web Reference which causes SGEN to execute during a Release build to create the helper DLL.

    If I don't reference the mixed-mode DLL, this works fine. If I do reference the mixed mode DLL, I get this error (xxx is just a placeholder):

    This is the command being issued:

    Any ideas?

    解决方案

    Have you tried changing Generate serialization assembly to Off, as suggested in this msdn post? In my case, that was the ticket.

    Just go to your Project properties, and it's under Build.

    这篇关于SGEN失败:尝试在VS2008中加载格式不正确的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 02:43