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

查看:40
本文介绍了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 接受使用 Microsoft.VisualBasic 而没有 FileIO.但它不能识别 TextFieldParser 类.在其他论坛上,我读到我应该添加 Microsoft.VisualBasic 参考.我不知道如何执行此操作,因为 Reference Manager 的窗口是完全空白的,所以我没有任何选项可供选择.

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 包或类库以获得所需的额外功能.添加对框架的另一个部分"的引用(如 Microsoft.VisualBasic)在 .NET Core 中不是一回事.

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 Catalog .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天全站免登陆