6
votes

I have not been able to resolve this error from the Nuget Package Manager.

I have tried un-installing T4 Scaffolding and reinstall. I developed this program in Visual Studio 2012 with the 3 updates and have now migrated the program to the VS Express 2013 The program had no errors in the 2012 version. I have searched the Internet, Nuget and this site and I have not been able to resolve this. I should mention I have MvcMailer in the packages and it seems to rely on the T4 Scaffolding. And answers would be appreciated.

 Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:50 
char:9
+         Set-DefaultScaffolder -Name CustomTemplate -Scaffolder 
T4Scaffolding.Cus ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:51 
char:9
+         Set-DefaultScaffolder -Name CustomScaffolder -Scaffolder 
T4Scaffolding.C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.1.0.8\tools\init.ps1:6 char:1
+ Set-DefaultScaffolder -Name DbContext -Scaffolder T4Scaffolding.EFDbContext 
-Sol ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.1.0.8\tools\init.ps1:7 char:1
+ Set-DefaultScaffolder -Name Repository -Scaffolder 
T4Scaffolding.EFRepository -S ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:47 
char:1
+ Set-DefaultScaffolder -Name Controller -Scaffolder MvcScaffolding.Controller 
-So ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:48 
char:1
+ Set-DefaultScaffolder -Name Views -Scaffolder MvcScaffolding.Views 
-SolutionWide ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:49 
char:1
+ Set-DefaultScaffolder -Name Action -Scaffolder MvcScaffolding.Action 
-SolutionWi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:50 
char:1
+ Set-DefaultScaffolder -Name UnitTest -Scaffolder 
MvcScaffolding.ActionUnitTest - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:54 
char:1
+ Set-DefaultScaffolder -Name View -Scaffolder $viewScaffolder -SolutionWide 
-DoNo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

PM> Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:50 
char:9
+         Set-DefaultScaffolder -Name CustomTemplate -Scaffolder 
T4Scaffolding.Cus ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:51 
char:9
+         Set-DefaultScaffolder -Name CustomScaffolder -Scaffolder 
T4Scaffolding.C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.1.0.8\tools\init.ps1:6 char:1
+ Set-DefaultScaffolder -Name DbContext -Scaffolder T4Scaffolding.EFDbContext 
-Sol ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.1.0.8\tools\init.ps1:7 char:1
+ Set-DefaultScaffolder -Name Repository -Scaffolder 
T4Scaffolding.EFRepository -S ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:47 
char:1
+ Set-DefaultScaffolder -Name Controller -Scaffolder MvcScaffolding.Controller 
-So ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:48 
char:1
+ Set-DefaultScaffolder -Name Views -Scaffolder MvcScaffolding.Views 
-SolutionWide ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:49 
char:1
+ Set-DefaultScaffolder -Name Action -Scaffolder MvcScaffolding.Action 
-SolutionWi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:50 
char:1
+ Set-DefaultScaffolder -Name UnitTest -Scaffolder 
MvcScaffolding.ActionUnitTest - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Exception calling "EnumerateFiles" with "3" argument(s): "The path is not of a 
legal form."
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:35 
char:8
+         | %{ [System.IO.Directory]::EnumerateFiles($_, "*." + $extension, 
[System.IO.S ...
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentException

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\MvcScaffolding.1.0.9\tools\init.ps1:54 
char:1
+ Set-DefaultScaffolder -Name View -Scaffolder $viewScaffolder -SolutionWide 
-DoNo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
1
I had the same exactly problem yesterday. My project was recently started and migrated to vs2013. As my mailer requirements are minimal right now, I moved to nuget:Postal.Guy--L
Same here...VS2013 MVC Scaffolding troubles both in attempting to execute and/or using nuget to install alternate versions.David Tansey
Any joy with this? A resolution to the issue, or just gave up?David T. Macknet

1 Answers

-1
votes

Unfortunately Microsoft has made a huge mistake in VS2013. They are replacing the "old" way of scaffolding with something called artery... I use T4scaffolding in all my nuget packages and now none of them can be used in VS2013 :(

I have asked several MS people about this including the developers of T4scaffolding without getting a satisfying answer.

It's great that they work on this "artery" thing, but they made a big mistake when loosing support for Env.DTE :(

The only solution right now is to use VS2012 until this bug is fixed :(