有人知道这意味着什么吗?我在我的CI构建(CruiseControl.Net + NAnt + MSBuild)中遇到此错误,在本地该项目可以正常编译...

My.Web.csproj: Error MSB4014: The build was aborted because of an internal failure.
Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: refCount should not be less than 1.
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
   at Microsoft.Build.Collections.CopyOnWriteDictionary\`2.CopyOnWriteBackingDictionary\`2.get_HasNoClones()
   at Microsoft.Build.Collections.CopyOnWriteDictionary\`2.set_Item(K key, V value)
   at Microsoft.Build.Collections.CopyOnWriteDictionary`2.System.Collections.IDictionary.set_Item(Object key, Object value)
   at Microsoft.Build.BuildEngine.BuildItem..ctor(String itemName, ITaskItem taskItem)
   at Microsoft.Build.BuildEngine.TaskEngine.GatherTaskItemOutputs(Lookup lookup, TaskOutput taskOutputSpecification, String itemName, String propertyName, Object outputs)
   at Microsoft.Build.BuildEngine.TaskEngine.GatherGeneratedTaskOutputs(Lookup lookup, TaskOutput taskOutputSpecification, String taskParameterName, String itemName, String propertyName, ITask task)
   at Microsoft.Build.BuildEngine.TaskEngine.GatherTaskOutputs(TaskExecutionMode howToExecuteTask, ITask task, ItemBucket bucket)
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteBucket(EngineProxy engineProxy, ItemBucket bucket, Int32 bucketNumber, TaskExecutionMode howToExecuteTask)
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(TaskExecutionMode howToExecuteTask, Lookup lookup)
   at Microsoft.Build.BuildEngine.TaskExecutionState.TaskEngineExecuteTask(TaskEngine taskEngine, TaskExecutionMode howTaskShouldBeExecuted, Lookup lookup)
   at Microsoft.Build.BuildEngine.TaskExecutionState.ExecuteTask()
   at Microsoft.Build.BuildEngine.TaskExecutionModule.ExecuteTask(TaskExecutionState taskState)
   at Microsoft.Build.BuildEngine.TargetExecutionWrapper.SubmitNonIntrinsicTask(XmlElement taskNode, ITaskHost hostObject, ProjectBuildState buildContext)
   at Microsoft.Build.BuildEngine.TargetExecutionWrapper.ExecuteCurrentTask(ProjectBuildState buildContext)
   at Microsoft.Build.BuildEngine.TargetExecutionWrapper.ContinueRunningTasks(ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext, Boolean startingFirstTask)
   at Microsoft.Build.BuildEngine.TargetExecutionWrapper.ContinueBuild(ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext)
   at Microsoft.Build.BuildEngine.Project.ExecuteNextActionForProjectContext(ProjectBuildState buildContext, Boolean initialCall)
   at Microsoft.Build.BuildEngine.Project.CalculateNextActionForProjectContext(ProjectBuildState buildContext)
   at Microsoft.Build.BuildEngine.Project.ContinueBuild(ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext)
   at Microsoft.Build.BuildEngine.Project.BuildInternal(BuildRequest buildRequest)
   at Microsoft.Build.BuildEngine.Engine.BuildProjectInternalInitial(BuildRequest buildRequest, Project project)
   at Microsoft.Build.BuildEngine.Engine.BuildProjectInternal(BuildRequest buildRequest, ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext, Boolean initialCall)
   at Microsoft.Build.BuildEngine.Engine.EngineBuildLoop(BuildRequest terminatingBuildRequest)
   at Microsoft.Build.BuildEngine.Engine.PostProjectEvaluationRequests(Project project, String[] projectFiles, String[][] targetNames, BuildPropertyGroup[] globalPropertiesPerProject, IDictionary[] targetOutputsPerProject, BuildSettings buildFlags, String[] toolVersions)

Unexpected error while compiling project 'My.Web'

Exception has been thrown by the target of an invocation.

MSB0001: Internal MSBuild Error: refCount should not be less than 1.

最佳答案

我在类似的环境中遇到了相同的问题。就我而言,该项目具有对Active DS类型库的COM引用,该库未安装在构建服务器上。

为了解决此问题,我删除了COM参考,并添加了对互操作程序集的引用,然后将该互操作程序集部署到了构建服务器。

关于c# - MSB0001:内部MSBuild错误:refCount不应小于1,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8947528/

10-15 09:21