【问题标题】:Version string portion was too short or too long - Azure版本字符串部分太短或太长 - Azure
【发布时间】:2014-07-22 17:23:40
【问题描述】:

我在 Windows Azure 网站上上传了一个项目,但遇到一个奇怪的错误。

Server Error in '/' Application.

Version string portion was too short or too long.

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.ArgumentException: Version string portion was too short or too long.

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: 


[ArgumentException: Version string portion was too short or too long.]
   System.VersionResult.SetFailure(ParseFailureKind failure, String argument) +10913423
   System.Version.TryParseVersion(String version, VersionResult& result) +424
   System.Version.Parse(String input) +68
   System.Version..ctor(String version) +23
   System.Web.WebPages.Deployment.WebPagesDeployment.GetVersionFromConfig(NameValueCollection appSettings) +73
   System.Web.WebPages.Deployment.WebPagesDeployment.GetVersion(String path, NameValueCollection appSettings) +28
   System.Web.WebPages.Deployment.PreApplicationStartCode.StartCore(Version testVersion) +34
   System.Web.WebPages.Deployment.PreApplicationStartCode.Start() +70

[InvalidOperationException: The pre-application start initialization method Start on type System.Web.WebPages.Deployment.PreApplicationStartCode threw an exception with the following error message: Version string portion was too short or too long..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +547
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +521

[HttpException (0x80004005): The pre-application start initialization method Start on type System.Web.WebPages.Deployment.PreApplicationStartCode threw an exception with the following error message: Version string portion was too short or too long..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9930568
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.36213

在 IIS 中本地运行网站可以正常工作。在 Google 上搜索并没有返回多少。任何想法这个错误可能是什么?

【问题讨论】:

    标签: azure


    【解决方案1】:

    这是由于 web.config 中的一些混淆 <assemblyBinding> 重定向。显然,这些是由 NuGet 或某些进程添加的。我删除了所有的 assemblyBindings,然后只重新添加了必要的,这个错误就消失了。奇怪,但有效。

    【讨论】:

      猜你喜欢
      • 2020-03-02
      • 1970-01-01
      • 2019-02-18
      • 1970-01-01
      • 2016-10-27
      • 2019-08-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多