RazorEngine icon indicating copy to clipboard operation
RazorEngine copied to clipboard

RazorEngine:3.7.0

Open rahuldhariya01 opened this issue 11 years ago • 15 comments

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.

rahuldhariya01 avatar Aug 08 '15 17:08 rahuldhariya01

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

matthid avatar Aug 08 '15 18:08 matthid

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

rahuldhariya01 avatar Aug 08 '15 18:08 rahuldhariya01

Try adding another reference to Razor3.

matthid avatar Aug 08 '15 18:08 matthid

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 avatar Aug 08 '15 19:08 rahuldhariya01

Anyone can help ?

rahuldhariya01 avatar Aug 08 '15 19:08 rahuldhariya01

Was this resolved?

girish-a avatar Aug 18 '15 13:08 girish-a

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

rahuldhariya01 avatar Aug 19 '15 19:08 rahuldhariya01

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/

girish-a avatar Aug 21 '15 06:08 girish-a

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 avatar Aug 21 '15 09:08 Antaris

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

Antaris avatar Aug 21 '15 09:08 Antaris

@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.

Antaris avatar Aug 21 '15 09:08 Antaris

@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 avatar Aug 21 '15 11:08 girish-a

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

girish-a avatar Aug 21 '15 11:08 girish-a

@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 avatar Aug 22 '15 08:08 matthid

Continued in #322

matthid avatar Oct 08 '15 15:10 matthid