-1

我們有要求將.Net Web應用程序從.Net框架3.5遷移到4.6.2。我已將應用程序遷移到框架工作4.6.2並能夠運行應用程序。使用框架發佈遷移ASP.Net Web應用程序時出錯4.6.2

發佈代碼時出現問題。我得到一個錯誤:

Copying file obj\Debug\Project.dll to obj\Release\Package\PackageTmp\obj\Debug\Project.dll failed

在遷移

(框架工作4.6.2)的代碼,但是發佈的舊代號(車架工作3.5)時,我沒有看到任何錯誤。 我已經嘗試了許多事情:

  1. 從溶液
  2. 跑msbuild.exe命令發佈(自定義的MSBuild XML)
  3. 重新啓動IDE(VS2015)
  4. 重新啓動機器
  5. 刪除該文件夾的OBJ

我還應該做什麼?

錯誤 當從VS試過:發佈

Error Copying file obj\Debug\Project.dll to obj\Release\Package\PackageTmp\obj\Debug\Project.dll failed. Could not find file 'obj\Debug\Project.dll'

當從自定義的MSBuild試圖

構建失敗。

"\Build1.xml" (default target) (1) -> "project.csproj" (default target) (2) -> (_CopyWebApplicationLegacy target) -> C:\Program Files\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microso ft.WebApplication.targets(182,5): error MSB3030: Could not copy the file "js\id le-timer.js" because it was not found.

C:\Program Files\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microso ft.WebApplication.targets(182,5): error MSB3030: Could not copy the file "js\jq uery-idleTimeout-iframes.min.js" because it was not found.

0 Warning(s) 2 Error(s)

+0

你能重新啓動計算機,然後再試一次嗎? – Win

+0

你介意提供詳細的錯誤日誌嗎?它被另一個進程使用了​​嗎?它要麼堅持引用,不要釋放資源,否則會導致過程在告知關閉時不結束。解決這個問題,這個問題會自行解決。請嘗試關閉防病毒並清理\ bin文件夾,檢查它是否正常工作。 –

+0

錯誤\t \t將文件obj \ Debug \ .dll複製到obj \ Release \ Package \ PackageTmp \ obj \ Debug \ .dll失敗。找不到文件'obj \ Debug \ .dll' – Bhaski

回答

0

這裏有我也跟着來解決這個問題

  1. Upgrade all the dll's (non solution dll's) with nuget package manager along with the solution migration from 3.5 to 4.6.2 framework.
  2. Remove un-used dll's from the project
  3. rebuild and publish!!

我的問題按照上述步驟後解決的步驟。

謝謝

+0

感謝您在這裏分享您的解決方案,您可以將其標記爲答案,這樣可以幫助其他社區成員獲得相同的問題。 –