Comments (23)
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.
I've the same issue
from razorengine.
They removed some classes and refactored others in v2 - which breaks RazorEngine :(
from razorengine.
I'm having the same problem. Is there any workaround for it?
from razorengine.
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.
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.
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.
PS: its System.Web.Razor, I made a mistake earlier
from razorengine.
So are there still no work-arounds or fixes for this issue yet?
from razorengine.
I found one! http://stackoverflow.com/a/10936596/165656
from razorengine.
@georgiosd does it look like the app.config step is missing from that submission?
from razorengine.
The XML was in the answer but wasn't showing... fixed that :)
from razorengine.
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.
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.
Time to upgrade RazorEngine to use System.Web.Razor 2.0?
from razorengine.
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.
Any way to help? Is there a branch of a v2 compatible version of RazorEngine we could use?
from razorengine.
See my SO post above for a temp fix.
from razorengine.
I have an experimental fork of the project that I'm currently using that I've upgraded to v2.
from razorengine.
Hi coxp is your v2 compatible version available at all? Thanks Mark
from razorengine.
just saw this: #71
from razorengine.
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.
v3.1.0 introduced Razor 2 compatability, available on Nuget.
from razorengine.
Related Issues (20)
- RazorEngine Render ViewComponent And TagHelpers
- - error: (25, 6) The name 'model' does not exist in the current context - error: (18, 19) There is no argument given that corresponds to the required formal parameter 'componentContext' of 'ViewBase<InteractiveSubjectPageExportReport>.ViewBase(IComponentContext)'
- Image doesn't render HOT 1
- Anouncement: Security with `IsolatedRazorEngineService` HOT 4
- The name 'model' does not exist in the current context HOT 4
- Engine.Razor.Compile, Cant Locad Resource
- Vulnerability Remediation HOT 1
- How to fetch list of model keys from razor file?
- Exception 'Dynamic operations can only be performed in homogenous AppDomain'
- Build issue with v2 odata queries?
- When I use RazorEngine again, the input '' is transferred to&# 39. How can I solve this problem?
- action failed due to exception RazorEngine.Templating.TemplateCompilationException: Errors while compiling a Template.
- #115 The problem is not resolved in RazorEngine.NetCore HOT 3
- cshtml file with model in console app
- 'AppDomainSetup' does not contain a constructor that takes 0 arguments HOT 6
- encounter errors when use @Include in template
- Another Razor issue on flush with dynamic or anonymous types
- RazorEngine.Templating.TemplateCompilationException: error: (0, 0) An expression is too long or complex to compile
- Razor Nuget Packages for .NET 8.0 HOT 4
- System.Runtime.Serialization.SerializationException when call IsolatedRazorEngineService.Create() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from razorengine.