问题标签 [assembly-references]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - 编译解决方案时,以前工作的程序集参考/使用不再有效
我添加了一个程序集作为对我的项目的引用,我用using
指令导入了它的命名空间,没有出现问题;IntelliSense 也会找到命名空间。
当我尝试编译解决方案或进入调试模式时,突然出现此错误:
找不到类型或命名空间名称
BrightIdeasSoftware
;可能缺少 using 指令或程序集引用。
这怎么可能?
c# - 系统引用不显示?
所以我有一个解决方案,里面有两个项目。一个项目正在运行 CF 3.5,而另一个项目正在运行 CF 2.0。我尝试了许多不同的方法来通过程序更新 2.0,但都没有成功,包括从解决方案中删除 3.5 项目。最后,我最终在 notepad++ 中手动打开项目文件并将框架从 2.0 更改为 3.5 并保存。从那时起,我一直遇到系统引用问题,从 0 错误变为 360 错误,如下图所示。知道如何解决这些问题吗?
再次清洁和建造后,会发生这种情况。错误跳转到 360 标记..
c# - 不能使用 DataContractSerializer - 程序集不匹配?
我正在尝试使用DataContractSerializer
将一些数据保存在 中IsolatedStorage
,但是我遇到了一些意想不到的问题。将序列化程序添加到代码后,在构建过程中出现以下错误:
错误 3 类型“System.Xml.XmlWriter”在未引用的程序集中定义。您必须添加对程序集“System.Xml,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”的引用。C:\Users\Dániel\Documents\Visual Studio 2012\Projects\GameLibs\SpaceshipConquest\SpaceshipConquest\SpaceshipConquest\Model\GameState.cs 47 13 SpaceshipConquest
错误 4 类型“System.Xml.XmlReader”在未引用的程序集中定义。您必须添加对程序集“System.Xml,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”的引用。C:\Users\Dániel\Documents\Visual Studio 2012\Projects\GameLibs\SpaceshipConquest\SpaceshipConquest\SpaceshipConquest\Model\GameState.cs 62 21 SpaceshipConquest
由于System.Xml
程序集已被引用,我尝试更改项目文件中的引用版本 - 但这会导致运行时出现新错误:
找不到文件或程序集名称“System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089”或其依赖项之一。
知道如何解决这个问题吗?
编辑:我尝试将每个程序集版本设置为 4.0.0.0,但似乎他们还需要 System.dll 的 4.0.0.0 版本,我无法设置。
编辑 2:我也尝试将 .cs 文件复制到一个新项目,但这也没有解决问题。
.net - 为什么编译器说我需要添加对 System 版本 2 的引用,而它已经存在?
我正在将 Windows CE / CF 解决方案(exe 和类库/DLL)从 Visual Studio 2003 / .NET 1.1 移植到 Visual Studio 2008 / .NET 3.5
这里的最后一行代码:
...正在引发编译时错误,即:
'System.Net.Sockets.NetworkStream' 类型在未引用的程序集中定义。您必须添加对程序集 'System, Version=2.0.0.0 的引用
但是我在这个项目中引用了那个版本的系统程序集。
运行时版本和版本均为 2.0.0.0 路径为 C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\System.dll
另一个项目(类库/DLL)也引用了 System,运行时版本是 v2.0.50727 和路径是 C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll 略有不同
“cousing”项目之间系统程序集的这种不匹配是否会成为这个问题的根源?似乎不是这样,但我不知道为什么会出现这个看似荒谬的错误......???
c# - 通过使用“对象”文件并稍后合并来加快 C# 编译?
我对 C# 非常陌生,并且在 C++ 和 Java 领域有更多的知识。在编译 C++ 或 Java 项目时,我习惯于单独为每个源文件执行编译。在 C++ 中,随后采取了将所有目标文件链接到一个库/exe/dll 的附加步骤。
我看到这种方法有几个优点,但我找不到使用单dmcs
编译器在 C# 中实现它的方法。假设我有两个文件,每个文件都有一个类。
选项集.cs
DefaultOptionsSet.cs
我可以通过调用成功地将其编译到库中
但是我不想在更改单个文件时重新编译所有源文件!执行以下操作:
产量
我知道我可以使用该-r
选项添加程序集引用,但是如果程序集引用尚未编译怎么办?
在 Java 中,我的 Makefile 看起来像这样:
但我不能直接翻译它来构建我的 C# 库。
c# - 装配参考错误
我在我的项目中引用 Renci SSH 库,我正在尝试执行代码。我收到一条错误消息:
无法加载文件或程序集 'Renci.SshNet, Version=2013.4.7.0, Culture=neutral, PublicKeyToken=null' 或其依赖项之一。该系统找不到指定的文件。
我检查了引用的属性,并且“复制本地”设置为 true。
c# - 为什么我的 C# 没有 System.ServiceProcess 库?
这是代码。我只想测试 System.ServiceProcess 库的库。
但是,当我运行 C# 代码时,它会说:
错误 1 命名空间“System”中不存在类型或命名空间名称“ServiceProcess”(您是否缺少程序集引用?)
什么地方出了错?
xamarin.ios - How to exclude assembly reference using custom conditional properties in Xamarin.iOS project
I have solution in Xamarin.iOS with project that references very large DLL (binding for very large native library). So build time for solution is very large. After simple modification in any source file I need to wait for linking. So my idea was to exclude the reference from project using custom property and also to make define that I will use in .cs files to exclude code that depends on large assembly. But I'm unable to use custom condition to exclude the reference. The following strategy will not work for Xamarin.iOS (but will work in Visual Studio):
Create file CommonProperties.prop:
So the idea is: When it is not critical I can define LinkWithLargeAssembly as False and link my project fast. CommonProperties.prop can be imported in any assembly that depends on features of the large library.
In the project file .csproj import above file and try to exclude reference (for example monotouch):
I've tried also to define property $(LinkWithLargeAssembly) directly in the project file without import. Also I've tried to use already defined properties for example $(RootNamespace) and $(AssemblyName). But Condition attribute works only for properties $(Configuration) and $(Platform). That is following code will include and exclude monotouch depending on the configuration:
Is it possible to customize assembly reference including using my own conditional properties?
c# - Winforms-Designer 不使用对位于本地网络中的库的引用
我正在使用 Visual Studio 2012,在我的 c#-项目中,我有一些对位于本地网络中另一台机器上的 DLL 的引用。一开始一切正常,它仍然编译没有任何问题。
但是现在 Forms-Designer 不起作用,它告诉我,它找不到这个引用。
在短时间内使用网络驱动器解决了这个问题,但现在我得到了同样的错误。我希望任何人都知道如何解决这个问题......
在回答这个问题之前,请记住,将库复制到我的本地驱动器不是一种选择。
asp.net - Oracle.ManagedDataAccess The system cannot find the file specified
In my website project built on .net 3.5, when I add reference to the Oracle.ManagedDataAccess.dll by adding this in the web.config
it give this error