所以我在使用C#处理我的第一个项目时,我现在遇到过两次类似的问题.当试图添加using System.Data;或者using System.Timers;,我得到错误The type or namespace name 'x' doesn't exist in the namespace 'System' (are you missing an assembly reference?).
我已经尝试开始一个新项目并运行还原以查看我是否意外删除了依赖项中的某些内容,但在生成新项目时,我仍然收到相同的错误.我试图研究这个问题并且已经看到了解决'explore explorer'的答案,但据我所知,在Visual Studio Code 1.8中这个名称似乎没有这样的功能.
任何人都可以指出我如何使这些工作正确的方向,也许通过手动添加到依赖关系?
在Visual Studio代码中我只想添加对自定义c#程序集的引用
"../libs/mylib.dll"
我该如何添加这种依赖?
我试图添加路径到依赖,但无法编译,因为它只是错误的:)
"dependencies": {
"myassembly" : "../libs/Common.dll"
},
Run Code Online (Sandbox Code Playgroud)
要么
"dependencies": {
"log4net" : { "assembly":"../libs/log4net.dll" }
},
Run Code Online (Sandbox Code Playgroud) 重要免责声明.这个问题不是关于为WSDL生成代理.它不是在VS Code中创建引用.
我正在使用Visual Studio Code(最新更新,11月16日v1.8),我需要创建一个使用WSDL和XSD文件描述的外部Web服务的调用.我想使用前面提到的编辑器来做到这一点,并且最好不必编写所有代理并包围自己.
这可能还是我在这个上运气不好?
如果在VS Code中不可行,最简单的选择是什么?我们是在谈论使用VS15生成类和调用并复制文件还是有一个我不熟悉的简洁解决方法?
c# web-services visual-studio visual-studio-code asp.net-core
我想在我的项目中使用 system.drawing 但我不能让它工作。我发现了这个问题,但它只显示了如何添加SQLite.NET-PCL,如果我尝试以相同的方式为 System.Drawing 做它不起作用。
这是我的project.json:
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
},
"frameworks": {
"net461": {
"dependencies": {
"OpenTK": "2.0.0*"
}
}
},
"runtimes": {
"win7-x64": {},
"win10-x64": {}
}
}
Run Code Online (Sandbox Code Playgroud)
如果我尝试添加 System.Drawing,它会尝试自动完成"System.Drawing" : "1.0.0-beta004"它不适用于 opentk。我正在尝试从 OpenTK 保存图像。有没有办法在 VS 代码中完成这项工作?
using System;
namespace Exercise
{
public abstract class Gun
{
public Gun(string name, int bullets)
{
}
public string Name { get; set; }
public int Bullets
{
get { return Bullets; }
set
{
if (value < 0)
{
throw new Argument?xception("Bullets cannot be below 0");
}
else
{
Bullets = value;
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是我试图运行的代码。我已经检查过,框架是一样的,这是对类似问题的回答。我正在使用 VS 代码并下载了所有必要的扩展。你知道是什么导致了这个错误吗?
找不到类型或命名空间名称“Argument?xception”(您是否缺少 using 指令或程序集引用?)