我有这样的错误
错误8'c:\ Oleg\projects\MBClient\packages\Disruptor.1.1.0\lib \net40\Atomic.dll'和'c:\ Program Files(x86)中都存在'System.Threading.Volatile'类型\ Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\mscorlib.dll'C:\ Oleg\projects\MBClient\MBClient\CustomIndeces\CompositeIndex.cs 77 40 MBClient
我不知道该怎么办,因为完全限定名称并不能准确识别要使用的类.如何解决这个问题呢?
您可以通过右键单击引用列表中的程序集,转到属性以及将"别名"属性设置为您希望的属性,为VS中的库分配别名.然后,要使用此程序集中的类型,请extern alias在命名空间的开头使用.
例:
namespace TestApp
{
extern alias Threading1;
using Threading1.System.Threading.Volatile;
}
Run Code Online (Sandbox Code Playgroud)
也许您可以alias为该命名空间定义一个,Timer在以下命名空间中找到类的示例
using WinTimer = System.Windows.Forms;
using ThreadTimer = System.Threading;
Run Code Online (Sandbox Code Playgroud)
那么你可以像使用它一样
WinTimer.Timer _tmr = new WinTimer.Timer();
ThreadTimer.Timer _Thrtmr = new ThreadTimer.Timer();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
250 次 |
| 最近记录: |