Git Product home page Git Product logo

Comments (23)

petejstephens avatar petejstephens commented on July 30, 2024

I have the same issue, I've just migrated my MVC4 which uses system.web.razor 2.0.0.0 to use Postal, which uses RazorEngine. Unfortunately after I deploy my project to its Azure environment I get:

"Could not load type 'System.Web.Razor.Parser.SyntaxTree.CodeSpan' from assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'".

I'm also using the same bindingRedirect.

So I'm a bit stuck at the moment and looking to rollback to MVC3.

Any ideas?

from razorengine.

 avatar commented on July 30, 2024

I've the same issue

from razorengine.

georgiosd avatar georgiosd commented on July 30, 2024

They removed some classes and refactored others in v2 - which breaks RazorEngine :(

from razorengine.

pjanuario avatar pjanuario commented on July 30, 2024

I'm having the same problem. Is there any workaround for it?

from razorengine.

georgiosd avatar georgiosd commented on July 30, 2024

The only way I could find was to remove the redirect to WebPages 2.0 from web.config placed there by NuGet - so far no problems but I'm not using any other packages that require this assembly

from razorengine.

pjanuario avatar pjanuario commented on July 30, 2024

Where is that redirect you are talking about?
And for that i need to include web pages 2.0 and 1.0 assemblies on the solution?

from razorengine.

georgiosd avatar georgiosd commented on July 30, 2024

Yes. Be careful because nuget seems to re-add it if you change packages

Somehow the XML is not showing up - in web.config there's a bindingRedirect for 0-2 of System.Web.Razor to 2.0

from razorengine.

georgiosd avatar georgiosd commented on July 30, 2024

PS: its System.Web.Razor, I made a mistake earlier

from razorengine.

Aaronontheweb avatar Aaronontheweb commented on July 30, 2024

So are there still no work-arounds or fixes for this issue yet?

from razorengine.

georgiosd avatar georgiosd commented on July 30, 2024

I found one! http://stackoverflow.com/a/10936596/165656

from razorengine.

Aaronontheweb avatar Aaronontheweb commented on July 30, 2024

@georgiosd does it look like the app.config step is missing from that submission?

from razorengine.

georgiosd avatar georgiosd commented on July 30, 2024

The XML was in the answer but wasn't showing... fixed that :)

from razorengine.

jonnii avatar jonnii commented on July 30, 2024

I think this problem is becoming more and more pressing, especially with the release of asp.net mvc 4. I've looked into what it'd take to upgrade to the latest version of razor, but I don't have a deep enough understanding of the compiler internals.

I've got most of the unit tests passing, with the exception of the ones that explicitly declare the @model. It looks like this isn't a built in feature for razor and the existing code uses a keyword extension. The problem is that API has completely changed...

I looked through the asp.net mvc code to see how they do it, but I can't find where they're doing it... Any thoughts?

from razorengine.

georgiosd avatar georgiosd commented on July 30, 2024

Have you tried posting at the http://aspnetwebstack.codeplex.com/ forums? The MS folks are usually quite good at engaging with the community.

from razorengine.

jonathanxu avatar jonathanxu commented on July 30, 2024

Time to upgrade RazorEngine to use System.Web.Razor 2.0?

from razorengine.

Antaris avatar Antaris commented on July 30, 2024

There is some work to do, as System.Web.Razor v1 and v2 aren't API-compatible, there are some under the hood changes that would break the current version of RazorEngine. I'm investigating either a switch to v2, or looking to provide two versions, one for v1 and v2 compatability.

from razorengine.

paultyng avatar paultyng commented on July 30, 2024

Any way to help? Is there a branch of a v2 compatible version of RazorEngine we could use?

from razorengine.

georgiosd avatar georgiosd commented on July 30, 2024

See my SO post above for a temp fix.

from razorengine.

coxp avatar coxp commented on July 30, 2024

I have an experimental fork of the project that I'm currently using that I've upgraded to v2.

from razorengine.

markchivs avatar markchivs commented on July 30, 2024

Hi coxp is your v2 compatible version available at all? Thanks Mark

from razorengine.

markchivs avatar markchivs commented on July 30, 2024

just saw this: #71

from razorengine.

coxp avatar coxp commented on July 30, 2024

Hi,

You can build the dll using my fork but there isn't a NuGet package available. I'm using this in production but YMMV.

https://github.com/coxp/RazorEngine

This is using the Razor 2 dll so you get support for the new features like null attributes.

There are no tests though that's why I haven't made a pull request.

from razorengine.

Antaris avatar Antaris commented on July 30, 2024

v3.1.0 introduced Razor 2 compatability, available on Nuget.

from razorengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.