Antaris / RazorEngine

Open source templating engine based on Microsoft's Razor parsing engine
http://antaris.github.io/RazorEngine
Other
2.14k stars 577 forks source link

RazorEngine:3.7.0 #306

Closed rahuldhariya01 closed 9 years ago

rahuldhariya01 commented 9 years ago

I am getting this error with new mvc version Error : Could not load file or assembly 'System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

It was working fine with previous verion of visual studio 2015 RC but as soon as i have updated to visual studio 2015 enterprise this update the dependencies and i am getting this error.

My project json with visual studio 2015

"dependencies": { "EntityFramework.SqlServer": "7.0.0-beta5", "EntityFramework.Commands": "7.0.0-beta5", "Microsoft.AspNet.Mvc": "6.0.0-beta5", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta5", "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta5", "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta5", "Microsoft.AspNet.Authentication.Google": "1.0.0-beta5", "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta5", "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta5", "Microsoft.AspNet.Diagnostics": "1.0.0-beta5", "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta5", "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta5", "Microsoft.AspNet.Server.IIS": "1.0.0-beta5", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5", "Microsoft.AspNet.StaticFiles": "1.0.0-beta5", "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta5", "Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta5", "Microsoft.Framework.Configuration.Json": "1.0.0-beta5", "Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta5", "Microsoft.Framework.Logging": "1.0.0-beta5", "Microsoft.Framework.Logging.Console": "1.0.0-beta5", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta5", "AutoMapper": "4.0.4", "Server.DataTier": { }, "RazorEngine": "3.7.0"

},

please help. this is very urgent.

matthid commented 9 years ago

I think nuget is resolving Razor to version 4 and therefore it is not working because RazorEngine needs Razor 3?

rahuldhariya01 commented 9 years ago

So what is the solution ? it is production issue. please help.

matthid commented 9 years ago

Try adding another reference to Razor3.

rahuldhariya01 commented 9 years ago

You mean RazorEngine ? or System.Web.Razor ? i did try to go back to razor3 then i have several issue in my project. Please help/

rahuldhariya01 commented 9 years ago

Anyone can help ?

girish-a commented 9 years ago

Was this resolved?

rahuldhariya01 commented 9 years ago

@girish No girish. No solution. i am thinking to remove this plugin from project. do you know anything else?

girish-a commented 9 years ago

For the moment, I have switched to HandleBars.Net. I have retained the RazorEngine code because that is my first preference, but I too am stuck with the same issue and there is not much time to investigate it, so I had to switch.

Here are the links to HandleBars.Net:

Github repo: https://github.com/rexm/Handlebars.Net Nuget: https://www.nuget.org/packages/Handlebars.Net/

Antaris commented 9 years ago

In your project.json file, what are your targets? There is currently no build of RazorEngine that supports CoreCLR, mainly because it's quite a big undertaking at this stage to support that.

Can you try removing the CoreCLR targets (in frameworks) and add a target for dnx451 or dnx46 and see if that resolves your problem?

Antaris commented 9 years ago

@rahuldhariya01 Can you put a minimal repo on GitHub, or available as a download somewhere so we can investigate and confirm?

Antaris commented 9 years ago

@girish-a Incidentally on the topic of handlebars, I am currently looking for testers who are looking to test an alternative Handlebars .NET implementation for my FuManchu project.

girish-a commented 9 years ago

@Antaris thanks for the response. In my case, yes I have removed the core clr targets and included only dnx46.

I have uploaded the problematic code to this repo: https://github.com/girish-a/try

I don't want to hijack @rahuldhariya01's issue thread, but I am facing a similar problem and have logged an issue for it as well : https://github.com/Antaris/RazorEngine/issues/309

In my case, the unit test works but web api doesn't.

girish-a commented 9 years ago

@Antaris, the FuManchu project is interesting. Will take a look at it sometime.

matthid commented 9 years ago

@rahuldhariya01 Can you try https://www.nuget.org/packages/RazorEngine/4.2.0-beta3 ? And as @Antaris has already mentioned CoreCLR is not supported so dnxcore will not work, but dnx451 or dnx46 should work.

matthid commented 9 years ago

Continued in #322