An HtmlHelper instance (named Html) should be added to RazorTemplateBase, and the Write method should html encode any objects that don't implement IHtmlString to match Razor's behaviour in MVC.
↧
Created Issue: Html support in RazorGenerator.Templating [92]
↧
Commented Issue: Html support in RazorGenerator.Templating [92]
An HtmlHelper instance (named Html) should be added to RazorTemplateBase, and the Write method should html encode any objects that don't implement IHtmlString to match Razor's behaviour in MVC.
Comments: Missing a lot of context here. What exactly are you trying (e.g. sample project would be great), and what specific issue are you running into?
Comments: Missing a lot of context here. What exactly are you trying (e.g. sample project would be great), and what specific issue are you running into?
↧
↧
Commented Issue: Html support in RazorGenerator.Templating [92]
An HtmlHelper instance (named Html) should be added to RazorTemplateBase, and the Write method should html encode any objects that don't implement IHtmlString to match Razor's behaviour in MVC.
Comments: PR here: http://razorgenerator.codeplex.com/SourceControl/network/forks/belfryimages/razorgenerator/contribution/3861
Comments: PR here: http://razorgenerator.codeplex.com/SourceControl/network/forks/belfryimages/razorgenerator/contribution/3861
↧
Commented Issue: Html support in RazorGenerator.Templating [92]
An HtmlHelper instance (named Html) should be added to RazorTemplateBase, and the Write method should html encode any objects that don't implement IHtmlString to match Razor's behaviour in MVC.
Comments: Great, thanks, I'll take a look.
Comments: Great, thanks, I'll take a look.
↧
Created Issue: @helper syntax in RazorGenerator.Templating [93]
using @helper syntax (see http://weblogs.asp.net/scottgu/archive/2011/05/12/asp-net-mvc-3-and-the-helper-syntax-within-razor.aspx) generates the appropriate code-behind and adding a reference to System.Web.WebPages fixes half of the problem. That leaves the fact that the generated helper method calls WriteTo(TextWriter, object) which doesn't exist in RazorTemplateBase. Adding a method with the correct will fix this - it should have the same effect as RazorTemplateBase.Write() but on the TextWriter.
↧
↧
Commented Issue: @helper syntax in RazorGenerator.Templating [93]
using @helper syntax (see http://weblogs.asp.net/scottgu/archive/2011/05/12/asp-net-mvc-3-and-the-helper-syntax-within-razor.aspx) generates the appropriate code-behind and adding a reference to System.Web.WebPages fixes half of the problem. That leaves the fact that the generated helper method calls WriteTo(TextWriter, object) which doesn't exist in RazorTemplateBase. Adding a method with the correct will fix this - it should have the same effect as RazorTemplateBase.Write() but on the TextWriter.
Comments: PR: http://razorgenerator.codeplex.com/SourceControl/network/forks/belfryimages/razorgenerator/contribution/3862
Comments: PR: http://razorgenerator.codeplex.com/SourceControl/network/forks/belfryimages/razorgenerator/contribution/3862
↧
Commented Issue: WriteAttributeTo [89]
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"
Comments: I've figured out the problem (at least what was causing it for my team)! If you put @using statements above the @* Generator: MvcHelper *@ comment then it happens. I've pushed a repro here: https://github.com/robdmoore/RazorGeneratorIssue89
Comments: I've figured out the problem (at least what was causing it for my team)! If you put @using statements above the @* Generator: MvcHelper *@ comment then it happens. I've pushed a repro here: https://github.com/robdmoore/RazorGeneratorIssue89
↧
Commented Issue: WriteAttributeTo [89]
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"
Comments: That has fixed it for me too, cheers Rob! I had using statements but no @* Generator: MvcHelper *@ comment. Putting that comment in above the using statements did the trick.
Comments: That has fixed it for me too, cheers Rob! I had using statements but no @* Generator: MvcHelper *@ comment. Putting that comment in above the using statements did the trick.
↧
Created Issue: Handle and report all errors into studio error list [94]
Please add exception logging to all methods called by VS to visual studio error list. And log other fails, where we return fail status.
This should help a lot with errors like that: http://razorgenerator.codeplex.com/workitem/72
Default MessageBoxes from visual studio isn't helpfull at all (microsoft style of error reporting).
I use following code in my custom file generator for error reporting, so you can use it as sample:
private ErrorListProvider ErrorListPorvider
{
get
{
if (_errorListProvider == null)
{
_errorListProvider = new ErrorListProvider(this);
_errorListProvider.ProviderName = "Custom File Generator";
_errorListProvider.ProviderGuid = new Guid("1456E0E9-DE17-45AD-B075-A8CF6880927C");
_errorListProvider.Show();
return _errorListProvider;
}
return _errorListProvider;
}
}
protected void Log(string message, params object[] parameters)
{
Contract.Requires(message != null);
Contract.Requires(parameters != null);
var messageString = string.Format("Custom File Generator ({0}): {1}", this.GetType(), string.Format(message, parameters));
var errorTask = new ErrorTask();
errorTask.CanDelete = true;
errorTask.Category = TaskCategory.BuildCompile;
errorTask.Column = 1;
errorTask.Document = InputFilePath;
errorTask.ErrorCategory = TaskErrorCategory.Error;
errorTask.Line = 1;
errorTask.Priority = TaskPriority.Normal;
errorTask.Text = messageString;
if (ErrorListPorvider.Tasks != null)
{
ErrorListPorvider.Tasks.Add(errorTask);
}
Trace.WriteLine(messageString);
}
This should help a lot with errors like that: http://razorgenerator.codeplex.com/workitem/72
Default MessageBoxes from visual studio isn't helpfull at all (microsoft style of error reporting).
I use following code in my custom file generator for error reporting, so you can use it as sample:
private ErrorListProvider ErrorListPorvider
{
get
{
if (_errorListProvider == null)
{
_errorListProvider = new ErrorListProvider(this);
_errorListProvider.ProviderName = "Custom File Generator";
_errorListProvider.ProviderGuid = new Guid("1456E0E9-DE17-45AD-B075-A8CF6880927C");
_errorListProvider.Show();
return _errorListProvider;
}
return _errorListProvider;
}
}
protected void Log(string message, params object[] parameters)
{
Contract.Requires(message != null);
Contract.Requires(parameters != null);
var messageString = string.Format("Custom File Generator ({0}): {1}", this.GetType(), string.Format(message, parameters));
var errorTask = new ErrorTask();
errorTask.CanDelete = true;
errorTask.Category = TaskCategory.BuildCompile;
errorTask.Column = 1;
errorTask.Document = InputFilePath;
errorTask.ErrorCategory = TaskErrorCategory.Error;
errorTask.Line = 1;
errorTask.Priority = TaskPriority.Normal;
errorTask.Text = messageString;
if (ErrorListPorvider.Tasks != null)
{
ErrorListPorvider.Tasks.Add(errorTask);
}
Trace.WriteLine(messageString);
}
↧
↧
Commented Issue: RazorGenerator not available for VS11 [54]
RazorGenerator is not showing up in the extension manager for Visual Studio 11
Comments: I had the same problems with VWD (Visual Web Developer) 2012 i.e. the Express edition. I followed the instructions from interscape to "unzip" and edit the vsixmanifest file, and added <Edition>VWDExpress</Edition> to make it work in Express for 2012. The schema for this manifest file is documented @ http://msdn.microsoft.com/en-us/library/ee822857(v=vs.100).aspx, however could the dev team look at including this by default, as I did have to go around the houses, and it would be nice for others to be spared the pain... thanks :)
Comments: I had the same problems with VWD (Visual Web Developer) 2012 i.e. the Express edition. I followed the instructions from interscape to "unzip" and edit the vsixmanifest file, and added <Edition>VWDExpress</Edition> to make it work in Express for 2012. The schema for this manifest file is documented @ http://msdn.microsoft.com/en-us/library/ee822857(v=vs.100).aspx, however could the dev team look at including this by default, as I did have to go around the houses, and it would be nice for others to be spared the pain... thanks :)
↧
Edited Issue: WriteAttributeTo [89]
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"
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]
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: Fixed in changeset 7052aaae4b58
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: Fixed in changeset 7052aaae4b58
↧
Edited Issue: VS2012: "The custom tool 'RazorGenerator' failed. The method or operation is not implemented" [72]
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?
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?
↧
↧
Commented Issue: RazorGenerator not available for VS11 [54]
RazorGenerator is not showing up in the extension manager for Visual Studio 11
Comments: @williamBurgeson, there are restrictions on what VSIXes can be installed by Express SKUs and I think only VSIXes released by Microsoft are allowed to be installed for it. Listing the SKU in the allowed list wouldn't make a difference.
Comments: @williamBurgeson, there are restrictions on what VSIXes can be installed by Express SKUs and I think only VSIXes released by Microsoft are allowed to be installed for it. Listing the SKU in the allowed list wouldn't make a difference.
↧
Commented Issue: RazorGenerator not available for VS11 [54]
RazorGenerator is not showing up in the extension manager for Visual Studio 11
Comments: Ok nevermind, just read your comment over. Does adding that flag actually make it in work in VWD? That's surprising.
Comments: Ok nevermind, just read your comment over. Does adding that flag actually make it in work in VWD? That's surprising.
↧
Edited Issue: add a partial to the class generated [40]
I want to load views with MEF and I need a partial declaration to put an [Export] to another file that contain partial class
↧
Commented Issue: add a partial to the class generated [40]
I want to load views with MEF and I need a partial declaration to put an [Export] to another file that contain partial class
Comments: Fixed in changeset 3c6158f56ab4
Comments: Fixed in changeset 3c6158f56ab4
↧
↧
Edited Issue: Add Disable-RazorGenerator package manager command [88]
It would be nice to have a Disable-RazorGenerator command to run in Package Manager, to complement the Enable-RazorGenerator command, that would go through and set all the Build Actions of the views in your project that are currently set to RazorGenerator to None.
↧
Commented Issue: Add Disable-RazorGenerator package manager command [88]
It would be nice to have a Disable-RazorGenerator command to run in Package Manager, to complement the Enable-RazorGenerator command, that would go through and set all the Build Actions of the views in your project that are currently set to RazorGenerator to None.
Comments: Fixed in changeset fa4f809528a7
Comments: Fixed in changeset fa4f809528a7
↧
Edited Issue: RazorGenerator.MsBuild fails to generate when using NuGet package restore and pacakges folder not in source control [87]
I think there is a Catch-22 when using Package Restore and the packages folder is not checked in. The initial install of RazorGenerator.MsBuild adds the "..\packages\**\tools\NuGet.import.targets" import to NuGet.targets, but when the packages folder is not checked in, the RazorGenerator NuGet.import.targets file does not yet exist when the build is initiated. Package restore pulls down the RazorGenerator.MsBuild package, which brings in the import targets file, but I think it it is too late in the build process.
This can be reproduced by installing the RazorGenerator.MsBuild package, deleting the packages folder, and then building the solution - view the build output at normal verbosity and verify that the PrecompileRazorFiles target is never invoked.
One potential solution is for the NuGet installation to add the RazorGenerator.targets file directly to the MVC project itself - then package restore is only responsible for pulling down the binaries.
This can be reproduced by installing the RazorGenerator.MsBuild package, deleting the packages folder, and then building the solution - view the build output at normal verbosity and verify that the PrecompileRazorFiles target is never invoked.
One potential solution is for the NuGet installation to add the RazorGenerator.targets file directly to the MVC project itself - then package restore is only responsible for pulling down the binaries.
↧