I'm trying to use PostgreSQL for the first time and having a little trouble getting it to build without errors unless I lock into RC2 packages which is fine. After locking into the RC2 packages, I have one error that I can't seem to shake that I could use help troubleshooting:
ERROR
Startup.cs(22,18): error CS1061: 'IServiceCollection' does not contain a definition for 'AddNpgsql' and no extension method 'AddNpgsql' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)
PROJECT.JSON
{
"buildOptions": {
"preserveCompilationContext": true,
"emitEntryPoint": true,
"warningsAsErrors": true,
"debugType": "portable",
"copyToOutput": {
"include": [
"wwwroot",
"Views",
"config.json",
"web.config"
]
}
},
"dependencies": {
"AspNet.Security.OAuth.Introspection": "1.0.0-alpha1-final",
"AspNet.Security.OAuth.Validation": "1.0.0-alpha1-final",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc.Formatters.Json": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc.Cors": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.Commands": "1.0.0-rc2-*",
"Microsoft.EntityFrameworkCore.Relational": "1.0.0-rc2-final",
"Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.0-*",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-final",
"OpenIddict.Core": "1.0.0-*",
"OpenIddict.EF": "1.0.0-*"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002702"
}
},
"imports": [
"dnxcore50",
"portable-net451+win8"
]
}
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
}
},
"scripts": {
"postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"config.json",
"web.config"
]
}
}
STARTUP.CS (Partial)
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddEntityFramework()
.AddNpgsql()
.AddDbContext<ApplicationContext>(options =>
options.UseNpgsql("Host=localhost;Username=dev;Password=dev;Database=tesdb"));
services.AddIdentity<tbl_ApplicationUser, tbl_ApplicationRole>()
.AddEntityFrameworkStores<ApplicationContext>()
.AddUserStore<CustomStore>()
.AddDefaultTokenProviders()
.AddOpenIddictCore<tbl_Application>
(conf => conf.UseEntityFramework());
services.AddAuthorization(options => {
options.AddPolicy("Default", builder => {
builder.RequireAuthenticatedUser();
builder.RequireActiveUser();
});
options.DefaultPolicy = options.GetPolicy("Default");
});
services.AddTransient<IEmailSender, AuthMessageSender>();
services.AddTransient<IDatabaseInitializer, DatabaseInitializer>();
services.AddTransient<IUtilityService, UtilityService>();
services.AddScoped<ICommonRepository, CommonRepository>();
}
In EF Core 1.1 you need to use this code:
public class Startup
{
//...
public void ConfigureServices(IServiceCollection services)
{
//...
services.AddEntityFrameworkNpgsql();
}
}
and
public class DatabaseClass : DbContext
{
//...
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql("my connection string");
}
}
The RC2 driver replaced AddNpgsql with AddEntityFrameworkNpgsql, so
replace this code block:
services.AddEntityFramework()
.AddNpgsql()
.AddDbContext<ApplicationContext>(options =>
options.UseNpgsql("Host=localhost;Username=dev;Password=dev;Database=tesdb"));
With this one:
services.AddEntityFrameworkNpgsql()
.AddDbContext<ApplicationContext>(options =>
options.UseNpgsql("Host=localhost;Username=dev;Password=dev;Database=tesdb"));
Related
I am new in entity framework core and I want to use entity framework core in asp.net core. But when I do add-migration firstMigration it always show below error :
Invalid JSON file in D:\OwnLearnings\EFCore\AspNetCore_EFCore_001\src\AspNetCore_EFCore_001\project.json
Project.json :
{
"dependencies": {
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "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.0",
"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.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.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": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
I unable to find what is the error. I am facing this type of problem first time in entity framework. Thanks in advance.
Are you missing a reference to the Entity framework package in the dependencies:
"Microsoft.EntityFrameworkCore": "1.0.0"
Also you need the imports for EF Core for executing migrations and updates (command line). This needs to be in the tools seciton (the tools reference also needs to be in the dependencies like you put it, do not remove it)
"dependencies": {
...
},
"tools": {
..,
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"Imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
}...
I updated my project to latest Asp.net core 1.1.
After some adjustments to configuration now I'm able to debug and compile from VS Code. However, I'm not able to debug (but can build) in VS 2015.
In VS 2015 is displaying "References (Errors - see Error List)" which is showing the following:
An item with the same key has already been added. Key:
Microsoft.NETCore.App
This is my current global.json:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-1-003177"
}
}
And my project.json:
{
"version": "1.11.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"Microsoft.NETCore.App": "1.1.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
"Dapper": "1.50.2",
"BCrypt.Net-Core": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Logging": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.1.0-preview4-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": [
"dotnet5.6",
"portable-net45+win8",
"dnxcore50"
]
}
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Is there any change to Debug again from VS Studio 2015?
you have NETCoreApp listed in 2 places, once in the main dependencies section and once in the framework specific dependencies below netcoreapp. I would remove the one below netcoreapp and change the one in the main dependencies section like this:
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
It is possible they are cached in project.lock.json. Delete that file and rebuild and the issue should go away.
Hi everyone I've the problem with EFCore migration in project on ASP.NET Core.
Some technical info:
OS: macOS
dotnet --version
1.0.0-preview2-003148
Here is my project.json:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Routing": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
"Microsoft.Extensions.Logging": "1.1.0-preview1-final",
"Microsoft.Extensions.Logging.Console": "1.1.0-preview1-final",
"Microsoft.Extensions.Logging.Debug": "1.1.0-preview1-final",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.EntityFrameworkCore": "1.1.0-preview1-final",
"Microsoft.Extensions.Logging.Abstractions": "1.1.0-preview1-final",
"Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.2",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview3-final",
"Microsoft.EntityFrameworkCore.Design": {
"type": "build",
"version": "1.1.0-preview1-final"
},
"Npgsql.EntityFrameworkCore.PostgreSQL.Design": "1.0.2"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview3-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
],
"buildOptions": {
"emitEntryPoint": true
}
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [
"dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
]
},
"tooling": {
"defaultNamespace": "TTT"
}
}
I launch "dotnet ef" command from project.json folder.
My actions:
1) dotnet restore
2) dotnet ef
After that I get this error: "No executable found matching command "dotnet-ef".
I have static "Main" method in Program class (Program.cs).
Does anyone have an idea what I am doing wrong?
Thanks.
You need to add "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final" to the tools section.
See https://blogs.msdn.microsoft.com/dotnet/2016/10/25/announcing-entity-framework-core-1-1-preview-1/ for more info
Version 1.1.0 was released today, so the correct version to add in project.json now is 1.1.0-preview4-final:
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final"
}
After upgrading to netcoreapp1.0 I'm not able to run my project. I've resolved all errors and fixes for the update, restored packages and get no errors anywhere.
(I followed this guide for upgrading https://learn.microsoft.com/en-us/dotnet/articles/core/migrating-from-dnx)
All I get is the classic Object reference not set to an instance of an object. which kind of drives me nuts.
Run command
$ dotnet run
Object reference not set to an instance of an object.
My tools:
$ dotnet --info
.NET Command Line Tools (1.0.0-preview2-003121)
Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529bc5
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.10
OS Platform: Darwin
RID: osx.10.10-x64
(Also ran on my Win 10 box with the same result, unable to run from cmd or visual studio as well)
The --log 4 doesn't output anything either.
Any ideas on how to nail it down?
UPDATE:
project.json
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.CommandLine": "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",
"System.Diagnostics.Process" : "4.1.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},
"tooling": {
"defaultNamespace": "Avantime.Sniff"
}
}
Not sure what caused the error above but after reading various release notes on github and minor fixes this was the needed adjustments to get it working.
Also with a lot of work removing all references to old libraries depending on older code than netcore50 (mostly updating EF7 to EntityFrameworkCore) in code.
My fixes:
Added Program.cs as new entry point for application
public static class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
Fixed Startup signature according to this: https://github.com/aspnet/Announcements/issues/171
public Startup(IHostingEnvironment env)
{
// Setup configuration sources.
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("config.json");
[...]
Changed package.json to
{
"dependencies": {
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Authentication.JwtBearer": "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.Core": "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.Session": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.EntityFrameworkCore": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.NETCore.Runtime.CoreCLR": "1.0.2", <-- IMPORTANT
"Microsoft.Extensions.PlatformAbstractions": "1.0.0" <-- IMPORTANT
},
"buildOptions": {
"compile": {
"include": [
"../../shared/**/*.cs"
]
},
"copyToOutput": {
"include": [
"Areas",
"Views",
"wwwroot",
"config.json",
"web.config"
]
},
"define": [
"DEMO",
"TESTING"
],
"emitEntryPoint": true, <- IMPORTANT
"preserveCompilationContext": true,
"warningsAsErrors": false
},
"publishOptions": {
"include": [
"Areas",
"Views",
"wwwroot",
"config.json",
"web.config"
]
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"frameworks": {
"netcoreapp1.0": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
},
"imports": [ "netcore50", "portable-net452+win81" ] <- IMPORTANT
}
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-*"
},
"scripts": {
"postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
},
"webroot": "wwwroot",
"version": "1.0.0-*",
"runtimes": {
"win10-x64": {}
}
}
I'm migrating a project from ASP.NET RC1 to RC2 but some packages are not working. VS is complaining about being unable to resolve them. What are the correct packages/versions to add
"Swashbuckle.SwaggerGen": "6.0.0-rc1-final",
"Swashbuckle.SwaggerUi": "6.0.0-rc1-final"
Below is the entire project.json file (in case something is missing). The last 3 packages fail with the same error (The dependency XXX >= YYY could not be resolved)
{
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"Microsoft.NETCore.Platforms": "1.0.1-rc2-24027",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc.Core": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final",
"RestSharp": "105.2.3",
"Flurl.Http": "0.7.0",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Swashbuckle.SwaggerGen": "6.0.0-rc1-final",
"Swashbuckle.SwaggerUi": "6.0.0-rc1-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-3002702",
"imports": [
"portable-net45+win8",
"portable-net4+win8"
]
},
"Microsoft.Extensions.SecretManager.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8"
}
},
"frameworks": {
"net452": {
"frameworkAssemblies": {
"System.Runtime.Serialization": "4.0.0.0",
"System.ServiceModel": "4.0.0.0",
"System.Net.Http": "4.0.0.0"
}
}
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"appsettings.json",
"web.config"
]
}
}
It works with .net 4.5. Check this project.json
{
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Swashbuckle.SwaggerGen": "6.0.0-beta9",
"Swashbuckle.SwaggerUi": "6.0.0-beta9"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"net452": { }
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
You cannot mix rc1 and and rc2 packages in your project json. If you need to use swagger in your project, they have released new version for .net core rc2.
Update,
"Swashbuckle.SwaggerGen": "6.0.0-rc1-final",
"Swashbuckle.SwaggerUi": "6.0.0-rc1-final"
to,
"Swashbuckle.SwaggerGen": "6.0.0-beta9",
"Swashbuckle.SwaggerUi": "6.0.0-beta9"