首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >msbuild ASPNETCOMPILER msbuild startIndex错误

msbuild ASPNETCOMPILER msbuild startIndex错误
EN

Stack Overflow用户
提问于 2012-11-07 18:46:04
回答 1查看 1.7K关注 0票数 7

我有一个web项目,在Windows 7上构建良好,没有错误。当我升级到Windows 8时,将项目编译到已编译的网站会引发一个错误。从csproj文件编译(而不是创建网站)运行良好。这是msbuild引发的实际错误。

错误ASPRUNTIME: startIndex不能大于字符串的长度。mycsproj.file.here

msbuild正在运行的抛出错误的行是

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

我还可以通过运行带有aspnet_compiler标记的-errorstack来获得堆栈跟踪,这就是它生成的

代码语言:javascript
复制
[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)

我该怎么解决这个问题?由于堆栈跟踪,我假设它与程序集名称有关,但我无法确定如何修复它。有人能帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2013-08-29 17:24:15

使用Visual运行“清洁”,然后运行“重构”。这解决了我的问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13276125

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档