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

Commented Issue: Html helper does is not available for System.Web.WebPages.WebPage [76]

$
0
0
for some reason the Html helper is only available for MVC projects, but not for WebPages Razor only projects.
As result, you can't use Html.Raw() or any of its helpers.
For the Html.Raw iteslef, you can simply output @(new HtmlString("<div>"))
But what about the others?
Comments: This issue needs more context. What exactly are you trying? Do you have a repro project you can share?

Commented Issue: Error 1 Keyword, identifier, or string expected after verbatim specifier: @ [85]

$
0
0
Hi,
i am getting these 2 errors in the output window but everything works fine
Error 1 Keyword, identifier, or string expected after verbatim specifier: @
Error 2 A namespace cannot directly contain members such as fields or methods

here is my Helpers Page:

@using System.Security.Principal

@helper IfLoggedOn(Func<IPrincipal, HelperResult> content) {
var currentUser = HttpContext.Current.User;
if (currentUser == null) {
<i>
To use this content, you must

</i>
} else {
@content(currentUser)
}
}

thanks in advanced.


Comments: Lot of context missing here. e.g. - What kind of app are you running (e.g. MVC?) - Where exactly are those views - Do you see the same issue in a clean MVC app?

Commented Issue: Views only found once in Release Mode [84]

$
0
0
This issue is identical to the one found in: http://razorgenerator.codeplex.com/workitem/55

I am new to codeplex, so I didn't know if I should add a new issue or not (because the original one is marked as fixed)

Everytime I hit refresh, I am getting the error:
"Value cannot be null.
Parameter name: view"

I am using:
RazorGenerator.Mvc
version: 1.3.2.0
size: 13.5 KB
date modified: 11/28/2012 8:44pm


This is happening upon Refresh (F5) when the project is in Release mode and web.config Debug is set to false.
Comments: Can you please share a minimal repro app that demonstrates this issue? Also, what is the stack of the error? Please see https://github.com/davidebbo/MvcApplicationRazorGeneratorSeparateLibrary for an example project which works.

Closed Issue: WriteAttributeTo does not exist [86]

$
0
0
Error occurs in generated code:
"The name 'WriteAttributeTo' does not exist in the current context"

Please refer to http://forums.asp.net/t/1804428.aspx/1

Comments: This project relates to the RazorGenerator VS Extension, and the forum thread you point to does not seem related to it, so you're probably in the wrong place here :)

Created Issue: WriteAttributeTo [89]

$
0
0
Razor Generator doesn't seem to allow me to write variables inside of things like href="@variable", similarly with style attributes and such. The generated code certainly used to work, and nothing has been changed but it breaks if I generate the compiled view again. The method below is used in the regeneration:

