Microsoft.VisualBasic.FileIO reference

≡放荡痞女 提交于 2019-12-11 14:46:54

问题


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

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.

Any help ?


回答1:


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.

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.

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:

  • Upgrade to .NET Core 3.0, or

  • Make do without this class and use a different approach



来源:https://stackoverflow.com/questions/58698869/microsoft-visualbasic-fileio-reference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!