草庐IT

assembly-references

全部标签

c# - 为什么这不触发 "Ambiguous Reference Error"?

publicclassA{publicvirtualstringGo(stringstr){returnstr;}}publicclassB:A{publicoverridestringGo(stringstr){returnbase.Go(str);}publicstringGo(IListlist){return"list";}}publicstaticvoidMain(string[]args){varob=newB();Console.WriteLine(ob.Go(null));}http://dotnetpad.net/ViewPaste/s6VZDImprk2_CqulF

c# - 未找到类型或命名空间 "are you missing assembly reference"而所有引用都正确

我正在尝试使用MSBuildWorkspaceclass.我的项目中有所有程序集引用。当我在对象浏览器中打开引用时,我看到了namespace和我尝试使用的类。但是在我接下来的using语句中,使用Microsoft.CodeAnalysis.MSBuild我得到一个Thetypeornamespacename'MSBuild'doesnotexistinthenamespace'Microsoft.CodeAnalysis'(areyoumissinganassemblyreference?)但有趣的是,语法高亮器识别类型名称,这是编译器的提示这是构建日志1>c:\windows\M

C#/N 休眠 : Association references unmapped class

几个小时以来,我一直在努力解决这个NHibernate问题。我在网络和NHibernate文档上进行了广泛的研究,但我无法理解这个问题。我对NHibernate比较陌生,但很喜欢它。不过,在那种情况下,它让我发疯。我正在为网站编写一个小型“投票”模块。我有几个类(Poll、PollVote和PollAnswer)。主要的Poll是导致问题的原因。这就是类的样子:publicclassPoll{publicvirtualintId{get;set;}publicvirtualSiteSite{get;set;}publicvirtualstringQuestion{get;set;}pu

c# - 尝试运行项目 :The module was expected to contain an assembly manifest 时出错

当我尝试运行该项目时,它显示:Errorwhiletryingtorunproject:couldnotloadfileorassembly'Project.exe'oroneofitsdependencies.Themodulewasexpectedtocontainanassemblymanifest.当我从调试文件夹运行exe时,出现了这个错误:applicationunabletostartcorrectly(0xc000007b)我也重新安装了VisualStudio,但它似乎不起作用! 最佳答案 Themodulewas

c# - OOPS 概念 : What is the difference in passing object reference to interface and creating class object in C#?

我有一个类CustomerNew和一个接口(interface)ICustomer:publicclassCustomerNew:ICustomer{publicvoidA(){MessageBox.Show("Classmethod");}voidICustomer.A(){MessageBox.Show("Interfacemethod");}publicvoidB(){MessageBox.Show("ClassMethod");}}publicinterfaceICustomer{voidA();}我对这两行代码很困惑。ICustomerobjnew=newCustomerNe

c# - 添加由多部分命名空间引起的服务引用后 Reference.cs 中的编译错误

我在VisualStudio2010中将第一个“服务引用”添加到客户端项目时遇到了这个奇怪的命名空间问题。如果我的项目的默认命名空间使用两个或多个部分,例如MyCompany.MyApp然后在添加服务引用时创建一个包含命名空间MyCompany.MyApp.ServiceReferenceName的Reference.cs文件,其中包含大量具有完全限定名称的自动生成代码,例如System.SerializableAttribute,System.Runtime.Serialization.DataContractAttribute。Reference.cs文件将充满编译错误,因为编译器

c# - BinaryFormatter.ILMerge 后反序列化 "unable to find assembly"

我有一个带有引用dll的C#解决方案(也是具有相同.Net版本的C#)。当我构建解决方案并运行生成的exe时,没有合并exe和引用的dll,一切正常。现在我想将它们合并到一个exe中。我运行ILMerge,一切似乎都正常。我尝试执行exe,它似乎运行良好,直到它尝试反序列化在引用的dll中定义的对象。using(Streamfstream=newFileStream(file_path,FileMode.Open)){BinaryFormatterbf=newBinaryFormatter();returnbf.Deserialize(fstream)asControlledRuleC

c# - References of References with COM 调用者

这个问题在这里已经有了答案:AddmanagedDLLdependenciedtounmanagedC++project(1个回答)关闭6年前。我有这样一个场景:使用VBA从MSAccess应用程序调用COM调用我们正在构建的C#库,该库引用了Newtonsoft.Jsonv9库使用nuget包,它们自己依赖Newtonsoft.Jsonv6(例如,Microsoft.AspNet.WebApi.Client)当他们尝试使用Newtonsoft.Json(或与我们的C#库引用的版本不同的任何库)时,它自己的黑盒代码中的依赖库会崩溃错误:Couldnotloadfileorassembl

c# - 错误 : Could not load log4net assembly

我正在寻找解决这个错误的办法:Couldnotloadfileorassembly'log4net,Version=1.2.10.0,Culture=neutral,PublicKeyToken=692fbea5521e1304'oroneofitsdependencies.Thesystemcannotfindthefilespecified."Thiserrorislocatedintheweb.configfile.当我将log4net.dll复制到我的webapp的bin目录时,我得到一个Couldnotloadfileorassembly'log4net,Version=1.

c# - "Assembly Same Simple Name already been imported"错误

这是一个CLR项目。我正在导入两个同名的DLL文件,quizz.dll(我将旧版本重命名为legacyquizz.dll),并将新版本包含为quizz.dll到遗留转换器测试项目。(正在测试的遗留转换器项目仅导入旧的quizz.dll)。这是我遇到的错误。..Anassemblywiththesamesimplename'Quizz,Version=2.0.0.1,Culture=neutral,PublicKeyToken=nullhasalreadybeenimported.Tryremovingoneofthereferencesorsignthemtoenableside-by