2

从 VS2012 RC 部署我的 ASP.NET MVC 3 应用程序时,我不断收到以下错误。我猜测我的代码中的某些内容不正确,但是,我无法从错误信息中确定问题代码所在的位置。此代码构建在我的家庭和工作 PC 上。有什么帮助吗?

d:\temp\zb5bedyk.2dr\temp\root\6b14f900\b1889a38\App_Web_nrwr2tuj.0.cs(37): error CS1041: Identifier expected; 'long' is a keyword
d:\temp\zb5bedyk.2dr\temp\root\6b14f900\b1889a38\App_Web_nrwr2tuj.0.cs(37): error CS1519: Invalid token '>' in class, struct, or interface member declaration

[HttpCompileException]: d:\temp\zb5bedyk.2dr\temp\root\6b14f900\b1889a38\App_Web_nrwr2tuj.0.cs(37): error CS1041: Identifier expected; 'long' is a keyword
   at System.Web.Compilation.AssemblyBuilder.Compile()
   at System.Web.Compilation.WebDirectoryBatchCompiler.CompileAssemblyBuilder(AssemblyBuilder builder)
   at System.Web.Compilation.WebDirectoryBatchCompiler.CompileNonDependentBuildProviders(ICollection buildProviders)
   at System.Web.Compilation.WebDirectoryBatchCompiler.Process()
   at System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors)
   at System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors)
   at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
   at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
   at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
   at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
   at System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath startingVirtualDir)
   at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirtualDir)
   at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallback callback)
   at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback)
   at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback)
   at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback, Boolean forceCleanBuild)
   at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback)
   at System.Web.Compilation.Precompiler.Main(String[] args)




An error occurred during the website precompile. Precompilation failed with exit code 1
4

1 回答 1

0

如果不需要,您可以选择在应用程序设置中禁用预编译。

另请注意,AppHarbor 基础架构上尚未安装 .NET 4.5(很快就会安装),因此您可能需要将项目目标降低到 4.0。

于 2012-08-13T03:31:32.793 回答