MvcScaffolding can't be installed due to some error occurred

Sep 6, 2011 at 4:41 AM

I'm using NuGet Packager Manager v1.5.20831.9017.

I'm using Package Manager Console to install MvcScaffolding. There are some error occurred during installation and I can't Add Controller anymore after I install this package.

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
>

 

By the way, I've been removed Reflector from my Visual Studio 2010.  The problem still exists.  Does anyone who know how to solve this problem?

Thanks!

Developer
Sep 6, 2011 at 4:51 AM

Looks like a bug with MvcScaffolding itself, have you tried asking a question on the forum over there? http://mvcscaffolding.codeplex.com/

Sep 6, 2011 at 4:53 AM

I can install this package without any problem on the other machine.  I don't know what's going on.

Developer
Sep 6, 2011 at 5:01 AM

Still it makes sense to start a discussion on http://mvcscaffolding.codeplex.com/.

Sep 6, 2011 at 1:45 PM

Hi dfowler,

If I import "T4Scaffolding.NuGetServices.dll" module into Package Manager Console (PMC) manually.  The problem will be gone.

Here is the command line:

Import-Module "G:\Projects\MvcApplication1\packages\T4Scaffolding.1.0.4\tools\T4Scaffolding.NuGetServices.dll"

BUT, I have to run this command everytime I start-up Visual Studio 2010.

I saw the init.ps1 script in the T4Scaffolding package load T4Scaffolding.dll specifically, but I can't see this script load T4Scaffolding.NuGetServices.dll at all. 

Do you know how PMC load assembly automatically?

Thanks!

Nov 22, 2011 at 1:53 PM

This seemed to work for me:

PM> Install-Package T4Scaffolding
'T4Scaffolding 1.0.5' already installed.
Successfully added 'T4Scaffolding 1.0.5' to MvcApplication1.

PM> Install-Package MvcScaffolding
Successfully installed 'MvcScaffolding 1.0.6'.
'InstallationDummyFile.txt' already exists. Skipping...
Successfully added 'MvcScaffolding 1.0.6' to MvcApplication1.