microsoft.visualbasic.fileio does not exist

后端 未结 3 2054
长发绾君心
长发绾君心 2020-12-03 09:35

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 th

相关标签:
3条回答
  • 2020-12-03 10:11
    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.

    0 讨论(0)
  • 2020-12-03 10:13

    Application references are not available to uncompiled files in your application (aspx, ashx). There are two solutions to this issue as follows:

    1) Move your code to a compiled part of the application (cs/vb file)

    or

    2) Add the reference to the web config

    My reference was in an ashx file. I simply copied the code from the ashx file to the clipboard, deleted the file from the project, added a new Generic Handler (right click in Visual Studio > Add > Generic Handler), entered the same name as before, and pasted the code from the clipboard into the cs file editor that Visual Studio opened. I now have a cs file that will compile with the project and use the project reference. The file name is the same, so there is no need to update anything else -- just rebuild and deploy.

    0 讨论(0)
  • 2020-12-03 10:15

    I had similar issue, fixed by change TargetFramework (in .csproj) from netstandard2.0 to netcoreapp3.0.

    0 讨论(0)
提交回复
热议问题