VS 2010(和publicize.exe)创建xxx_accessor.exe而不是.dll
我在使用私有访问器和 VS2010 时遇到了一个奇怪的问题。通常,VS和publicize.exe会创建xyz_accessor.dll和xyz_accessor.pdb。昨天我的VS也这样了。但后来我使用 VS2010 c# 编译器通过命令行构建了解决方案,因此通常除了 VS 之外什么也做不了。构建的解决方案没有任何错误,但我没有得到 xyz_accessor.dll,而是得到了 xyz_accessor.exe。当尝试执行它时,Windows 告诉我它不是有效的 win32 应用程序。 我尝试也使用 publicize.exe 构建测试,但它是相同的。奇怪的是,VS 能够运行所有测试,但是对于 mstest.exe,所有测试都会失败,因为找不到 xyz_accessor.dll,该链接在从测试项目编译的 Unittest.dll 中。
有人知道如何解决这种行为吗?
问候, 基督教
I'm having a strange problem with private accessors and VS2010. Normally, VS and publicize.exe create a xyz_accessor.dll and xyz_accessor.pdb. Unitl yesterday, my VS also did this. But then I built the solution via the command line, using the VS2010 c# compiler, so nothing else than VS would normally do. The solution built without any errors, but instead of getting the xyz_accessor.dll I got an xyz_accessor.exe. When trying to execute it, windows tells me it wouldn't be a valid win32 application.
I tried to build the tests also with publicize.exe, but its the same. The strange thing about it is, that VS is able to run all the tests, but with mstest.exe all tests fail because of the xyz_accessor.dll is not found, which is linked in the Unittest.dll compiled from the test project.
Does anybody know how to solve this behaviour?
Regards,
Christian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的解决方案上使用 MSBuild 而不是 CSC,它应该正确构建(但不确定是否公开)
Use MSBuild on your solution instead of CSC and it should build correctly (not sure about publicize though)
我在解决方案上使用了msbuild。但看来我说VS2010编译了accessor.dll是错误的。这个项目是用vs2005创建的,单元测试来自vs 2008。现在随着迁移到2010,似乎生成了.exe而不是.dll(至少在我的工作站上)。我实际上在不知情的情况下使用了旧版本的mstest(.net 3.5),并在将所有项目目标框架设置为4.0后再次尝试使用新版本。现在它可以正常工作了。剩下的唯一奇怪的事情是,新的 acessor exe 总是用小写字母编写,而不是像它对应的项目一样。
I used msbuild on the solution. But it looks like I was wrong with saying VS2010 compiles an accessor.dll. This Project was created with vs2005 and the unit tests are from vs 2008. Now with the migration to 2010, it seems that there is a .exe generated instead of a .dll (at my workstation, at least). I actually used an old version of mstest (.net 3.5)without knowing and tried it again with the new version after setting all project target frameworks to 4.0. Now it works as it should. the only strange thing left is that the new acessor exe is always writtten in small letters and not like the project it's corresponding to.