简体   繁体   English

如何更喜欢Nuget程序集而不是SDK程序集?

[英]How to prefer Nuget assemblies over SDK assemblies?

I just updated my Visual Studio version and got a new SDK version (Blend) installed. 我刚刚更新了Visual Studio版本,并安装了新的SDK版本(混合)。 I previously used an assembly (System.Windows.Interactivity.dll) via Nuget that is now also provided by the SDK. 我以前通过Nuget使用了程序集(System.Windows.Interactivity.dll),该程序集现在也由SDK提供。 Visual Studio now uses the SDK one instead of the Nuget version. Visual Studio现在使用的是SDK版本之一,而不是Nuget版本。 Both assemblies have the same version but actually differ in their provided types. 这两个程序集具有相同的版本,但实际上它们提供的类型不同。 This is why I cannot compile anymore. 这就是为什么我不能再编译了。

Is there a way to tell Visual Studio to always prefer the assemblies from a Nuget package over the installed ones? 有没有一种方法可以让Visual Studio始终首选Nuget程序包中的程序集而不是已安装的程序集? I want to compile my code without considering about the installed SDKs on the current machine. 我想编译我的代码,而不考虑当前计算机上已安装的SDK。 This is why I prefer the Nuget way 这就是为什么我更喜欢Nuget方式

As it turned out, in my case, it was a Resharper cache issue. 事实证明,就我而言,这是一个Resharper缓存问题。 Resharper showed an error and pointing to the SDK assembly. Resharper显示错误,并指向SDK程序集。 After clearing the cache manually and restarting Visual Studio it referenced the nuget assembly again. 手动清除缓存并重新启动Visual Studio之后,它再次引用了nuget程序集。 The errors then disappeared 错误然后消失了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM