當我編譯我的Web應用程序的版本時,出現以下錯誤。該項目之前在另一臺硬盤驅動器上運行良好。所以我認爲配置存在問題。我做了一些研究,並記錄了Web Deploy問題,但我無法驗證過去機器上正在使用的版本。Visual Studio 2010編譯錯誤
以下是錯誤:
The "IsCleanMSDeployPackageNeeded" task failed unexpectedly. System.InvalidCastException: [A]Microsoft.Web.Deployment.DeploymentProviderOptions cannot be cast to [B]Microsoft.Web.Deployment.DeploymentProviderOptions. Type A originates from 'Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\Microsoft.Web.Deployment\9.0.0.0__31bf3856ad364e35\Microsoft.Web.Deployment.dll'. Type B originates from 'Microsoft.Web.Deployment, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\Microsoft.Web.Deployment\7.1.0.0__31bf3856ad364e35\Microsoft.Web.Deployment.dll'. at Microsoft.Web.Deployment.ArchiveElementHelper.get_ProviderContext() at Microsoft.Web.Deployment.ZipPackageProvider.d__0.MoveNext() at Microsoft.Web.Deployment.DeploymentObject.d__9.MoveNext() at Microsoft.Web.Deployment.DeploymentObject.d__0.MoveNext() at Microsoft.Web.Publishing.Tasks.IsCleanMSDeployPackageNeeded.CheckMSDeployDumpContainIisSetting(DeploymentObject deploymentObject, String& iisMSDeployProviderName) at Microsoft.Web.Publishing.Tasks.IsCleanMSDeployPackageNeeded.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() 0 0 PKL_QMW
檢查項目包含的dll。它似乎以某種方式引用了兩個不同版本的Microsoft.Web.Deployment.dll。 – Liron