بررسی روش ارتقاء به NET Core 1.1.
نویسنده: وحید نصیری
تاریخ: ۱۳۹۵/۰۸/۲۷ ۱۱:۵۵
آدرس: www.dntips.ir
| مطالب | ۳۶۹۴ |
| نویسندگان | ۲۷۶ |
| گروههای مطالب | ۱۰۲۴ |
| نقشههای راه | ۱۱۹ |
| دورهها | ۱۴ |
| اشتراکها | ۱۷۹۱۴ |
C:\>dotnet --version 1.0.0-preview2-1-003177
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-1-003177"
}
} Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
}
},
PM> Update-Package
{
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
"Microsoft.AspNetCore.Http.Extensions": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Mvc.Core": "1.1.0",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.0",
"Microsoft.AspNetCore.Razor.Runtime": "1.1.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.Session": "1.1.0",
"Microsoft.AspNetCore.SpaServices": "1.0.0-beta-000019",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.InMemory": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools.DotNet": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.Extensions.Configuration.Binder": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.1.0-preview4-final",
"type": "build"
}
},
"tools": {
"BundlerMinifier.Core": "2.2.301",
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8"
]
},
"Microsoft.EntityFrameworkCore.Tools.DotNet": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8"
]
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Features",
"appsettings.json",
"web.config"
]
},
"configurations": {
"Release": {
"buildOptions": {
"optimize": true,
"platform": "anycpu"
}
}
},
"scripts": {
"precompile": [
"dotnet bundle"
],
"prepublish": [
//"bower install"
],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
} {
"version": "1.0.0-*",
"testRunner": "mstest",
"dependencies": {
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.InMemory": "1.1.0",
"NETStandard.Library": "1.6.1",
"dotnet-test-mstest": "1.1.2-preview",
"MSTest.TestFramework": "1.0.6-preview"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
}
}
} Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Hosting, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. at Sample1.Web.Program.Main(String[] args)
اما خطا همچنان پابرجاست.
پکیج هایی که باید نصب باشد :
و فایل Project.json:
{
"dependencies": {
"Sample1.DataLayer": "1.0.0-*",
"Sample1.PrsLayer.SysB.UserMg": "1.0.0-*",
"Sample1.PrsLayer.SysBase": "1.0.0-*",
"Sample1.PrsLayer.SysS.Setting": "1.0.0-*",
"Sample1.SrvLayer.SysB.UserMg": "1.0.0-*",
"Sample1.SrvLayer.SysBase": "1.0.0-*",
"Sample1.SrvLayer.SysS.Setting": "1.0.0-*",
"CoreCompat.System.Drawing": "1.0.0-beta006",
"Sample1.ExternalResources": "1.0.0-*",
"Sample1.SrvLayer.SysA.BookMg": "1.0.0-*",
"Sample1.SrvLayer.UploadService": "1.0.0-*",
"Sample1.PrsLayer.SysA.BookMg": "1.0.0-*",
"Sample1.IocConfig": "1.0.0-*",
"Sample1.MapperConfig": "1.0.0-*",
"Sample1.PrsLayer.SysU.UiMg": "1.0.0-*",
"Sample1.SrvLayer.SysU.UiMg": "1.0.0-*",
"Sample1.PrsLayer.SysI.SubscribeNewsletter": "1.0.0-*",
"Sample1.SrvLayer.SysI.SubscribeNewsletter": "1.0.0-*",
"Wangkanai.Detection": "1.0.0-*",
"Wangkanai.Detection.Abstractions": "1.0.0-*",
"Wangkanai.Detection.Device": "1.0.0-*",
"Wangkanai.Detection.Engine": "1.0.0-*",
"Wangkanai.Detection.Platform": "1.0.0-*",
"Wangkanai.Detection.Browser": "1.0.0-*",
"StructureMap.Microsoft.DependencyInjection": "1.2.0",
"CacheManager.Core": "0.9.1",
"CacheManager.Microsoft.Extensions.Caching.Memory": "0.9.1",
"CacheManager.Serialization.Json": "0.9.1",
"Newtonsoft.Json": "9.0.2-beta1",
"Microsoft.AspNetCore.SpaServices": "1.0.0-beta-000019",
"AutoMapper": "5.1.1",
"EFSecondLevelCache.Core": "1.0.1",
"Microsoft.AspNetCore.Diagnostics.Elm": "0.2.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Mvc.Localization": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Session": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.FileProviders.Embedded": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.Net.Http.Headers": "1.1.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
"System.Globalization": "4.3.0",
"System.IO": "4.3.0",
"System.Linq": "4.3.0",
"System.Reflection": "4.3.0",
"System.Runtime": "4.3.0",
"System.Runtime.Extensions": "4.3.0",
"System.Runtime.WindowsRuntime": "4.3.0",
"System.Text.RegularExpressions": "4.3.0",
"System.Threading.Tasks": "4.3.0",
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Elmah.Io.AspNetCore": "1.0.1-pre-24",
"Elmah.Io.Extensions.Logging": "1.0.17-pre",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
}
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8"
]
},
"Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8"
]
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"embed": "Views/**/*.cshtml,Areas/**/Views/**/*.cshtml",
"define": [ "DEBUG" ]
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"configurations": {
"Release": {
"buildOptions": {
"optimize": true,
"platform": "anycpu"
}
}
},
"scripts": {
"precompile": [
//"dotnet bundle"
],
"prepublish": [
//"bower install"
],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
} <PublishFramework>netcoreapp1.1</PublishFramework>
فایل Properties\PublishProfiles\Test.pubxml مورد استفاده هم چنین محتوایی را دارد:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<PublishFramework>netcoreapp1.1</PublishFramework>
<UsePowerShell>True</UsePowerShell>
<publishUrl>.\bin\Release\PublishOutput</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>
"Microsoft.AspNetCore.Hosting": "1.1.0", "Microsoft.AspNetCore.Hosting.Server.Abstractions": "1.1.0", "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
C:\Users\Vahid>dotnet --version 1.0.1
The following error occurred attempting to run the project model server process (1.0.1). Unable to start the process. No executable found matching command "dotnet-projectmodel-server"
\.vs\restore.dg(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
"C:\Program Files\dotnet\dotnet.exe" restore "D:\project1\.vs\restore.dg"