Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在IIS Express中启动MVC 3应用程序时,输入字符串的格式不正确_C#_Asp.net Mvc 3_Iis Express - Fatal编程技术网

C# 在IIS Express中启动MVC 3应用程序时,输入字符串的格式不正确

C# 在IIS Express中启动MVC 3应用程序时,输入字符串的格式不正确,c#,asp.net-mvc-3,iis-express,C#,Asp.net Mvc 3,Iis Express,我目前正在一个MVC3站点上工作,在本地的IIS Express和VS2010中。该应用程序运行良好,直到IIS Express挂起,我不得不终止该进程 从那时起,当我使用IIS Express在VS2010中运行站点时,我得到了这个YSoD: Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web

我目前正在一个MVC3站点上工作,在本地的IIS Express和VS2010中。该应用程序运行良好,直到IIS Express挂起,我不得不终止该进程

从那时起,当我使用IIS Express在VS2010中运行站点时,我得到了这个YSoD:

Input string was not in a correct format. 
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.FormatException: Input string was not in a correct format.

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: 

[FormatException: Input string was not in a correct format.]
   System.VersionResult.SetFailure(ParseFailureKind failure, String argument) +9566207
   System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent) +9549261
   System.Version.TryParseVersion(String version, VersionResult& result) +135
   System.Version.Parse(String input) +68
   System.Version..ctor(String version) +23
   System.Web.Compilation.CompilationUtil.GetVersionFromVString(String version) +76
   System.Web.Compilation.CompilationUtil.CreateCodeDomProviderWithPropertyOptions(Type codeDomProviderType) +116
   System.Web.Compilation.CompilationUtil.CreateCodeDomProviderNonPublic(Type codeDomProviderType) +12
   System.Web.Compilation.AssemblyBuilder..ctor(CompilationSection compConfig, ICollection referencedAssemblies, CompilerType compilerType, String outputAssemblyName) +366
   System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +700
   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +40
   System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +9118854
   System.Web.Compilation.BuildManager.CompileGlobalAsax() +44
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +265

[HttpException (0x80004005): Input string was not in a correct format.]
   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +62
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +421
   System.Web.Compilation.BuildManager.CallAppInitializeMethod() +31
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +691

[HttpException (0x80004005): Input string was not in a correct format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090876
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
堆栈跟踪似乎没有指向代码问题。IIS Express完全有可能是在转移视线,而我实际上在某个地方把代码搞砸了。。。但我希望堆栈跟踪/调试器能够捕捉到这一点

有人知道我该如何追踪这件事吗

提前感谢:)

编辑

我刚刚在VS开发服务器上试用过,但也出现了同样的错误,所以可能不是IIS Express

编辑2

项目版本(在AssemblyInfo.cs中)如下所示:

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("One_Page_Booking_Engine")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("One_Page_Booking_Engine")]
[assembly: AssemblyCopyright("Copyright ©  2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("287108fb-4a0c-419f-8b35-a3bc0e2f8617")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers 
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
编辑3:

我现在尝试删除
bin
obj
的内容,重新启动VS并重新启动我的电脑。什么都没有:(我还尝试将网站发布到带有IIS的服务器并运行它:我得到完全相同的YSoD!

排序

问题出在我的web.config中。我从HTML5样板中取出了模板,最后得到了以下块:

<compilers>
      <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v2.0"/>
        <providerOption name="WarnAsError" value="false"/>
      </compiler>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v2.0"/>
        <providerOption name="OptionInfer" value="true"/>
        <providerOption name="WarnAsError" value="false"/>
      </compiler>
    </compilers>

这很好,除了部署它时,我将
值从
v2.0
更改为
v4.0
。尽管最初工作,可能运行缓存或其他东西,但这正是导致它吐出毛球的原因

我已经删除了整个
编译器
块,现在它可以正常工作了


谢谢大家的评论:)

您关闭项目并重新打开了吗?如果是这样,请尝试将其切换回内置web服务器(casini),然后再切换回。您将项目版本设置为什么?它应该只包含数字。是否清除了临时ASP.NET文件?(例如C:\Windows\Microsoft.NET\Framework\v4.0.30319\临时ASP.NET文件)我已尝试重新打开VS,甚至完全重新启动!没有成功:(卡西尼号也有同样的问题,所以我想这一定是代码/配置问题?我刚刚尝试清除ASP.Net临时文件夹(谢谢,@dtryon),但仍然是相同的YSoD:(