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

Commented Issue: RazorGenerator not generating complete code on .cshtml [102]

$
0
0
I'm running into an issue where it appears that razor generator is not generating complete code for some of my Shared Templates.

These are templates that are created from the "MvcSiteMap" package.

The Razor Code is listed here:
```
@model MvcSiteMapProvider.Web.Html.Models.MenuHelperModel
@using System.Web.Mvc.Html
@using MvcSiteMapProvider.Web.Html.Models
<ul id="menu">
@foreach (var node in Model.Nodes) {
<li id="@node.MetaAttributes["id"]">@Html.DisplayFor(m => node)
@if (node.Children.Any()) {
@Html.DisplayFor(m => node.Children)
}
</li>
}
</ul>
```

what is being generated by RazorGenerator is:
```
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace TP2012MVC.Views.Shared.DisplayTemplates
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;

#line 2 "..\..\Views\Shared\DisplayTemplates\MenuHelperModel.cshtml"
using System.Web.Mvc.Html;

#line default
#line hidden
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using MvcSiteMapProvider.Web.Html;

#line 3 "..\..\Views\Shared\DisplayTemplates\MenuHelperModel.cshtml"
using MvcSiteMapProvider.Web.Html.Models;

#line default
#line hidden

[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.4.0")]
public class MenuHelperModel : System.Web.WebPages.HelperPage
{
}
}
```

When the compiled code is being executed, the custom "id=@node....." is not being generated in the html.

Going through the generated models, I'm noticing that there are several of these templates that the class generated is empty.

This is RazorGenerator.Mvc 1.5.5.0
RazorGenerator Extension 1.5.4
Visual Studio 2012
MVC 4 (asp.net 4.5 application)

Any advice would be appreciated.
Comments: Correct.. The files right now I'm noticing a problem with have this structure: {PROJECT} -> Views -> Shared -> DisplayTemplates -> {View} So far I've identified a problem with the following named items: "MenuHelperModel.cshtml" "SiteMapHelperModel.cshtml" "SiteMapPathHelperModel.cshtml" "SiteMapTitleHelperModel.cshtml" The two others in that location DO generate correctly are: "SiteMapNodeModeIList.cshtml" and "SiteMapNodeModel.cshtml" If I rename any one of those to a different name, IE: test.cshtml, then to generator generates the full and correct class. These are all stock views that are added when adding the "MvcSiteMap" package to the view. I thought at first it might be due to the fact that the above classes that are not building correctly are classes in the MvcSiteMap dll/project and named the same but I somewhat dismissed that because the namespaces are totally different, however I would wager a guess that there is some connection to existing class names to the "generated" class names from RazorGenerator. Is there an easy method to debug the actual generation process? I have no issues pulling down the source and adding some debugging / breakpoints to see what is going on (I've never really analyzed the codegeneration applications so not sure if it's possible to call externally)

Viewing all articles
Browse latest Browse all 525

Trending Articles



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