Reputation: 944
As I noticed here we have two type of deployments: "Framework-dependent deployment" and "Self-contained deployment".
But it didn't describe how to get "Framework-dependent deployment" on net451.
How I can get "Framework-dependent deployment" on net451?
Here is my project.json:
{
"webroot": "wwwroot",
"userSecretsId": "aspnet-AdsProject-110defb3-febe-4379-a8a3-0a8b20607a27",
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNetCore.Authentication.Cookies": "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.1",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
"Microsoft.EntityFrameworkCore.SqlServer.Design": {
"version": "1.0.1",
"type": "build"
},
"Microsoft.EntityFrameworkCore.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.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.1",
"Microsoft.Extensions.Caching.Abstractions": "1.0.0",
"Microsoft.Extensions.Caching.Memory": "1.0.0",
"Microsoft.Extensions.Configuration.Abstractions": "1.0.0",
"StackExchange.Redis": "1.1.605",
"Dapper": "1.50.2",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing.Abstractions": "1.0.1",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Abot": "1.5.1.50"
},
"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": "1.0.0-preview2-final",
"Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8"
]
}
},
"frameworks": {
"net451": {
"frameworkAssemblies": {
"System.Runtime.Serialization": "4.0.0.0",
"System.ServiceModel": "4.0.0.0"
}
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"config.json",
"config.Development.json",
"web.config"
],
"exclude": [
"node_modules",
"bower_components",
"SqlScripts",
"PrivateJs",
"**.xproj",
"**.user",
"**.vspscc"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle", "npm install" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Upvotes: 1
Views: 1275
Reputation: 49789
The short answer: you already have it.
Targeting net451
, you setup the target framework as .NET Framework 4.5.1, and it must be installed on target machine using the .NET Framework redistributable (Dotnetfx.exe) before installing your application. In other words .NET Framework application is always framework-dependent.
On the other side, Self-contained deployments (SCD) relates only to .NET Core Framework, and allows to deploy framework together with app:
For a self-contained deployment, you deploy not only your app and any third-party dependencies, but the version of .NET Core that you build your app with.
Upvotes: 1