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

Commented Unassigned: Confirming expected behavior with MVC 5, 1.6.3 visx and 2.2.1 [136]

$
0
0
I am new to this project and eager to test the power I am hoping it will provide me. I have been able to finally get a build to compile. However, I had to do a few things manually to get everything happy. Below is the list. Please confirm if this is expected behavior, a known issue or something else that may be unique to me.

Observations:
1) Barking about Microsoft.CSharp.dll not being found (and a couple other related errors). Located some info about that being due to use of Lamda expressions, which I do. No problem, added the explicit reference to the DLL and all good.

2) As confirmed in another recent thread, base view type is not being set for the views, just the model set in <> and no type. I have tried using my custom base view, fully qualifying the view, and even using the built-in view. Nothing produces a complete base type reference in the class and I have to manually add the base type so it can compile.

3) Additionally, none of my added namespaces in the web.config are being added to the generated class, thus tons of reference issues. Seems like web.config in neither the Views folder nor root level is being used. Adding the namespaces explicitly to each view, allows it to compile.

4) While model is explicitly set in the view, any use of the generic HTML editor helpers end up with an object reference thus the Lamda expressions are failing. Tried a couple different things, but cleanest workaround was to fully qualify the model class, even though the namespace had been added to the view already. For example, this didn't work:
@using VideoLibrary.Application.Messages
@model VideoMessage

But this did:
@using VideoLibrary.Application.Messages
@model VideoLibrary.Application.Messages.VideoMessage

Comments: I n ow have two test solutions, https://github.com/davidebbo-test/RazorGeneratorMvc5 and https://github.com/davidebbo-test/RazorGeneratorMvc51 (for MVC5 vs 5.1), and they seem to both work equally well. i.e. I don't get any of the issues above. Note that I didn't explicitly import Microsoft.CSharp, so that must have come with the new app template. I'm not saying that there are no issues if you push it with bigger solution, but I am not aware of any issues. The fact that your added namespaces are not picked up is strange,as that should just work. Make sure you add them to Views\Web.config and not the root web.config. Anyway, as suggested in the doc page, as a first step, please my sure that my test solution works correctly for you, and take it from there.

Viewing all articles
Browse latest Browse all 525

Trending Articles



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