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

Commented Issue: MSBuild task fails when Model name same as partial name [38]

$
0
0
Models\AccountForm.cs
public class AccountForm {
public string Name {get;set;}
}

Views\Shared\EditorTemplates\AccountForm.cshtml
@using Web.Models;
@model AccountForm

<p>
@Html.TextBoxFor(m => m.Name)
</p>

Will generate cs like
using Web.Models;
public class AccountForm : System.Web.Mvc.WebViewPage<AccountForm> {

}

And then it doesn't know which account form to use.

Can workaround by changing view to remove using and have
@model Web.Models.AccountForm


Comments: Same problem with version 2.2.x I have a partial view named _FindOption.cshtml. The partial view has the following model declaration: @model FindOption In this case the msbuild task fails, not founds any member of FindOption. Using full namespace is NOT an option, because it is limiting some advanced possibilities! This is easy to reproduce, please reopen and fix it.

Viewing all articles
Browse latest Browse all 525

Trending Articles



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