をdotnet publish
を実行しているとき、私はエラーを取得しています:ザ・公開パブリッシングにFileNotFoundExceptionが発生します。ファイルまたはアセンブリをロードできませんでした「Microsoft.DotNet.ProjectModel」
dotnet restore
dotnet build
dotnet publish --configuration Release --runtime active
は成功しているが、私はそれが持つ問題を抱えていると思いますIISIntergration/web.configの変更。
エラー:私はこれをデバッグしたり、解決することができますどのように
Configuring the following project for use with IIS: 'C:\Users\john-luke.laue\repositories\MyApp\src\MyApp\bin\Release\net461\active\publish'
Could not load file or assembly 'Microsoft.DotNet.ProjectModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DotNet.ProjectModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
File name: 'Microsoft.DotNet.ProjectModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Microsoft.AspNetCore.Server.IISIntegration.Tools.PublishIISCommand.Run()
at Microsoft.AspNetCore.Server.IISIntegration.Tools.Program.<>c__DisplayClass0_0.<Main>b__0()
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Microsoft.AspNetCore.Server.IISIntegration.Tools.Program.Main(String[] args)
project.json
{
"userSecretsId": "aspnet5-EspritWebMvc-20150831035846",
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"warningsAsErrors": true
},
"dependencies": {
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Authorization": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Hosting": "1.0.0",
"Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0",
"Microsoft.AspNetCore.Http.Extensions": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Routing": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.Session": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Caching.SqlServer": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.DotNet.ProjectModel": "1.0.0-rc4-003206"
},
"frameworks": {
"net461": {}
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"tools": {
"BundlerMinifier.Core": "2.0.238",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"scripts": {
"postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
},
"publishOptions": {
"include": [
"wwwroot",
"web.config",
"appsettings.json",
"**/*.cshtml",
"Config/*.json"
]
}
}
?
Thaそんなに別のプロジェクトにエンティティフレームワークコードがあり、 "Microsoft.EntityFrameworkCore.Tools"を使用していました。だから私はあなたが言ったようにして、それは今働く! –