I started to build my ASP.NET web application with the ASP.NET Core template. I noticed it has already two files in the ~\Data\Migrations folder one naemd *_CreateIdentitySchema.cs and the other ApplicationDbContextModelSnapshot.
At first it was complaining that i had Powershell 2 so I installed v3. Then I installed the package EntityFramework (v6.1.3) from the package manager because somehow that was not installed from the template as it was the case in VS.2015.
Now it gives me an error like "Exception calling "SetData" with "2" argument(s): " and then a bunch of things.
$domain.SetData('contextProject', $contextProject) CategoryInfo : NotSpecified: (:) , MethodInvocationException FullyQualifiedErrorId : SerializationException Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation,
Version=126.96.36.199, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable." At C:\Users\Devel.nuget\packages\entityframework\6.1.3\tools\EntityFramework.psm1:720 char:5 + $domain.SetData('startUpProject', $startUpProject)
I am using VS.2017 Update 1, I get the impression this "core" thing is complicating life more than making it simpler.
I have do the following:
Then I have issued this command Enable-Migrations
Enable-Migrations -ProjectName "MyProjectWithContext" -ConnectionString "Data Source=.\SQL;Initial Catalog=XXXXX;Integrated Security=True;MultipleActiveResultSets=True" -ConnectionProviderName System.Data.SqlClient
Same things for Add-Migration
Add-Migration -Name MyName -ProjectName "MyProject" -ConnectionString "Data Source=.\SQL;Initial Catalog=XXXX;Integrated Security=True;MultipleActiveResultSets=True" -ConnectionProviderName System.Data.SqlClient