WriteAttributeTo(__razor_helper_writer, "href", Tuple.Create(" href=\"", 1390), Tuple.Create("\"", 1464)
//does not exist in the current context

Where as before there was only WriteLiteralTo and WriteTo in the code, no WriteAttributeTo:

WebViewPage.WriteLiteralTo(@__razor_helper_writer, " <span class=\"tag\">\r\n <a href=\"");
#line 58 "..\..\Extensions\Helpers\ListHelpers.cshtml"

Commented Issue: WriteAttributeTo [89]

$
0
0
Razor Generator doesn't seem to allow me to write variables inside of things like href="@variable", similarly with style attributes and such. The generated code certainly used to work, and nothing has been changed but it breaks if I generate the compiled view again. The method below is used in the regeneration:

WriteAttributeTo(__razor_helper_writer, "href", Tuple.Create(" href=\"", 1390), Tuple.Create("\"", 1464)
//does not exist in the current context

Where as before there was only WriteLiteralTo and WriteTo in the code, no WriteAttributeTo:

WebViewPage.WriteLiteralTo(@__razor_helper_writer, " <span class=\"tag\">\r\n <a href=\"");
#line 58 "..\..\Extensions\Helpers\ListHelpers.cshtml"
Comments: We look at the assembly references to figure out what version of the Razor parser to use. Are you trying to build a Mvc 4 application? If so, then the generated output is what the v2 Razor parser produces and it must be a breaking change in it.

Commented Issue: WriteAttributeTo [89]

$
0
0
Razor Generator doesn't seem to allow me to write variables inside of things like href="@variable", similarly with style attributes and such. The generated code certainly used to work, and nothing has been changed but it breaks if I generate the compiled view again. The method below is used in the regeneration:

WriteAttributeTo(__razor_helper_writer, "href", Tuple.Create(" href=\"", 1390), Tuple.Create("\"", 1464)
//does not exist in the current context

Where as before there was only WriteLiteralTo and WriteTo in the code, no WriteAttributeTo:

WebViewPage.WriteLiteralTo(@__razor_helper_writer, " <span class=\"tag\">\r\n <a href=\"");
#line 58 "..\..\Extensions\Helpers\ListHelpers.cshtml"
Comments: Yes, I am using MVC 4 in the application. Does Razor Generator support MVC 4 at the moment? Are there known issues with it?

Commented Issue: WriteAttributeTo [89]

$
0
0
Razor Generator doesn't seem to allow me to write variables inside of things like href="@variable", similarly with style attributes and such. The generated code certainly used to work, and nothing has been changed but it breaks if I generate the compiled view again. The method below is used in the regeneration:

WriteAttributeTo(__razor_helper_writer, "href", Tuple.Create(" href=\"", 1390), Tuple.Create("\"", 1464)
//does not exist in the current context

Where as before there was only WriteLiteralTo and WriteTo in the code, no WriteAttributeTo:

WebViewPage.WriteLiteralTo(@__razor_helper_writer, " <span class=\"tag\">\r\n <a href=\"");
#line 58 "..\..\Extensions\Helpers\ListHelpers.cshtml"
Comments: Does your view work correctly if you don't use RazorGenerator? And if you look at the generated code, what specific class is your view extending (including the version of the assembly it comes from)?

Commented Issue: WriteAttributeTo [89]

$
0
0
Razor Generator doesn't seem to allow me to write variables inside of things like href="@variable", similarly with style attributes and such. The generated code certainly used to work, and nothing has been changed but it breaks if I generate the compiled view again. The method below is used in the regeneration:

WriteAttributeTo(__razor_helper_writer, "href", Tuple.Create(" href=\"", 1390), Tuple.Create("\"", 1464)
//does not exist in the current context

Where as before there was only WriteLiteralTo and WriteTo in the code, no WriteAttributeTo:

WebViewPage.WriteLiteralTo(@__razor_helper_writer, " <span class=\"tag\">\r\n <a href=\"");
#line 58 "..\..\Extensions\Helpers\ListHelpers.cshtml"
Comments: That does look like the right format for attribute generation in Razor v2. Like Ebbo mentioned, might be worth verifying if there's a bug in the parser by running the page without the generator.

Created Issue: RazorGenerator.MSBuild is too aggressive when finding .cshtml files [90]

$
0
0
The MSBuild extension is trying to pre-compile *all* .cshtml files it can find under the project root, instead of just the ones that are in the project. This is a bit of a problem when working in a hybrid app where a CMS such as Umbraco is managing it's own razor templates in the same web application.

Edited Issue: RazorGenerator.MSBuild is too aggressive when finding .cshtml files [90]

$
0
0
The MSBuild extension is trying to pre-compile *all* .cshtml files it can find under the project root, instead of just the ones that are in the project. This is a bit of a problem when working in a hybrid app where a CMS such as Umbraco is managing it's own razor templates in the same web application.<br /><br />(e.g. App_Data\TEMP\Razor folder is a cache folder used by umbraco and is not part of my MVC project)

Commented Issue: RazorGenerator.MSBuild is too aggressive when finding .cshtml files [90]

$
0
0
The MSBuild extension is trying to pre-compile *all* .cshtml files it can find under the project root, instead of just the ones that are in the project. This is a bit of a problem when working in a hybrid app where a CMS such as Umbraco is managing it's own razor templates in the same web application.<br /><br />(e.g. App_Data\TEMP\Razor folder is a cache folder used by umbraco and is not part of my MVC project)
Comments: I can't remember correctly, but there was some edge case scenario that wasn't working correctly when we were looking for Content and None items in the project. That said, you should be able to specify the cshtml files that the target should precompile from your csproj Check the Customizing the target file section at http://razorgenerator.codeplex.com/wikipage?title=Using%20RazorGenerator.MsBuild If you specifically want it to pick up files from your project, you could tinker with passing it something like this <RazorSrcFiles Include="%(None)" Condition=" '%(None.Extension)' == '.cshtml' " /> <RazorSrcFiles Include="%(Content)" Condition=" '%(Content.Extension)' == '.cshtml' " />

Commented Issue: RazorGenerator.MSBuild is too aggressive when finding .cshtml files [90]

$
0
0
The MSBuild extension is trying to pre-compile *all* .cshtml files it can find under the project root, instead of just the ones that are in the project. This is a bit of a problem when working in a hybrid app where a CMS such as Umbraco is managing it's own razor templates in the same web application.<br /><br />(e.g. App_Data\TEMP\Razor folder is a cache folder used by umbraco and is not part of my MVC project)
Comments: Following your advice I was able to get it working by creating a new .targets file in the same folder as my .csproj with the following content: <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <RazorSrcFiles Include="**\Views\**\*.cshtml" /> </ItemGroup> </Project> which was then imported into the webapp.csproj at the start of the file: <Import Project="CustomRazorGenPath.targets" /> Note that I had to do this in a new .targets file because otherwise VS2012 was treating the ItemGroup as a list of files to include in the project and every single .cshtml file was appearing twice in Solution Explorer! Thanks for your help.

Created Issue: Provide a way to clear a RazorTemplateBase's _generatingEnvironment [91]

$
0
0
I want to be able to use a template in a loop, like so:

@{ var fooView = new FooView(); } <!-- FooView is a compiled template that outputs a li -->
<ul>
@foreach (var foo in foos) {
@{
fooView.Clear();
fooView.Foo = foo;
}
@fooView.TransformText()
}
</ul>

The lack of a `Clear()` method means that each time I call `TransformText()` the internal `StringBuilder` (`_generatingEnvironment`) just keeps appending new `<li>`s.

Commented Issue: WriteAttributeTo [89]

$
0
0
Razor Generator doesn't seem to allow me to write variables inside of things like href="@variable", similarly with style attributes and such. The generated code certainly used to work, and nothing has been changed but it breaks if I generate the compiled view again. The method below is used in the regeneration:

WriteAttributeTo(__razor_helper_writer, "href", Tuple.Create(" href=\"", 1390), Tuple.Create("\"", 1464)
//does not exist in the current context

Where as before there was only WriteLiteralTo and WriteTo in the code, no WriteAttributeTo:

WebViewPage.WriteLiteralTo(@__razor_helper_writer, " <span class=\"tag\">\r\n <a href=\"");
#line 58 "..\..\Extensions\Helpers\ListHelpers.cshtml"
Comments: My team is getting this as well after upgrading from RazorGenerator from 1.4.3 to 1.5.0. I've copied the file contents to a normal view file and viewed the page to ensure that the problem is definitely not the content in the page. I'm using @* Generator: MvcHelper *@ so the class doesn't extend anything - it's just a static class.

Commented Issue: WriteAttributeTo [89]

$
0
0
Razor Generator doesn't seem to allow me to write variables inside of things like href="@variable", similarly with style attributes and such. The generated code certainly used to work, and nothing has been changed but it breaks if I generate the compiled view again. The method below is used in the regeneration:

WriteAttributeTo(__razor_helper_writer, "href", Tuple.Create(" href=\"", 1390), Tuple.Create("\"", 1464)
//does not exist in the current context

Where as before there was only WriteLiteralTo and WriteTo in the code, no WriteAttributeTo:

WebViewPage.WriteLiteralTo(@__razor_helper_writer, " <span class=\"tag\">\r\n <a href=\"");
#line 58 "..\..\Extensions\Helpers\ListHelpers.cshtml"
Comments: Would be great to get a small runnable repro app here so we could investigate. There are many different ways to run RazorGenerator, and that would remove all ambiguities.

Edited Issue: Provide a way to clear a RazorTemplateBase's _generatingEnvironment [91]

$
0
0
I want to be able to use a template in a loop, like so:<br /><br /> @{ var fooView = new FooView(); } <!-- FooView is a compiled template that outputs a li --><br /> <ul><br /> @foreach (var foo in foos) {<br /> @{<br /> fooView.Clear(); <br /> fooView.Foo = foo;<br /> }<br /> @fooView.TransformText()<br /> }<br /> </ul><br /><br />The lack of a `Clear()` method means that each time I call `TransformText()` the internal `StringBuilder` (`_generatingEnvironment`) just keeps appending new `<li>`s.

Commented Issue: Provide a way to clear a RazorTemplateBase's _generatingEnvironment [91]

$
0
0
I want to be able to use a template in a loop, like so:<br /><br /> @{ var fooView = new FooView(); } <!-- FooView is a compiled template that outputs a li --><br /> <ul><br /> @foreach (var foo in foos) {<br /> @{<br /> fooView.Clear(); <br /> fooView.Foo = foo;<br /> }<br /> @fooView.TransformText()<br /> }<br /> </ul><br /><br />The lack of a `Clear()` method means that each time I call `TransformText()` the internal `StringBuilder` (`_generatingEnvironment`) just keeps appending new `<li>`s.
Comments: Fixed in changeset 8c3c1f93e8dd

Edited Issue: WriteAttributeTo [89]

$
0
0
Razor Generator doesn't seem to allow me to write variables inside of things like href="@variable", similarly with style attributes and such. The generated code certainly used to work, and nothing has been changed but it breaks if I generate the compiled view again. The method below is used in the regeneration:<br /><br />WriteAttributeTo(__razor_helper_writer, "href", Tuple.Create(" href=\"", 1390), Tuple.Create("\"", 1464) <br />//does not exist in the current context<br /><br />Where as before there was only WriteLiteralTo and WriteTo in the code, no WriteAttributeTo:<br /><br />WebViewPage.WriteLiteralTo(@__razor_helper_writer, " <span class=\"tag\">\r\n <a href=\"");<br />#line 58 "..\..\Extensions\Helpers\ListHelpers.cshtml"

Commented Issue: Provide a way to clear a RazorTemplateBase's _generatingEnvironment [91]

$
0
0
I want to be able to use a template in a loop, like so:<br /><br /> @{ var fooView = new FooView(); } <!-- FooView is a compiled template that outputs a li --><br /> <ul><br /> @foreach (var foo in foos) {<br /> @{<br /> fooView.Clear(); <br /> fooView.Foo = foo;<br /> }<br /> @fooView.TransformText()<br /> }<br /> </ul><br /><br />The lack of a `Clear()` method means that each time I call `TransformText()` the internal `StringBuilder` (`_generatingEnvironment`) just keeps appending new `<li>`s.
Comments: Version 1.5.1 of RazorGenerator.Templating is now up on NuGet with this change.
Viewing all 525 articles
Browse latest View live


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