我在我的项目中安装了MvcMailer包。所以我试图做脚手架,但它没有用。我用Google搜索了这个。我得到了应该安装的建议 T4Scaffolding 和MvcScaffolding
我做了哪些并重新启动了我的视觉工作室。但不幸的是从vs开始我的项目 一些包不能很好地加载。脚手架包。 似乎存在冲突。
错误消息如下:
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\Users\sk\Documents\Visual Studio 2013\Projects\LiveChatPrototype\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:50 char:9
+ Set-DefaultScaffolder -Name CustomTemplate -Scaffolder T4Scaffolding.Cus ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\Users\sk\Documents\Visual Studio 2013\Projects\LiveChatPrototype\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:51 char:9
+ Set-DefaultScaffolder -Name CustomScaffolder -Scaffolder T4Scaffolding.C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\Users\sk\Documents\Visual Studio 2013\Projects\LiveChatPrototype\packages\T4Scaffolding.1.0.8\tools\init.ps1:6 char:1
+ Set-DefaultScaffolder -Name DbContext -Scaffolder T4Scaffolding.EFDbContext -Sol ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\Users\sk\Documents\Visual Studio 2013\Projects\LiveChatPrototype\packages\T4Scaffolding.1.0.8\tools\init.ps1:7 char:1
+ Set-DefaultScaffolder -Name Repository -Scaffolder T4Scaffolding.EFRepository -S ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\Users\sk\Documents\Visual Studio 2013\Projects\LiveChatPrototype\packages\MvcScaffolding.1.0.9\tools\init.ps1:47 char:1
+ Set-DefaultScaffolder -Name Controller -Scaffolder MvcScaffolding.Controller -So ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\Users\sk\Documents\Visual Studio 2013\Projects\LiveChatPrototype\packages\MvcScaffolding.1.0.9\tools\init.ps1:48 char:1
+ Set-DefaultScaffolder -Name Views -Scaffolder MvcScaffolding.Views -SolutionWide ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\Users\sk\Documents\Visual Studio 2013\Projects\LiveChatPrototype\packages\MvcScaffolding.1.0.9\tools\init.ps1:49 char:1
+ Set-DefaultScaffolder -Name Action -Scaffolder MvcScaffolding.Action -SolutionWi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\Users\sk\Documents\Visual Studio 2013\Projects\LiveChatPrototype\packages\MvcScaffolding.1.0.9\tools\init.ps1:50 char:1
+ Set-DefaultScaffolder -Name UnitTest -Scaffolder MvcScaffolding.ActionUnitTest - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At C:\Users\sk\Documents\Visual Studio 2013\Projects\LiveChatPrototype\packages\MvcScaffolding.1.0.9\tools\init.ps1:54 char:1
+ Set-DefaultScaffolder -Name View -Scaffolder $viewScaffolder -SolutionWide -DoNo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
PM>
答案 0 :(得分:1)
我遇到了同样的问题,我可以按照以下步骤开展工作:
答案 1 :(得分:1)
我知道这是在不久前发布的,但是,我在使用MvcScaffolding时在VS2015中遇到了同样的错误。实际的错误在于T4Scaffolding.Core包。我删除了源代码,修复了错误,并上传了带有链接依赖项的新NuGet包。 3个新包装是:
首先卸载MvcScaffolding及其依赖项,T4Scaffolding,& T4Scaffolding.Core。如果您只是安装MvcScaffolding包,其他包将被拉过来。希望这有助于其他人。如果这可以解决您的问题,请标记为已回答。
干杯。
答案 2 :(得分:0)
首先运行
然后让我们的脚手架控制器MyModel -Repository(天啊,它正在工作)