MSBuild的ASPNETCOMPILER ASPNETRUNTIME在startIndex错误 [英] msbuild ASPNETCOMPILER ASPNETRUNTIME startIndex error

查看:669
本文介绍了MSBuild的ASPNETCOMPILER ASPNETRUNTIME在startIndex错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个web项目,建立精细的Windows 7,没有错误。当我升级到Windows 8,编译该项目为编译网站抛出一个错误。从的csproj文件编译(而不是建立一个网站)正常工作。这是受抛出的MSBuild实际误差

I have a web project that builds fine on Windows 7 with no error. When I upgraded to Windows 8, compiling the project into a compiled website throws an error. Compiling from the csproj file (not creating a website) works fine. This is the actual error that is thrown by msbuild

ASPNETCOMPILER:错误ASPRUNTIME:在startIndex不能比串的长度。 [mycsproj.file.here]

ASPNETCOMPILER : error ASPRUNTIME: startIndex cannot be larger than length of string. [mycsproj.file.here]

这的MSBuild正在运行抛出错误的行

The line that msbuild is running that is throwing the error is

C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ aspnet_compiler.exe -v / -p my.physical.project.path -u my.physical.project.path \ buildartifacts \ CompiledWebsite

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p my.physical.project.path -u my.physical.project.path\buildartifacts\CompiledWebsite

我是能够运行与-errorstack标签aspnet_compiler得到一个堆栈跟踪,以及,这​​是它产生什么

I was able to get a stack trace as well from running the aspnet_compiler with the -errorstack tag and this is what it generated

[ArgumentOutOfRangeException]: startIndex cannot be larger than length of string.
Parameter name: startIndex
    at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
    at System.Web.Compilation.DiskBuildResultCache.MarkAssemblyAndRelatedFilesForDeletion(String assemblyName)
    at System.Web.Compilation.DiskBuildResultCache.CacheBuildResult(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart)
    at System.Web.Compilation.BuildManager.CacheBuildResultInternal(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart)
    at System.Web.Compilation.WebDirectoryBatchCompiler.CacheAssemblyResults(AssemblyBuilder assemblyBuilder, CompilerResults results)
    at System.Web.Compilation.WebDirectoryBatchCompiler.CompileAssemblyBuilder(AssemblyBuilder builder)
    at System.Web.Compilation.WebDirectoryBatchCompiler.<CompileNonDependentBuildProviders>b__0(AssemblyBuilder assemblyBuilder)
    at System.Web.Compilation.CompilationUtil.CompileParallel(ICollection assemblyBuilders, Action`1 action)
    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.PrecompileAppInternal(VirtualPath startingVirtualDir, IEnumerable`1 excludedVirtualPaths)
    at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirtualDir, IEnumerable`1 excludedVirtualPaths)
    at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallback callback, IEnumerable`1 excludedVirtualPaths)
    at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List`1 excludedVirtualPaths)
    at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List`1 excludedVirtualPaths)
    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)

我该如何解决这个问题?我认为它是与程序集名称因堆栈跟踪,但我不能为我的生活弄清楚怎样做才能解决它。有人能帮助我吗?

How do I fix this? I assume it has something to do with the assembly name due to the stack trace, but I cannot for the life of me figure out what to do to fix it. Could someone help me out?

推荐答案

运行清理,其次是重建使用Visual Studio。这解决了这个问题对我来说。

Run "Clean" followed by "Rebuild" using Visual Studio. This fixed the problem for me.

这篇关于MSBuild的ASPNETCOMPILER ASPNETRUNTIME在startIndex错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