|
|
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
And for the record, I:
1. git-cloned the RazorEngine repo
2. changed the System.Web.Razor reference from 3.0.0.0 to 2.0.0.0 (otherwise both were being referenced, 3.0 by RazorEngine and 2.0 by the MVC 4 framework)
3. compiled it
4. Added a reference to RazorEngine from the RazorEngine.core bin folder
And lo-and-behold, I was able to use the RazorEngine to parse a cshtml into a string.
One last note -- when I tried to use WebMail on the host provider, I got a security violation, requiring this fix:
<configuration>
<system.web>
<trust level="Full" originUrl=""/>
Sigh. I feel like I'm playing Whac-a-Mole. Whack one problem, and another surfaces. This should NOT be this hard! (Gee, I think I said the same thing about Ruby on Rails)
So, a couple lessons learned:
1. Don't use NuGet package installer. Build the pieces from the source code directly.
2. Make sure all the System.Web.[crap] assembly references reference exactly the same dll's.
Marc
|
|
|
|
|
I thought nuget was to manage dll versions properly. Never used it myself though, because I'm a dinosaur .
Wout
|
|
|
|
|
I've never had issue with NuGet, over a couple of years, except recently with EF 6. It adds a reference to EntityFramework.SqlServer , which is never used in any code, but nonetheless required. So as soon as you "Remove unused references", it vanishes in a loud puff of smoke, leaving you head scratching about what broke.
But then again, I've never even come across this RazorEngine monster.
No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde
|
|
|
|
|
The moral of the story:
Windows isn't the only product where you should wait until a new version has matured a bit.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I see the file date for RazorEngine 2.1 is 2011. New version? Mature I can see, quite mature. Maybe a bit long in the tooth though.
No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde
|
|
|
|
|
But still only 2.1, so still an "early" version.
Going by MS' record, "mature" would be 2.3 or higher -- pretty much any major version of an MS product needs to get to at least the third service pack before most of the complaints are dealt with.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mark_Wallace wrote: Windows isn't the only product where you should wait until a new version has matured a bit.
Yeah, I've been waiting since I started using Windows 3.1
However, it is MVC 4 (and there's 5 already out too.) So how long does this stuff need to sit in the casket and ferment?
Marc
|
|
|
|
|
Quote: However, it is MVC 4 (and there's 5 already out too.) So how long does this stuff need to sit in the casket and ferment?
Sir, 6 is also out. They are producing faster than letting a developer learn..
|
|
|
|
|
Suraj Sahoo | Coding Passion wrote: Sir, 6 is also out.
Good grief.
Marc
|
|
|
|
|
Hanging around a long time just makes it dated. To mature it has to be improved with age.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Wow.
Well, the project I'm on started with MVC 4, Razor 2, and EF 5. All installed with NuGet with no problems.
The updrades to MVC 5, Razor 3, and EF 6 went pretty smoothly, though a few manual steps were required for the upgrades to work properly.
I never had to do any of the stuff you're going through.
|
|
|
|
|
Dave Kreskowiak wrote: Well, the project I'm on started with MVC 4, Razor 2, and EF 5. All installed with NuGet with no problems.
Agreed - I had no issues with the core components. But the minute I tried adding something on top, kaboom.
Dave Kreskowiak wrote: The updrades to MVC 5, Razor 3, and EF 6 went pretty smoothly, though a few manual steps were required for the upgrades to work properly.
I'm thinking of updating to MVC 5, but I might do that on a VM and see how it goes first.
Marc
|
|
|
|
|
Marc Clifton wrote: But the minute I tried adding something on top, kaboom. Is this not then a fault of the "something on top" rather than of MS, MVC, and Razor?
No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde
|
|
|
|
|
Brady Kelly wrote: Is this not then a fault of the "something on top" rather than of MS, MVC, and Razor?
Well, there is no specific thing to blame. It's a combination of factors -- DLL version hell, DLL dependency hell, package installers that will install the latest and greatest without checking if you've got the latest and greatest other stuff that it depends on, etc.etc.etc.
Which of course, because there is no single point of failure to fix, means the issue doesn't get fixed.
Marc
|
|
|
|
|
Marc Clifton wrote: Which of course, because there is no single point of failure to fix, means the issue doesn't get fixed. Too true, in fact.
No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde
|
|
|
|
|
Not sure what you are trying to do exactly, but whenever I run into a version conflict with the System.Web stuff, an assembly binding usually does the trick (an assembly binding basically says "whenever you see versions x-y if this DLL, use version z instead").
I agree, though, it is a bit like Whac-a-Mole. After installing a Windows update a week or two ago, many of my projects stopped working and required a modification to their assembly bindings (and/or removed/re-added references). I still have a project that inexplicably no longer has intellisense (compiles fine, but says everything is an error in the IDE).
|
|
|
|
|
AspDotNetDev wrote: I still have a project that inexplicably no longer has intellisense (compiles fine, but says everything is an error in the IDE)
Do you have Resharper installed? I had this problem & found instructions to delete the _resharper (from memory, this may not be the exact name) folders. Unfortunately, I didn't appear to have these & it was a machine reboot that fixed it.
Regards, Stewart
|
|
|
|
|
Nope, Resharper caused more problems than it solved, so I never installed it on my current VM.
|
|
|
|
|
AspDotNetDev wrote: an assembly binding usually does the trick
Agreed. Unfortunately there is no message other than a vague "two versions of the same assembly are being referenced", but of course the idiot that programmed that message didn't think to indicate which assembly. And that message only occurs under certain circumstances. Unfortunately again, the root cause, being a dependent assembly, makes it almost impossible to know which binding to make.
Now that I think about it, I should have bound every assembly, mwahaha.
Marc
|
|
|
|
|
|
AspDotNetDev wrote: If you turn on detailed debug information, you will get more information about the affected assemblies.
Ah - I'll add that to my "toolchest" - I typically configure the build output to quiet or minimal or whatever the lowest setting is.
Though, my particular problem was such that the build on my dev box reported no problems, but when I "deployed" onto the host server, I got a dependency error which was impossible to determine what the issue was because it's a hosted server rather than a machine I have full control over.
Marc
|
|
|
|
|
https://github.com/NancyFx/Nancy[^]
I'm considering replacing the Razor pile of crap with something else less crappy, so I was wondering if anyone has any experience with Nancy. Good? Bad? Indifferent?
Marc
|
|
|
|
|
Message Closed
modified 20-Oct-19 21:02pm.
|
|
|
|