I have a .NET Core 2.0 solution with two projects. One project is a SQL Server database project. The other project is a .NET Core 2.0 console app project.
In the console project I have been running the scaffold command (shown below) in the PMC without any issues for about a month.
Scaffold-DbContext -Connection "Server=.\SQL2017;Database=RemodelDB;Trusted_Connection=True;" -Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir Admin\Models -Context "RemodelAdminDbContext"
Today all of sudden this command has broken and now I'm getting the error below.
Startup project '' has an active platform of ''. Select a different platform and try again.
I have done several Google searches for this error message and have read most of the posts on the GIT HUB issues posted on the .NET Core GIT project. None of those solutions and ideas have worked in my case.
Here is what I have tried so far:
1) Created new .NET Core 2.0 Web app and then added the relevant EF Core NuGet packages
2) I have tried wrapping the connection string in single quotes.
3) I have added the EFCore.SQLServer.Design NuGet package
4) I updated all of my EF Core packages to the latest versions.
Please note, that both of my projects build without any errors.
None of the above have resolved my issue. Any help would be much appreciated!
April 23, 2018 Update: It happened again today! I had not worked on this solution/project for a few weeks. Today I created a new table for my app and then tried to scaffold the POCO class and the error appeared!
Here is the complete text shown in the PMC:
PM> Scaffold-DbContext -Connection "Server=.\SQL2017;Database=RemodelAppDB;Trusted_Connection=True;" -Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir Admin\Models -Context "RemodelAdminDbContext" Startup project '' has an active platform of ''. Select a different platform and try again. PM> Scaffold-DbContext -Connection "Server=.\SQL2017;Database=RemodelAppDB;Trusted_Connection=True;" -Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir Admin\Models -Context "RemodelAdminDbContext" -Force -Verbose Using project 'Remodel.POCOGenerator'. Using startup project ''. Build started... Build succeeded. Startup project '' has an active platform of ''. Select a different platform and try again. PM> Scaffold-DbContext -Connection "Server=.\SQL2017;Database=RemodelAppDB;Trusted_Connection=True;" -Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir Admin\Models -Context "RemodelAdminDbContext" -Force -Verbose Using project 'Remodel.POCOGenerator'. Using startup project ''. Build started... Build succeeded. Startup project '' has an active platform of ''. Select a different platform and try again.