由于发生某些错误,MvcScaffolding 无法安装

发布于 2024-12-02 22:44:11 字数 6999 浏览 1 评论 0原文

我正在使用 NuGet Packager Manager v1.5.20831.9017。

我正在使用包管理器控制台来安装 MvcScaffolding。发生了一些错误,因此我无法再添加控制器

主要错误信息是

无法找到类型 [T4Scaffolding.NuGetServices.Services.ScaffoldingPackagePathResolver]:确保加载包含此类型的程序集。

这是我安装 MvcScaffolding 时的详细输出。

PM> Install-Package MvcScaffolding
Attempting to resolve dependency 'T4Scaffolding'.
Attempting to resolve dependency 'EntityFramework (≥ 4.1.10311.0)'.
You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=224682. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'EntityFramework 4.1.10715.0'.
Successfully installed 'T4Scaffolding 1.0.4'.
Unable to find type [T4Scaffolding.NuGetServices.Services.ScaffoldingPackagePathResolver]: make sure that the assembly containing this type is loaded.
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:44 Char:72
+         [T4Scaffolding.NuGetServices.Services.ScaffoldingPackagePathResolver] <<<< ::SetPackagesRootDirectory($packagesRoot)
    + CategoryInfo          : InvalidOperation: (T4Scaffolding.N...agePathResolver:String) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Update-FormatData : Cannot find a part of the path 'G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.2\tools\T4Scaffolding.Format.ps1xml'.
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:46 Char:20
+         Update-FormatData <<<<  -PrependPath (Join-Path $toolsPath T4Scaffolding.Format.ps1xml)
    + CategoryInfo          : InvalidOperation: (:) [Update-FormatData], CommandNotFoundException
    + FullyQualifiedErrorId : TypesXmlUpdateException,Microsoft.PowerShell.Commands.UpdateFormatDataCommand

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:50 Char:24
+         Set-DefaultScaffolder <<<<  -Name DbContext -Scaffolder T4Scaffolding.EFDbContext -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:51 Char:24
+         Set-DefaultScaffolder <<<<  -Name Repository -Scaffolder T4Scaffolding.EFRepository -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:52 Char:24
+         Set-DefaultScaffolder <<<<  -Name CustomTemplate -Scaffolder T4Scaffolding.CustomTemplate -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:53 Char:24
+         Set-DefaultScaffolder <<<<  -Name CustomScaffolder -Scaffolder T4Scaffolding.CustomScaffolder -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Successfully installed 'MvcScaffolding 1.0.4'.
Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:35 Char:22
+ Set-DefaultScaffolder <<<<  -Name Controller -Scaffolder MvcScaffolding.Controller -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:36 Char:22
+ Set-DefaultScaffolder <<<<  -Name Views -Scaffolder MvcScaffolding.Views -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:37 Char:22
+ Set-DefaultScaffolder <<<<  -Name Action -Scaffolder MvcScaffolding.Action -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:38 Char:22
+ Set-DefaultScaffolder <<<<  -Name UnitTest -Scaffolder MvcScaffolding.ActionUnitTest -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:42 Char:22
+ Set-DefaultScaffolder <<<<  -Name View -Scaffolder $viewScaffolder -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Successfully added 'EntityFramework 4.1.10715.0' to MvcApplication1.
Successfully added 'T4Scaffolding 1.0.4' to MvcApplication1.
Successfully added 'MvcScaffolding 1.0.4' to MvcApplication1.

PM> 

有谁知道如何解决这个问题?

谢谢!

I'm using NuGet Packager Manager v1.5.20831.9017.

I'm using Package Manager Console to install MvcScaffolding. There are some error occurred so that I can't Add Controller anymore.

The main error message is

Unable to find type [T4Scaffolding.NuGetServices.Services.ScaffoldingPackagePathResolver]: make sure that the assembly containing this type is loaded.

Here is the detailed output when I installing MvcScaffolding.

PM> Install-Package MvcScaffolding
Attempting to resolve dependency 'T4Scaffolding'.
Attempting to resolve dependency 'EntityFramework (≥ 4.1.10311.0)'.
You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=224682. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'EntityFramework 4.1.10715.0'.
Successfully installed 'T4Scaffolding 1.0.4'.
Unable to find type [T4Scaffolding.NuGetServices.Services.ScaffoldingPackagePathResolver]: make sure that the assembly containing this type is loaded.
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:44 Char:72
+         [T4Scaffolding.NuGetServices.Services.ScaffoldingPackagePathResolver] <<<< ::SetPackagesRootDirectory($packagesRoot)
    + CategoryInfo          : InvalidOperation: (T4Scaffolding.N...agePathResolver:String) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Update-FormatData : Cannot find a part of the path 'G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.2\tools\T4Scaffolding.Format.ps1xml'.
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:46 Char:20
+         Update-FormatData <<<<  -PrependPath (Join-Path $toolsPath T4Scaffolding.Format.ps1xml)
    + CategoryInfo          : InvalidOperation: (:) [Update-FormatData], CommandNotFoundException
    + FullyQualifiedErrorId : TypesXmlUpdateException,Microsoft.PowerShell.Commands.UpdateFormatDataCommand

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:50 Char:24
+         Set-DefaultScaffolder <<<<  -Name DbContext -Scaffolder T4Scaffolding.EFDbContext -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:51 Char:24
+         Set-DefaultScaffolder <<<<  -Name Repository -Scaffolder T4Scaffolding.EFRepository -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:52 Char:24
+         Set-DefaultScaffolder <<<<  -Name CustomTemplate -Scaffolder T4Scaffolding.CustomTemplate -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\init.ps1:53 Char:24
+         Set-DefaultScaffolder <<<<  -Name CustomScaffolder -Scaffolder T4Scaffolding.CustomScaffolder -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Successfully installed 'MvcScaffolding 1.0.4'.
Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:35 Char:22
+ Set-DefaultScaffolder <<<<  -Name Controller -Scaffolder MvcScaffolding.Controller -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:36 Char:22
+ Set-DefaultScaffolder <<<<  -Name Views -Scaffolder MvcScaffolding.Views -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:37 Char:22
+ Set-DefaultScaffolder <<<<  -Name Action -Scaffolder MvcScaffolding.Action -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:38 Char:22
+ Set-DefaultScaffolder <<<<  -Name UnitTest -Scaffolder MvcScaffolding.ActionUnitTest -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get install path because packages root directory has not been supplied
at G:\Projects\MvcApplication1\packages\MvcScaffolding.1.0.4\tools\init.ps1:42 Char:22
+ Set-DefaultScaffolder <<<<  -Name View -Scaffolder $viewScaffolder -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Successfully added 'EntityFramework 4.1.10715.0' to MvcApplication1.
Successfully added 'T4Scaffolding 1.0.4' to MvcApplication1.
Successfully added 'MvcScaffolding 1.0.4' to MvcApplication1.

PM> 

Does anyone who know how to solve this problem?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文