我正在尝试运行Web服务的调试示例,我正在Windows 2012 Server中运行,但是它有以下错误。我已经从微软再次下载了IIS Express 10。但是它不工作。我发现我可以在Windows 10中运行Web服务。我发现IIS Express版本在Windows 10中是10. 0. 25095. 1000。而在Windows中是10. 0。15000.1000。这是原因吗?或者我可以升级VBC编译器的任何方法?
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"
还有
用于Visual Basic 2012的Microsoft(R)Visual Basic编译器版本14.8.3761
版权所有(c)Microsoft Corporation。保留所有权利。
此编译器作为Microsoft(R).NET Framework的一部分提供,但仅支持Visual Basic 2012之前的语言版本,Visual Basic 2012**不再是最新版本。有关支持较新版本的Visual Basic编程语言的编译器,请参见http://go.microsoft.com/fwlink/?LinkID=533241
还有
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
1条答案
按热度按时间9vw9lbht1#
我可能会把它变成一个真实的的答案后,或干脆删除它。
正如您在问题正文中显示的多个问题一样,您应该重点关注的主要问题是“此编译器是作为Microsoft(R).NET Framework的一部分提供的,但仅支持Visual Basic 2012之前的语言版本,Visual Basic 2012不再是最新版本。有关支持较新版本的Visual Basic编程语言的编译器,请参见http://go.microsoft.com/fwlink/?LinkID=533241"。
与I wrote about C# compilers一样,现代项目(C#或VB.NET)不应再使用.NET Framework本身附带的编译器。
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\vbc.exe"
证明当您看到错误时,使用的是旧版编译器。所以,你必须回到原始的web项目并检查为什么它使用传统的VB.NET编译器,而不是最新的基于Roslyn的编译器(通常通过NuGet包提供)。你的VS版本也很重要。请编辑问题以包括这些重要信息,以便进行进一步的讨论。
请注意,IIS Express在这里完全无关紧要,您甚至不应该将其安装在Windows Server计算机上,因为它根本不是为生产使用而设计的。您应该使用完整的IIS 8或8.5。