.net 4.6.1 package
を.net core app
に消費しようとしています。私は、ナゲットパッケージのダウンロードに成功しています。しかし、依存関係をサービスとして登録しようとすると、エラーが発生します。クラスJobSchedulerIntegrator
として.Netコアアプリケーションに `mscorlib`をインストールできない
services.AddTransient<IJobSchedulerIntegrator, JobSchedulerIntegrator>(); //throwing error that mscorlib needs to be installed
エラー
The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
object
を継承しています。 mscorlib
が必要です。しかし、アプリにmscorlib
をインストールすることはできません。
とにかく私はこの問題を解決できますか?
Project.json
{
"dependencies": {
"API.Framework.Integrators.JobScheduler": "1.0.0",
"BundlerMinifier.Core": "2.2.281",
"Microsoft.AspNetCore.Authentication.Google": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.EntityFrameworkCore.Design": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.Extensions.Caching.Abstractions": "1.0.0",
"Microsoft.Extensions.Caching.Memory": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.DependencyInjection": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Newtonsoft.Json": "9.0.1",
"Serilog": "2.0.0",
"Serilog.Extensions.Logging": "1.0.0",
"Serilog.Sinks.Literate": "2.0.0",
"System.Runtime.Extensions": "4.1.0",
"System.Security.Cryptography.Algorithms": "4.2.0"
},
"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",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"net461",
"dotnet5.6",
"dnxcore50",
"portable-net452+win81"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
project.jsonファイルを追加できますか? – Kalten
@Kalten、project.jsonコンテンツを追加しました。 – Venky
重複するhttp://stackoverflow.com/questions/38646466/referencing-mscorlib-4-0-0-0-from-net-core-1-0-class-library/38688430#38688430 – Thomas