Publish doesnt work anymore (From 1.1 to 2.0)
Hi,
I just updated my project from Asp.Net Core 1.1 to 2.0.
I followed this instruction: https://docs.microsoft.com/en-us/aspnet/core/migration/1x-to-2x/
I updated my Main void, because of "IDesignTimeDbContextFactory" error I had with Add-Migration.
I have 2 problems:
1/ In Appsettings.json, i have:
"ConnectionStrings": {
"Default": "Server=localhost; Database=DB; Trusted_Connection=True;MultipleActiveResultSets=True;"
},
In Startup.cs, I had: in ConfigureServices
services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("Default")));
But It doesnt work, I had to do this instead:
services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer("Server=localhost; Database=DB; Trusted_Connection=True;MultipleActiveResultSets=True;"));
If not, I have an Error about Sql Script Generation Failed
2/Publish of my Web App, when I click on publish, the button become disable, then become enable again. No error message, nothing nowhere. I really dont know what happen or how I can debug it.
Thanks for your help
About the 2/, I discovered the preview Publish option, the error i Have when I use it is: "The SDK 'Microsoft.NET.Sdk.Web' specified could not be found".
I will do some investigation and will let you know
About the 2/, I found the solution here: https://andrewlock.net/the-sdk-microsoft-net-sdk-web-specified-could-not-be-found/ In global.json, update the sdk version:
"sdk": {
"version": "2.0.0"
}
Hi,
I still have an issue with Configuration.GetConnectionString.
Is there someone who know to fix that?
@ranouf Check the ConnectionStrings in appsetting.Development.json when your environment is development.

This issue is being closed because it has not been updated in 3 months.
We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.