0

I am trying to run a debug instance of web service, I am running in windows 2012 server, however it have the following error. I have download the iis express 10 again from microsoft. However it is not work. I found I can run the web service in Windows 10. I found the IIS express version is 10.0.25095.1000 in windows 10. And in windows it is 10.0.15000.1000. Is this the reason? Or any method that I can upgrade the VBC compiler?

    Server Error in '/' Application.
    Compilation Error
    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
    
    Compiler Error Message: BC2001: file 'em.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls' could not be found
    
    Source Error:
    
    
    [No relevant source lines]
    
    Source File: vbc : Command line    Line: 0
    
    
    Show Detailed Compiler Output:
    
    C:\Program Files\IIS Express> "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\vbc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\304622d1\e3f1eacb_b743d901\MonitorAgentLib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\fbd2d313\006ff38d_251bd701\Newtonsoft.Json.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\c69ff0e2\d24564cb_b743d901\CoreLib.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\b3e36328\066be9cb_b743d901\PrintServiceAgentLib.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\00b34a46\4b32e8cb_b743d901\EnTrakLib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\a02ce63f\6c44b6cb_b743d901\ConfigMgr.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\95b0a27d\402a1fcc_b743d901\CoreServiceAgentLib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\dd9f32d7\6bdcebcb_b743d901\PrintRouterAgentLib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Web.PageInspector.Loader\v4.0_1.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Web.PageInspector.Loader.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\53f0c7db\a5e59dcc_b743d901\MobilityPortal.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\assembly\dl3\9f7b9db6\f29e287f_f47ad801\EntityFramework.dll" /out:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\App_global.asax.6kzsdhsa.dll" /D:DEBUG=1 /debug+ /nowarn:41008,40000,40008 /define:_MYTYPE=\"Web\" /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Specialized,Syst  em.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls /warnaserror- /optionInfer+  "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\App_global.asax.6kzsdhsa.0.vb" "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\d9469d7f\2e49f07\App_global.asax.6kzsdhsa.1.vb"

And

Microsoft (R) Visual Basic Compiler version 14.8.3761 for Visual Basic 2012
Copyright (c) Microsoft Corporation. All rights reserved.

This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to Visual Basic 2012, which is no longer the latest version. For compilers that support newer versions of the Visual Basic programming language, see http://go.microsoft.com/fwlink/?LinkID=533241

And

vbc : Command line error BC2001 : file 'em.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls' could not be found
Dai
  • 141,631
  • 28
  • 261
  • 374
want_to_be_calm
  • 1,477
  • 3
  • 23
  • 41
  • the vbc in windows server is Microsoft (R) Visual Basic Compiler version 14.8.3761. the vbc.exe in windows is 14.8.4084. Is the the reason for cannot compiling? – want_to_be_calm Feb 18 '23 at 17:41
  • The compiler error "Command line error BC2001 : file 'em.Configuration,System.Text..." is truncated from the left (it should be `System.Configuration`, not `em.Configuration`, which suggests your `web.config` or `.vbproj` file is broken. – Dai Feb 18 '23 at 18:38
  • If you have Windows Server, you have the _full version_ of IIS, meaning _don't want IIS Express_. Add the Web Server role to the server, including the .Net Framework features. – Joel Coehoorn Feb 18 '23 at 18:39
  • and are you using Visual Studio on your dev box with a copy? You need visual studio installed to do ANY kind of testing, debugging or code fixing here - really, you just do! And I doubt using a newer version of vb.net going to be ANY issue here. Of course, if you using Visual Studio, then opening this project will show what version of .net you using anyway. And more important, you want/need/should/must determine if this is a asp.net web site, or a asp.net web site application. – Albert D. Kallal Feb 18 '23 at 19:37
  • @Dai your comment is the answer. Please turn it as answer. – want_to_be_calm Feb 20 '23 at 02:40
  • @want_to_be_calm so you're saying my speculation that your `web.config` file was broken turned out to be the actual problem? – Dai Feb 20 '23 at 02:45

1 Answers1

0

I might turn this to a real answer later or simply delete it.

As you showed multiple issues in the question body, the primary one you should focus on is "This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to Visual Basic 2012, which is no longer the latest version. For compilers that support newer versions of the Visual Basic programming language, see http://go.microsoft.com/fwlink/?LinkID=533241".

Like I wrote about C# compilers, a modern project (either C# or VB.NET) should no longer use the compilers shipped with .NET Framework itself.

"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\vbc.exe" is the proof that when you saw the error, the legacy compiler was used.

So, you will have to go back to the original web project and check why it uses the legacy VB.NET compiler, but not the latest Roslyn based shipped usually via NuGet packages. Your VS version matters a lot as well. Please edit the question to include such important information so further discussion can be made.

Note that IIS Express is totally irrelevant here, and you shouldn't even install it on a Windows Server machine because it is not designed for production use at all. The full IIS 8 or 8.5 there is the one you should use.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • This is the compiler that comes with windows. This question doesn't answer the reason why people put this query into their search. What is the vbc compiler version 14.8.4084. What .NET version does it represent and which later features is it missing (people who are using this compiler and searching for this, for whatever reason, cannot use another compiler) – Shodan Jul 27 '23 at 00:32
  • @Shodan If you "cannot use another compiler", then you need to resolve that part first. A project that does not take any innovation beyond 2012 is doomed to have tons of problems due to that unreasonable restriction itself, and nobody (including Microsoft) can help further. – Lex Li Jul 27 '23 at 01:04
  • I just spent most of my free time in the last 9 months programming in batch file languages. Some people do not have the luxury to download new compilers. vbc version 14.8.4084 is what comes with Windows 22H2 and unless someone has a time machine, that's all the people searching for "vbc only support 2012" have to work with. Or else, they simply would not be searching for these keywords – Shodan Jul 27 '23 at 03:16
  • @Shodan so what exactly is "the luxury"? The new compilers are available in several ways that require almost zero effort to acquire: 1) source code in Roslyn repo on GitHub, 2) binaries in .NET Core SDKs/Visual Studio Build Tools/Community editions, and 3) NuGet packages. Again, no good reason to stay with the old ones. – Lex Li Jul 27 '23 at 04:05
  • Like I said "for whatever reason", no internet access, read only system, no install permission, proxy blocks all downloads, immutable system take your pick. My system doesn' t even have nuget on it, I ripped it out along with the rest of the BITS system. I' m ripping out microsoft code, the last thing I would do is add more. – Shodan Jul 27 '23 at 07:22
  • @Shodan the more restrictions you add, the further away you bring this conversation to. Note the original question asked in February talked about a different environment. If you want guidance on specific scenario(s), ask new questions. – Lex Li Jul 27 '23 at 12:24