Microsoft.VisualBasic.FileIO参考 [英] Microsoft.VisualBasic.FileIO reference

查看:193
本文介绍了Microsoft.VisualBasic.FileIO参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在项目中使用 TextFieldParser 。为此,我需要使用Microsoft.VisualBasic.FileIO

I want to use TextFieldParser in my project. For that I need using Microsoft.VisualBasic.FileIO.

但是Visual Studio接受没有 FileIO 的Microsoft.VisualBasic 。但它不能识别TextFieldParser类。
在其他论坛上,我读到我应该添加 Microsoft.VisualBasic 参考。由于参考管理器的窗口完全空白,所以我无法解决该问题,因此我没有任何选择。

However Visual Studio accepts using Microsoft.VisualBasic without the FileIO. but it does not recognize the TextFieldParser class. On other forums, I read I should add Microsoft.VisualBasic reference. I am not able to work out how to do this, since the window of Reference Manager is completely blank, so I do not have any option to chose from.

有帮助吗?

推荐答案

您已阅读的添加引用对话框会添加.NET Framework引用,但您的目标是.NET Core。在.NET Core中,您所需的东西内置在框架中,或者您引用Nuget包或类库以获取所需的其他功能。在.NET Core中,添加对框架的另一个部分(例如 Microsoft.VisualBasic )的引用不是必需的。

The "Add Reference" dialog that you have read about adds .NET Framework references, but you are targeting .NET Core. In .NET Core, either what you need is built in to the framework or you reference a Nuget package or class library to get the extra features you need. Adding a reference to another 'part' of the framework - like Microsoft.VisualBasic - isn't a thing in .NET Core.

关于 TextFieldParser ,坏消息是它在.NET Core 2.1中不可用,如文档

With regards to TextFieldParser, the bad news is that it is not available in .NET Core 2.1, as is made clear in the documentation.

但是,我们可以从文档中看到。NET API目录,该类在.NET Core 3.0中可用。因此,您有2个选择:

However, we can see from the documentation and the .NET API Catalog that the class is available in .NET Core 3.0. Therefore you have 2 choices:


  • 升级到.NET Core 3.0,或者

  • Upgrade to .NET Core 3.0, or

不使用此类,而是使用其他方法

Make do without this class and use a different approach

这篇关于Microsoft.VisualBasic.FileIO参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