[英]How to reference a different mscorlib.dll from within VS2015?
I'm contributing to CoreCLR and I'm building my own copy of mscorlib.我正在为CoreCLR做出贡献,并且正在构建自己的 mscorlib 副本。 I'm trying to test my changes via creating a new Console Application in VS and referencing that copy of mscorlib instead of the built-in one, but it doesn't seem to be working.我试图通过在 VS 中创建一个新的控制台应用程序并引用 mscorlib 的副本而不是内置的副本来测试我的更改,但它似乎不起作用。
So far, I've added this line to my project's properties (by editing the .csproj
file manually):到目前为止,我已将此行添加到我的项目属性中(通过手动编辑.csproj
文件):
<NoStdLib>true</NoStdLib>
However, when I reload the project and go to References > Add Reference and select the custom-built mscorlib, I get this dialog box:但是,当我重新加载项目并转到“引用”>“添加引用”并选择自定义构建的 mscorlib 时,会出现以下对话框:
How do I fix this?我该如何解决这个问题? Would I have to manually edit the .csproj
file again, or is there some property I'm missing that would fix this error?我是否必须再次手动编辑.csproj
文件,或者是否缺少一些可以修复此错误的属性?
Thanks.谢谢。
Ended up adding this to the .csproj
file manually:最终手动将其添加到.csproj
文件中:
<ItemGroup>
<Reference Include="mscorlib">
<!-- Replace with whatever your path to mscorlib is -->
<HintPath>$(UserProfile)\Code\git\coreclr\bin\Product\Windows_NT.x64.Release\mscorlib.dll</HintPath>
</Reference>
</ItemGroup>
After that everything worked as expected.之后,一切都按预期进行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.