我在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中本地运行网站可以正常工作。对谷歌的搜索并没有太多回报。有什么想法可以解决这个错误吗?
答案 0 :(得分:0)
这是由于web.config中的一些混合<assemblyBinding>
重定向造成的。显然这些是由Nuget或某些过程添加的。我删除了所有的assemblyBindings然后只重新添加了必需的,这个错误就消失了。奇怪,但工作。