C#编译器找不到dll;解决方案编译在VS2010 [英] C# compiler does not find dlls ; solution compiled in VS2010
问题描述
我有一个C#解决方案和一些参考dll-s。即使在Visual Studio(vs2010)中编译时,它显示为成功,当使用C#编译器失败:缺少dll显然..
I have a C# solution and some referenced dll-s. Even though when compiling in visual studio(vs2010) it appears as it succeeded, when using the C# compiler it fails: missing dll apparently..
csc /t:library /out:test.dll test.cs
test.cs(22,10): error CS0246: The type or namespace name
'Attribute' could not be found (are you missing a using directive
or an assembly reference?)
有人知道为什么会发生这种情况吗?
Does anyone know why is this happening?
推荐答案
因为你没有给出代码, 属性
是指。如果它是 System.Attribute
,我希望通过默认的程序集引用自动找到。如果它是另一个程序集中的类型,则需要从命令行显式引用它:
As you haven't given the code, it's not clear what type Attribute
is meant to be. If it's System.Attribute
, I'd expect that to be found automatically via the default assembly references. If it's a type in another assembly, you need to explicitly reference it from the command line:
csc /t:library /out:test.dll /r:OtherAssembly.dll test.cs
这篇关于C#编译器找不到dll;解决方案编译在VS2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!