Lui*_*cia 117 c# asp.net asp.net-mvc asp.net-mvc-3
我使用VS 2015 RC和MVC模板创建了一个新的应用程序,并且没有修改任何代码行我有这个错误:
Method not found: '!!0[] System.Array.Empty()'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.]
SAASApp.BundleConfig.RegisterBundles(BundleCollection bundles) in C:\Proyectos\SAASApp\SAASApp\App_Start\BundleConfig.cs:29
SAASApp.MvcApplication.Application_Start() in C:\Proyectos\SAASApp\SAASApp\Global.asax.cs:18
[HttpException (0x80004005): Method not found: '!!0[] System.Array.Empty()'.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +483
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +176
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +350
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +305
[HttpException (0x80004005): Method not found: '!!0[] System.Array.Empty()'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +661
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +96
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189
Run Code Online (Sandbox Code Playgroud)
第一次发生在我身上,所以我现在卡住了
小智 221
我在生产服务器上遇到这种情况,而在开发机器上一切正常.
在目标计算机上安装.NET Framework 4.6已修复此问题.
gau*_*han 27
很抱歉迟到了,但如果其他人通过TeamCity构建遇到此问题,我可以描述我们必须做的事情.
.NET 4.6安装在我们的构建服务器上(但不在应用程序服务器上),RunnerType是Visual Studio(sln),Visual Studio选项设置为2015.
这迫使构建使用4.6,我需要将Visual Studio选项更改为2013以强制构建使用4.5.2
Ami*_*imi 10
对于面临这种情况的其他人:
如果查看web.config文件,您将意识到在<compilation>
标记中,您将值targetFramework
设置为低于4.6的版本.但事实上,在构建时,您通过.NET FrameWork 4.6或更高版本发布了您的应用程序(对应于ASP.NET MVC 4.6及更高版本).
因此,如果将值更改targetFramework
为4.6,则错误会将形状更改为:
"targetFramework"属性当前引用的版本晚于安装的.NET Framework版本.
这是真正的错误,你可以通过在Web App的生产环境中安装适当版本的.Net FrameWork来摆脱它.
将 .NET Framework 更新到最新版本 (4.7.2) 解决了该问题。 感谢@Andrey Kovalenko 提供解决方案。
但错误不应该是这样的,
我不确定告诉每个客户更新他们的 .NET Framework 是否适用。我遇到这个问题,特别是在安装了Windows Embedded OS 的系统中,仅在生产环境中。
从我们的代码库本身来看,还有其他方法可以克服这种行为吗?
归档时间: |
|
查看次数: |
70858 次 |
最近记录: |