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

Commented Unassigned: Workaround for bug in Mono framework [112]

$
0
0
Mono's implementation of System.Web is crap (see https://github.com/mono/mono/blob/master/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs#L194 for an example on "how to write terrible code").

When MvcWebConfigTransformer tries to use WebConfigurationManager.OpenMappedWebConfiguration, it crashes at the location linked above. This prevents compilation of views under Mono at all. There isn't much RazorGenerator can do to fix this at the source (short of reimplementing System.Web).

So in order to work around this issue, I'm suggesting that line 44 to line 64 of MvcWebConfigTransformer.cs is wrapped in a try-catch, such that the code becomes:

```
try
{
var config = WebConfigurationManager.OpenMappedWebConfiguration(configFileMap, directoryVirtualPath);

// We use dynamic here because we could be dealing both with a 1.0 or a 2.0 RazorPagesSection, which
// are not type compatible (http://razorgenerator.codeplex.com/workitem/26)
dynamic section = config.GetSection(RazorPagesSection.SectionName);
if (section != null)
{
string baseType = section.PageBaseType;
if (!DefaultBaseType.Equals(baseType, StringComparison.OrdinalIgnoreCase))
{
_transformers.Add(new SetBaseType(baseType));
}

if (section != null)
{
foreach (NamespaceInfo n in section.Namespaces)
{
razorHost.NamespaceImports.Add(n.Namespace);
}
}
}
}
catch (IndexOutOfRangeException)
{
// Bug in Mono framework.
// Configure namespaces using the RazorGenerator directives file instead.
}
```

