6

我无法从 Nuget 包管理器解决此错误。

我已尝试卸载 T4 Scaffolding 并重新安装。我在 Visual Studio 2012 中开发了这个程序并进行了 3 次更新,现在已经将该程序迁移到 VS Express 2013 该程序在 2012 版本中没有错误。我已经搜索了 Internet、Nuget 和这个站点,但我无法解决这个问题。我应该提到我在包中有 MvcMailer,它似乎依赖于 T4 脚手架。答案将不胜感激。

 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
4

1 回答 1

-1

不幸的是,微软在 VS2013 中犯了一个巨大的错误。他们正在用一种叫做动脉的东西取代“旧”的脚手架方式......我在我所有的 nuget 包中都使用了 T4scaffolding,现在它们都不能在 VS2013 中使用:(

我已经问过包括 T4scaffolding 的开发人员在内的几位 MS 人员,但没有得到令人满意的答案。

他们在这个“动脉”上工作真是太好了,但是在失去对 Env.DTE 的支持时他们犯了一个大错误:(

现在唯一的解决方案是使用 VS2012 直到这个错误被修复:(

于 2013-12-01T14:11:22.270 回答