Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 16:02
    Jedd France
    0

    Could not load file or assembly 'System.Web.Helpers' or one of its dependencies.

    Hi everyone,

    I was working on a local website I am building when I randomly got this error message when refreshing the website, and I don't know what's went wrong.

    Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    

    I added a new empty .cshtml file to the MacroScripts folder in Visual Studio, copied in some code that works as a site navigation, and then when I refreshed the page in Chrome I encountered that error message.

    I've also noticed that the very top line of code in my master template is showing a blue line under it. It says the master file doesn't exist, but I've triple checked and it's definitely correct.

    Error message I've encountered.

    If anybody can help solve this problem for me it would be greatly appreciated.

    I also apologise in advance if this is a rookie error and very simple to fix.

    • Jedd
  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 16:28
    Jeavon Leopold
    0

    Hi Jedd,

    Did you upgrade Umbraco or MVC?

    It's likely that you have System.Web.Helpers in the namespaces element in /Views/Web.Config that should be removed.

    Jeavon

  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 16:43
    Jedd France
    0

    Hi Jeavon,

    Thanks for responding.

    I haven't upgraded Umbraco and I'm using WebForms. Everything was working fine until I added a new Razor file, then the error message occurred.

    Any other ideas?

    Cheers, Jedd

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 16:47
    Jeavon Leopold
    0

    Hi Jedd,

    Did you check the /Views/Web.config?

    Jeavon

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 16:48
    Jeavon Leopold
    0

    When you say WebForms/Razor files what are you creating and where?

  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 16:52
    Jedd France
    0

    Jeavon,

    I've checked the file you mentioned and there is no mention of System.Web.Helpers anywhere in there.

    I created a razor macro in the MacroScripts folder that would filter through pages and put them in a list, like a navigation. I've used the exact same method and exact same code on multiple projects before and never encountered this problem. I've since deleted the razor file to see if that would fix it but it didn't.

    Thanks for your continued help, Jedd

  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 16:54
    Jedd France
    0

    May have found the issue here Jeavon...

    enter image description here

    Now can I be a nuisance and ask if you know how to go about fixing this?

    Thanks again, Jedd

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 16:56
    Jeavon Leopold
    0

    Indeed, your Visual Studio solution needs to target .Net 4.5 instead of 4.0

    Also I would recommend you look at using MacroPartials instead of MacroScripts as these are depreciated now.

  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 16:59
    Jedd France
    0

    And how would I go about about pointing it to 4.5 instead of 4? I've never done anything like that before so sorry for the multiple questions.

    I'll take a look at MacroPartials, thanks for the advice.

    Jedd

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 17:26
    Jeavon Leopold
    0

    Right click on the project and choose properties then change the Target Framework, should be something like the below:

    enter image description here

  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 17:37
    Jedd France
    0

    Thanks Jeavon.

    I made that change and I was thrown these errors.

    enter image description here

    Am I causing myself a lot of hassle by refusing to upgrade to Umbraco 7? Or is that not involved in these issue here?

    Thanks,

    Jedd

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 17:40
    Jeavon Leopold
    0

    What version of Umbraco are you using?

    It seems that you are trying to use MVC 5 for that you will need Umbraco v7.2.2+ but maybe that's not where you started out?

  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 17:44
    Jedd France
    0

    I'm using 6.1.6. I've not had any of these problems before because all other web projects were built on my desktop PC at home which has older .NET framework (I think it's 3 or 3.5). Whereas this project is being built on my newer laptop (I'm away from home at the moment) and the framework on it is 4.5.

    Is it possible to change the framework to 3 or 3.5 to stop this issue. Or is this a poor method?

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 17:47
    Jeavon Leopold
    0

    Hmm, I think you are in a bit of pickle with upgrading to MVC5, you will need to go back to MVC4 for it to work with Umbraco v6.1.6, do you have a backup?

  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 17:58
    Jedd France
    0

    I don't Jeavon but not to worry the website was in the very early stages of development so it's not a problem. I'm more worried about where this leaves me going forward as I'm unsure how to get past this issue.

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 18:06
    Jeavon Leopold
    0

    Ok good, what version of Visual Studio are you using?

  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 18:10
    Jedd France
    0

    I am using Microsoft Visual Studio Express 2015 For Web

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 18:23
    Jeavon Leopold
    0

    Ok, this explains it a little more. Visual Studio 2015 is not compatible with MVC v4 so it will always start a project with MVC v5 but as I said before the first version of Umbraco to support MVC v5 is v7.2.2...

  • Jedd France 29 posts 140 karma points
    Sep 22, 2015 @ 18:28
    Jedd France
    0

    I'm using the same version of Visual Studio and Umbraco on my desktop at home and I didn't encounter this problem when using my razor macros?

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 22, 2015 @ 19:42
    Jeavon Leopold
    100

    You can open a MVC4 project in VS2015 but you will get intellisense issues and you cannot create a MVC4 project in VS2015.

    I think you really should start with the latest Umbraco v7.2.8 anyhow, what's holding you back?

  • Jedd France 29 posts 140 karma points
    Sep 24, 2015 @ 07:37
    Jedd France
    0

    Hey Jeavon,

    I fixed the problem by upgrading to v6.2.5 and everything is working fine. Thanks for all of your help.

    -Jedd

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 24, 2015 @ 09:16
    Jeavon Leopold
    0

    Great, glad you got it working! Hope you feel you can move onto using v7 soon!

Please Sign in or register to post replies

Write your reply to:

Draft