新しいWebApiを構築中です。夏休みの前に.Net Core Rc1を使い始めました。そして、.Net Coreを1.0にして更新したいと思います。RC1からAsp.Net Web APIをアップグレードする
しかし、私はいくつかの問題にぶつかります。解決できればわかりません。
私はいくつかの.Net 4.5.1 x86アセンブリを参照する必要があります。
これは、.Net 4.5.1の使用を許可するモニカを使用する必要があることを意味します。また、両方の世界が必要な場合は、わかっていればnetstandard16しか使用できません。 (https://docs.microsoft.com/da-dk/dotnet/articles/standard/library)
しかし、私は上記のリンクの中で.Net 4.6.3(またはvNext)がまだ利用できないという問題にぶつかります。
netstandard15を参照すると、AspNetCoreライブラリは動作しません。
私はnetstandard16を参照している場合 - 私は
error : Can not find runtime target for framework '.NETStandard,Version=v1.6' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible causes:
error : 1. The project has not been restored or restore failed - run `dotnet restore`
error : 2. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.
error : 3. You may be trying to publish a library, which is not supported. Use `dotnet pack` to distribute libraries.
次のエラーを取得するには、次の
- は、コンパイルの.Net 4.5でのビジネス層を持っているし、それにすべての可能な現在利用可能なビットを使用することですx86用(これを再利用する必要があります - レガシーは素晴らしいです)
- Asp.Netコアサイトを作成
- サイトのビジネスレイヤーを参照してください。 ding
ここで私を助けることができる人はいますか?
EDIT:RC1
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"AutoMapper": "4.2.1",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Swashbuckle.SwaggerUi": "6.0.0-rc1-final",
"Swashbuckle.SwaggerGen": "6.0.0-rc1-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
"frameworks": {
"dnx451": {
"dependencies": {
"BaseClasses": "1.0.0-*",
"DatabaseAccessCS": "1.0.0-*",
"BusinessLogic": "1.0.0-*",
"StandardFunctionsCS": "1.0.0-*"
},
"frameworkAssemblies": {
"System.configuration": "4.0.0.0"
}
}
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
]
}
から(2つのバージョン)project.json
作業
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
"AutoMapper": "5.1.1",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Mvc.Core": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Swashbuckle.SwaggerGen": "6.0.0-beta902",
"Swashbuckle.SwaggerUi": "6.0.0-beta902"
},
"frameworks": {
"netstandard16": {
"dependencies": {
"BaseClasses": {
"target": "project"
},
"DatabaseAccessCS": {
"target": "project"
},
"BusinessLogic": {
"target": "project"
},
"StandardFunctionsCS": {
"target": "project"
}
}
}
}
}
に最も近い来て、最終的な1.0の試み
最終的なjson t帽子はあなたが.NETのコアapplictionをしたい場合、あなたはnetcoreapp1.0
ターゲットフレームワークを使用する必要があります
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"platform": "x86"
},
"runtimes": {
"win": ["win7-x86", "win8-x86", "win10-x86"]
},
"dependencies": {
"AutoMapper": "5.1.1",
"LogiholdBusinessObjects": "5.5.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Mvc.Core": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Swashbuckle.SwaggerGen": "6.0.0-beta902",
"Swashbuckle.SwaggerUi": "6.0.0-beta902"
},
"frameworks": {
"net451": {
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0"
}
}
}
}
project.jsonを共有していただけますか? – Sanket