microsoft.visualbasic.fileio does not exist

2019-01-23 23:16发布

I am on .NET Framework 4.0, building a C# web application in VisualStudio 2012. I have Microsoft.VisualBasic added as a reference to the project. I am having trouble with the following line of code:

using Microsoft.VisualBasic.FileIO;

Building the solution returns the error: The type or namespace name 'FileIO' does not exist in the namespace 'Microsoft.VisualBasic' (are you missing an assembly reference?)

I have removed and re-added the reference to the assembly Microsoft.VisualBasic, but still get the error. Microsoft.VisualBasic is in the GAC, as well as Microsoft.VisualBasic.Compatibility, Microsoft.VisualBasic.Compatibility, Microsoft.VisualBasic.PowerPacks.Vs, and Microsoft.VisualBasic.Vsa.

Please let me know how to get VS2012 to recognize the FileIO namespace.

1条回答
一纸荒年 Trace。
2楼-- · 2019-01-23 23:36
  1. Right-click on your project and select Add Reference...

  2. In the Reference Manager, expand Assemblies and select Framework. Then check the box for Microsoft.VisualBasic and click OK.

查看更多
登录 后发表回答