Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Commented Unassigned: Enable-RazorGenerator Throws Exception [116]

$
0
0
### Issue

Running the `Enable-RazorGenerator` command from the Package Manager Console emits the following error for each `.cshtml` file in the project.

Exception calling "GetItem" with "1" argument(s): "Value does not fall within the expected range."
At C:\{path}\{to}\packages\RazorGenerator.Mvc.2.1.1\tools\RazorGenerator.psm1:63 char:46
+ $solutionExplorer.GetItem <<<< ("$SolutionName\$ProjectName$relativePath").UIHierarchyItems.Expanded = $false
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException

I expected to be greeted with a success message or no output at all.

### Reproduction

1. In Visual Studio (I have VS Permium 2012 Version 11.0.60315.01 Update 2) install the RazorGenerator extension (I used version 1.5.5)
2. File > New Project > C#/MVC 4 > Internet Application
3. Install `RazorGenerator.Mvc` (I have version 2.1.1)
4. In the Package Manager Console run `Enable-RazorGenerator`

#### Related Issue?

Interestingly enough, `*.generated.cs` files are still created- however the solution won't build. I'm get the following compilation error:

The type or namespace name 'AuthenticationClientData' could not be found (are you missing a using directive or an assembly reference?)

For the file `C:\{path}\{to}\Views\Account\_ExternalLoginsListPartial.generated.cs`, line `33` column `93`.

This may be a ripple effect from the `GetItem` exception above, so I won't open it as its own issue. If it is in fact a separate issue, let me know and I'll move this to a another thread.

Comments: This is the line of code that breaks for you: $solutionExplorer.GetItem("$SolutionName\$ProjectName$relativePath").UIHierarchyItems.Expanded = $false Maybe due to some timing issue, some of the variables end up not being set correctly, causing GetItem() to blow up.

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>