简体   繁体   English

VSCode C#问题添加程序集引用

[英]VSCode C# Issue Adding An Assembly Reference

I have the C# VSC extension as well as the NuGet Package Manager installed. 我安装了C#VSC扩展以及NuGet软件包管理器。 Here is my VSC version info: 这是我的VSC版本信息:

First, I create a brand new console application in VSC with the command: 首先,我使用以下命令在VSC中创建一个全新的控制台应用程序:

dotnet new console dotnet新控制台

This gives me the code: 这给了我代码:

using System;

namespace ReferenceTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

I now want to create a using System.Windows.Forms; 我现在想创建一个using System.Windows.Forms; reference. 参考。 When I start typing this using statement however, intelli-sense fails me: 但是,当我开始使用using语句键入此内容时,智能感知使我失败了:

在此处输入图片说明

I found this question/answer already but in step #5 the autofill option shown is not there: 我已经找到了这个问题/答案,但是在步骤5中,显示的自动填充选项不存在: 在此处输入图片说明

When I try to improvise and follow other instructions I've found in my searching by using the 当我尝试即兴使用并遵循在搜索中找到的其他说明时,可以使用

NuGet Package Manager: Add Package NuGet软件包管理器:添加软件包

option, I cannot select System.Windows.Forms 选项,我无法选择System.Windows.Forms 在此处输入图片说明

I have looked for a project.json file per the instructions of several sites but I can only find a project.assets.json file and it doesn't look very similar to what I see in the examples I find. 我已经看过了project.json每几个站点的说明文件,但我只能找到一个project.assets.json文件,它看起来并不很相似,我在我找到的例子看。 This issue is not only for System.Windows.Forms but other references I try as well. 这个问题不仅针对System.Windows.Forms而且我也尝试其他参考。

Windows Forms and WPF applications are not supported in .NET Core, only in .NET Framework. .NET Core不支持Windows窗体和WPF应用程序,仅.NET Framework中不支持。

have a look at the following article: 看一下下面的文章:

https://stackify.com/net-core-vs-net-framework/ https://stackify.com/net-core-vs-net-framework/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM