我已經得到了當地建立了一個解決方案,我創建了一個新的版本,並增加了一個步驟,它無法解析錯誤,當嘗試DOTNET恢復多項目解決方案
dotnet restore
我得到這個錯誤消息:
... OTHER SUCCESSFUL INSTALLATIONS ...
log : Installing Microsoft.Extensions.FileProviders.Abstractions 1.0.0.
log : Installing Microsoft.Extensions.Configuration.Abstractions 1.0.0.
log : Installing Microsoft.Extensions.DependencyInjection.Abstractions 1.0.0.
log : Writing lock file to disk. Path: C:\a\1\s\Wedding.WebApp\project.lock.json
log : C:\a\1\s\Wedding.WebApp\project.json
log : Restore failed in 13722ms.
Errors in C:\a\1\s\Wedding.WebApp\project.json
Unable to resolve 'Wedding.Application' for '.NETFramework,Version=v4.6.1'.
Unable to resolve 'Wedding.Common' for '.NETFramework,Version=v4.6.1'.
Unable to resolve 'Wedding.WebApp.Setup' for '.NETFramework,Version=v4.6.1'.
它引用了我的主要Web項目引用的三個其他項目。
這是我project.json
{
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"net461": {
"dependencies": {
"Wedding.Application": {
"target": "project"
},
"Wedding.Common": {
"target": "project"
},
"Wedding.WebApp.Setup": {
"target": "project"
}
}
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
有誰知道爲什麼會被示數?
作爲一項主要工作,我發現我需要創建一個新的WebApp和一個新項目。然後,我將代碼逐個移植到將它發佈到新的WebApp的新項目中。每次檢查發佈後確定。在移植所有內容之後,我不知道是什麼導致了這一點,但是現在我可以通過右鍵單擊該項目進行發佈。 – chris31389
我找到了同樣的東西。一個惱人的解決方法,但至少它擺脫了錯誤。 – Alyce
您是否嘗試將'net461'下的依賴關係移動到'dependencies'節點下的位置? – Deilan