As stated in the code above, users can specify the namespaces using the directives file (which I've tested to confirm works). I feel as though this is an appropriate workaround given that:

a) There's not much RazorGenerator can do to work around the issue, other than implementing code to search for Web.config and use an XML reader to get the namespaces out.
b) There's an appropriate and easy workaround (using the directives file), for the small percentages of users using RazorGenerator with Mono.
c) Mono's implementation of System.Web and System.Web.Configuration is terrible in many other ways, so there's not much point trying to fix the issue upstream in Mono (especially given that I've already worked around several other bugs related to their implementation of System.Web).

At the moment I've built a version of RazorGenerator with this try-catch in it, but obviously long term I want to discard my patch and just use the upstream RazorGenerator version.
Comments: I'll test this next weekend since I don't get time after work during the week.

Commented Issue: VS2012: "The custom tool 'RazorGenerator' failed. The method or operation is not implemented" [72]

$
0
0
I'm getting the above error when choosing "Run custom tool" on a razor file; when I just save, nothing happens.

In Visual Studio's Error List, I get the following:
"Custom tool error: Could not load file or assembly 'file:///C:\Users\john\AppData\Local\assembly\dl3\MH40ZN5E.14X\44VHO17O.KV9\f801bc8b\bb84bb72_a7abcd01\RazorGenerator.Core.v1.dll' or one of its dependencies. The system cannot find the file specified."

The "bb84bb72_a7abcd01" folder mentioned doesn't exist.

I have verified that the project is running MVC 3 and WebPages 1.
I have uninstalled and reinstalled both the Nuget package and the VS extension.
I have run devenv.exe /log but no error messages in the log file (but I'm attaching it anyway).
It still works fine in VS2010 on the same project.

Any ideas?
Comments: I am also getting the same problem with VS 2012 update 2 Win 7 x64 with a .net 4.0 solution that has 2 mvc 4 projects, one for views/controllers etc and then a webforms/mvc hybrid which is the actual web app. The fix of copying the DLLs from the appdata visual studio extensions folder into the assembly folder fixes it, but every time I update razor generator via visual studio extensions the issue reappears. I get this in the error list Error 3 Custom tool error: Could not load file or assembly 'file:///C:\Users\[deleted]\AppData\Local\assembly\dl3\1GEQTLXX.CPD\EHD7PA5R.4P4\0a8b0247\b7613650_3b60ce01\RazorGenerator.Core.v2.dll' or one of its dependencies. The system cannot find the file specified. C:\Projects\app\lexology.com\Lexology.MVC\Areas\Admin\Views\Shared\MonitoringLayout.cshtml 1 1 Lexology.MVC Right clicking "run custom tool" pops up an error "The custom tool 'RazorGenerator' failed. The method or operation is not implemented. Have tried updating to the latest nuget package, installing and reinstalling razor generator, restarting etc but to no avail. Only fix seems to be copy the dlls. Worth noting that is only seems to happen to some solutions - we have others using razor generator that are fine. Please help!

Commented Issue: VS2012: "The custom tool 'RazorGenerator' failed. The method or operation is not implemented" [72]

$
0
0
I'm getting the above error when choosing "Run custom tool" on a razor file; when I just save, nothing happens.

In Visual Studio's Error List, I get the following:
"Custom tool error: Could not load file or assembly 'file:///C:\Users\john\AppData\Local\assembly\dl3\MH40ZN5E.14X\44VHO17O.KV9\f801bc8b\bb84bb72_a7abcd01\RazorGenerator.Core.v1.dll' or one of its dependencies. The system cannot find the file specified."

The "bb84bb72_a7abcd01" folder mentioned doesn't exist.

I have verified that the project is running MVC 3 and WebPages 1.
I have uninstalled and reinstalled both the Nuget package and the VS extension.
I have run devenv.exe /log but no error messages in the log file (but I'm attaching it anyway).
It still works fine in VS2010 on the same project.

Any ideas?
Comments: Would be great if someone could share (e.g. on GitHub) a minimal project that repros this issue, as we have not seen it ourselves.

Commented Unassigned: 2.0.1 Razor Generator Issues (MSBuild, MVC, App_Code) [109]

$
0
0
Hi,

We found there are few issues with 2.0.1 Razor Generator MSBuild task.

__Issue One:__
The App_Code/{helper}.cshtml can not compile into the correct place even by using _RazorViewsCodeGenDirectory_. So the MSBuild task always complains failed to locate source files.

__Issue Two:__
Event, we manually copy the generated file (helloWorldHelper.cshtml.cs) into the correct place, the MSBuild task does not compile it into the assembly.

Looking for answers.

Kind regards.

Jing
Comments: I've installed RazorGenerator.Mvc and RazorGenerator.MsBuild to my ASP.NET MVC4 Project. Checked that the csproj references the .targets file and <PrecompileRazorFiles> is set to true. But the precompilation is not working...

Created Unassigned: MsBuild assumes relative path but absolute is used to copy files [113]

$
0
0
Configured RazorGenerator and everything works fine on my local machine. Using TFS to build the project and deploy to Azure returns this message for all compiled views:

```
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets (2661): Unable to copy file "C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs" to "C:\a\src\Trex\trunk\src\Trex.Web.Azure\obj\Debug\Trex.Web\C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs". The given path's format is not supported.
```


Commented Unassigned: MsBuild assumes relative path but absolute is used to copy files [113]

$
0
0
Configured RazorGenerator and everything works fine on my local machine. Using TFS to build the project and deploy to Azure returns this message for all compiled views:

```
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets (2661): Unable to copy file "C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs" to "C:\a\src\Trex\trunk\src\Trex.Web.Azure\obj\Debug\Trex.Web\C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs". The given path's format is not supported.
```


Comments: From VS, can you try doing a Publish to File System? This can help isolate whether its something specific to TFS build, or whether it's broken in general.

Commented Issue: VS2012: "The custom tool 'RazorGenerator' failed. The method or operation is not implemented" [72]

$
0
0
I'm getting the above error when choosing "Run custom tool" on a razor file; when I just save, nothing happens.

In Visual Studio's Error List, I get the following:
"Custom tool error: Could not load file or assembly 'file:///C:\Users\john\AppData\Local\assembly\dl3\MH40ZN5E.14X\44VHO17O.KV9\f801bc8b\bb84bb72_a7abcd01\RazorGenerator.Core.v1.dll' or one of its dependencies. The system cannot find the file specified."

The "bb84bb72_a7abcd01" folder mentioned doesn't exist.

I have verified that the project is running MVC 3 and WebPages 1.
I have uninstalled and reinstalled both the Nuget package and the VS extension.
I have run devenv.exe /log but no error messages in the log file (but I'm attaching it anyway).
It still works fine in VS2010 on the same project.

Any ideas?
Comments: Hi David, Its been a bit of a hassle but I have managed to create a shareable solution that reproduces the issue reliably on my machine. Download the source sln from me via Drive (File>Download): https://docs.google.com/file/d/0B4imppDe7R0Gcm5MbnJITFVoT0k/edit?usp=sharing Its a super simple hybrid webforms/mvc app using razorgenerator to embed the mvc stuff into webforms. To reproduce the issue: If you run the myapp.com project you can see the default page is webforms,(/default.aspx) and there is a link to the mvc controller & view page embeded via razor generator at /home/index which all works because the index view is already generated. Now un-install the razorgenerator vsix using VS and restart studio. Now install the razorgenerator vsix using VS and restart studio. Now open the app, right click in solution explorer on "MyApp.MVC\Views\Home\index.cshtml" and select Run Custom Tool to receive the not implemented error. RazorGenerator is then broken and will not regen any views. The only way to then manually fix the sln/studio is to copy the dlls from the appropriate extensions folder C:\Users\[0000]\AppData\Local\Microsoft\VisualStudio\11.0\Extensions\.........\v2\ to the appropriate assembly cache folder C:\Users\[0000]\AppData\Local\assembly\dl3\............... I really hope this is enough for you to repro the issue!

Commented Unassigned: MsBuild assumes relative path but absolute is used to copy files [113]

$
0
0
Configured RazorGenerator and everything works fine on my local machine. Using TFS to build the project and deploy to Azure returns this message for all compiled views:

```
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets (2661): Unable to copy file "C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs" to "C:\a\src\Trex\trunk\src\Trex.Web.Azure\obj\Debug\Trex.Web\C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs". The given path's format is not supported.
```


Comments: Yes, Publish to File System works correctly.

Commented Issue: VS2012: "The custom tool 'RazorGenerator' failed. The method or operation is not implemented" [72]

$
0
0
I'm getting the above error when choosing "Run custom tool" on a razor file; when I just save, nothing happens.

In Visual Studio's Error List, I get the following:
"Custom tool error: Could not load file or assembly 'file:///C:\Users\john\AppData\Local\assembly\dl3\MH40ZN5E.14X\44VHO17O.KV9\f801bc8b\bb84bb72_a7abcd01\RazorGenerator.Core.v1.dll' or one of its dependencies. The system cannot find the file specified."

The "bb84bb72_a7abcd01" folder mentioned doesn't exist.

I have verified that the project is running MVC 3 and WebPages 1.
I have uninstalled and reinstalled both the Nuget package and the VS extension.
I have run devenv.exe /log but no error messages in the log file (but I'm attaching it anyway).
It still works fine in VS2010 on the same project.

Any ideas?
Comments: Ah yes, I do repro with these steps! Here is the exception that I get in the debugger: ``` Could not load file or assembly 'file:///C:\Users\davidebb\AppData\Local\assembly\dl3\NCNQW1DZ.M26\BW8HDAK2.A9T\2522c62c\8df04721_f565ce01\RazorGenerator.Core.v2.dll' or one of its dependencies. The system cannot find the file specified. ``` And in that folder I have `RazorGenerator.Core.DLL` but note `RazorGenerator.Core.v2.dll`. So looks like something is getting confused between the two. We'll need to investigate deeper, but this is a great step forward. Thanks for the effort to get the simple repro!

Commented Unassigned: MsBuild assumes relative path but absolute is used to copy files [113]

$
0
0
Configured RazorGenerator and everything works fine on my local machine. Using TFS to build the project and deploy to Azure returns this message for all compiled views:

```
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets (2661): Unable to copy file "C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs" to "C:\a\src\Trex\trunk\src\Trex.Web.Azure\obj\Debug\Trex.Web\C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs". The given path's format is not supported.
```


Comments: Hmmm, maybe there is something different about how TFS builds. The path `C:\a\src\Trex\trunk\src\Trex.Web.Azure\obj\Debug\Trex.Web\C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml certainly looks suspicious. It looks like it comes out of an incorrect attempt to combine two paths or something. It would be interesting to see if the same issue happens if you use git to publish to Azure instead of TFS. Maybe Pranav will have some thoughts as he knows more about the Razogenerator MsBuild task.

Commented Unassigned: MsBuild assumes relative path but absolute is used to copy files [113]

$
0
0
Configured RazorGenerator and everything works fine on my local machine. Using TFS to build the project and deploy to Azure returns this message for all compiled views:

```
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets (2661): Unable to copy file "C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs" to "C:\a\src\Trex\trunk\src\Trex.Web.Azure\obj\Debug\Trex.Web\C:\a\src\Trex\trunk\src\Trex.Web\obj\CodeGen\Areas\App\Views\Account\ForgottenPasswordSuccess.cshtml.cs". The given path's format is not supported.
```


Comments: I'll do a test with an empty project to see if it happens with GIT as well. The path error is currently only happening with the precompiled views. I'll turn off the precompilation for now and wait to see if Pranav has some feedbacks. Thanks again!

Created Unassigned: Tilde Slash Paths Not Working after an html comments with apostrophe [114]

$
0
0
Hi !

I'm french and like many french people i'm very bad at languages, so i apologize for any spelling mistakes.
I think i have found a weird issue with razor generator. When i do this :
```
<!--Fenêtre modal des conditions générales d'utilisation -->
<script src="~/Scripts/Interne/Footer.js"></script>
```
RazorGenerator can't generate correcty :
```
WriteLiteral("\r\n\t</footer>\r\n\t<!--Fenêtre modal des conditions générales d\'utilisation -->\r\n\t<sc" +
"ript src=\"~/Scripts/Interne/Footer.js\"></script>\r\n\t");
```

And when I remove the apostrophe in the html comment :
```
<!--Fenêtre modal des conditions générales dutilisation -->
<script src="~/Scripts/Interne/Footer.js"></script>
```

RazorGenerator generate that :
```
riteLiteral("\r\n\t</footer>\r\n\t<!--Fenêtre modal des conditions générales dutilisation -->\r\n\t<scr" +
"ipt");

WriteAttribute("src", Tuple.Create(" src=\"", 1036), Tuple.Create("\"", 1069)
, Tuple.Create(Tuple.Create("", 1042), Tuple.Create<System.Object, System.Int32>(Href("~/Scripts/Interne/Footer.js")
, 1042), false)
);
```

It's a kind of weird issue I think no ?
RazorGenerator is cool... really, but this issue made me lost some hours... i hope i'll help some one.

Bye

Commented Unassigned: Tilde Slash Paths Not Working after an html comments with apostrophe [114]

$
0
0
Hi !

I'm french and like many french people i'm very bad at languages, so i apologize for any spelling mistakes.
I think i have found a weird issue with razor generator. When i do this :
```
<!--Fenêtre modal des conditions générales d'utilisation -->
<script src="~/Scripts/Interne/Footer.js"></script>
```
RazorGenerator can't generate correcty :
```
WriteLiteral("\r\n\t</footer>\r\n\t<!--Fenêtre modal des conditions générales d\'utilisation -->\r\n\t<sc" +
"ript src=\"~/Scripts/Interne/Footer.js\"></script>\r\n\t");
```

And when I remove the apostrophe in the html comment :
```
<!--Fenêtre modal des conditions générales dutilisation -->
<script src="~/Scripts/Interne/Footer.js"></script>
```

RazorGenerator generate that :
```
riteLiteral("\r\n\t</footer>\r\n\t<!--Fenêtre modal des conditions générales dutilisation -->\r\n\t<scr" +
"ipt");

WriteAttribute("src", Tuple.Create(" src=\"", 1036), Tuple.Create("\"", 1069)
, Tuple.Create(Tuple.Create("", 1042), Tuple.Create<System.Object, System.Int32>(Href("~/Scripts/Interne/Footer.js")
, 1042), false)
);
```

It's a kind of weird issue I think no ?
RazorGenerator is cool... really, but this issue made me lost some hours... i hope i'll help some one.

Bye

Comments: Strange, that does seem broken. And when you use regular Razor (i.e. no RazorGenerator), you don't get the same issue? In theory, we're using the exact same parser.

Closed Unassigned: Tilde Slash Paths Not Working after an html comments with apostrophe [114]

$
0
0
Hi !

I'm french and like many french people i'm very bad at languages, so i apologize for any spelling mistakes.
I think i have found a weird issue with razor generator. When i do this :
```
<!--Fenêtre modal des conditions générales d'utilisation -->
<script src="~/Scripts/Interne/Footer.js"></script>
```
RazorGenerator can't generate correcty :
```
WriteLiteral("\r\n\t</footer>\r\n\t<!--Fenêtre modal des conditions générales d\'utilisation -->\r\n\t<sc" +
"ript src=\"~/Scripts/Interne/Footer.js\"></script>\r\n\t");
```

And when I remove the apostrophe in the html comment :
```
<!--Fenêtre modal des conditions générales dutilisation -->
<script src="~/Scripts/Interne/Footer.js"></script>
```

RazorGenerator generate that :
```
riteLiteral("\r\n\t</footer>\r\n\t<!--Fenêtre modal des conditions générales dutilisation -->\r\n\t<scr" +
"ipt");

WriteAttribute("src", Tuple.Create(" src=\"", 1036), Tuple.Create("\"", 1069)
, Tuple.Create(Tuple.Create("", 1042), Tuple.Create<System.Object, System.Int32>(Href("~/Scripts/Interne/Footer.js")
, 1042), false)
);
```

It's a kind of weird issue I think no ?
RazorGenerator is cool... really, but this issue made me lost some hours... i hope i'll help some one.

Bye

Comments: I tried, and it is in fact a general Razor issue (see https://aspnetwebstack.codeplex.com/workitem/933). So closing it here.

Created Unassigned: MVC razor views are not getting precompiled when TFS build is kicked [115]

$
0
0
Hi,
I'm using RazorGenerator.MsBuild 2.0.1 dll for MVC 3 project to precompile the razor views. My intention is to avoid deploying the razor views and using the dll to load the views .
Precompiling is working well in my local machine while building the solution and I'm able to see the views related code in the dll using Ildasm.
However, when I queued the TFS build which will build the solution and deploy the files in the dev webserver, razor views are not getting precompiled into the dll.

Any help is highly appreciated .

Thanks
Shashikanth.


Created 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.

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: I don't get that GetItem() error with those same steps. I do get the second error, and it is unrelated. It's a minor namespace issue (which we should fix!). To solve it, add this to Views\web.config: <add namespace="Microsoft.Web.WebPages.OAuth" /> And then run Redo-RazorGenerator. So I don't know about the first error you got, but I'm going to guess that it's harmless. Do you get it consistently if you rerun the command, or run Redo-RazorGenerator?

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: Rerunning `Redo-RazorGenerator` does not produce an error. Seems like this might be a problem only in certain (just mine?) configurations. If I run into another configuration where I experience this problem, I will let you know.

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.

Created Unassigned: The type or namespace name 'ViewModels' does not exist in the namespace 'Login.Views.Login' (are you missing an assembly reference?) C:\Users\E561158\Desktop\Login\Login\Views\Login\LoginPage.generated.cs [117]

$
0
0
Hi,

I used Razor Generator for the cshtml files.

My project structure is like:
1. Controllers(Folder) ->LoginController -> LoginPage action
2.ViewModel(folder) -> LoginDetails.cs file

While creating a view for LoginPage action i did LoginDetails model as strongly typed, After that when i did build i got error like ___"Error 3 The type or namespace name 'ViewModels' does not exist in the namespace 'Login.Views.Login' (are you missing an assembly reference?) C:\Users\E561158\Desktop\Login\Login\Views\Login\LoginPage.generated.cs 33 71 Login"___

I added namespace in the both web.config files as "Login.ViewModels" but still getting the error.

How to resolve this issue.
Viewing all 525 articles
Browse latest View live


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