I have been migrating my project to Visual Studio 2015 RC. I have also refactored it into separate projects. Now I need to add a migration for a model change in entity framework but as soon as I open the Package Manager Console I get this error message:
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE At C:\Users...\Visual Studio 2010\Projects\MyProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:50 char:30
If I clear the console and try again, I get "an exception has been encountered" - with more information in the activity log. Inspect the activity log and the exception is:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: span at Microsoft.VisualStudio.Text.SnapshotSpan..ctor(ITextSnapshot snapshot, Span span) at NuGetConsole.Implementation.Console.WpfConsoleClassifier.GetClassificationSpans(SnapshotSpan span) at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.d__1.MoveNext() at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.d__1.MoveNext()
I realised that I had removed some packages that I probably should not have. So I re-installed these:
ModelScaffolding 0.9.2
MvcScaffolding 1.0.9
T4Scaffolding 1.0.8
This appears to have taken the second exception (ArgumentOutOfRangeException) away. However, now when I try Add-Migration
I get
Join-Path : Cannot bind argument to parameter 'Path' because it is null. At C:\Users...\Visual Studio 2010\Projects\MyProject\packages\EntityFramework.6.1.0\tools\EntityFramework.psm1:713 char:27
I tried uninstalling and re-installing Entity Framework. I noticed during install that the Join-Path error was displayed again, but package-manager continued, and reported a successful install. I still got the error when I tried Add-Migration
Then I opened the solution in Visual Studio Express 2013. I still get the initial Cannot get an instance of EnvDTE.DTE
error, but I can clear the console window and I can add a migration - Phew!
I'd still like to get rid of that error message...and use VS 2015...