Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Headwrecker MVC error on hosted server only...

Options
  • 30-10-2014 12:39pm
    #1
    Closed Accounts Posts: 1,143 ✭✭✭


    Hi folks,

    I've run into a headwrecker of a problem that I can't sort out and it has my whole mobile site down since the weekend over this issue. I'm new to MVC but have good experience developing using webforms, sadly experience in one doesn't carry over to the other!

    I have an iPhone emulator application on my desktop that I'm using to develop a mobile version of my business website, while also learning how to develop in MVC. When I build my MVC 4 project on my local desktop, it build fine in my local development environment, but when I upload the whole solution to my hosted web server I'm getting the error below. I added a few packages using Nuget the other day but it was late at night and I can't remember what I uploaded as I was panicking trying to get my site working again.

    Before I get onto my hosting people, I'm wondering is this something I'm doing wrong? In my view, if it all runs fine here locally but then I'm getting this error when I upload the rebuilt solution onto my hosted web server, then the problem must be with my hosting environment???

    326797.png


Comments

  • Registered Users Posts: 511 ✭✭✭D Hayes


    Could be that the hosting provider doesn't have MVC 4 assemblies installed on their server?


  • Closed Accounts Posts: 1,143 ✭✭✭LordNorbury


    D Hayes wrote: »
    Could be that the hosting provider doesn't have MVC 4 assemblies installed on their server?

    I meant to say, this solution had been running fine previously on the hosted server, so I know the required assemblies where there before last weekend as it had all been running fine...


  • Registered Users Posts: 47 NoelOC


    How is your package being upload to the server?

    You said you added a few packages with Nuget.
    Do you know what packages and if you updated old ones?

    It looks like you changed the MVC package but not correctly.
    Can you check the references folder in your project and check the version number for MVC?


  • Closed Accounts Posts: 1,143 ✭✭✭LordNorbury


    NoelOC wrote: »
    How is your package being upload to the server?

    You said you added a few packages with Nuget.
    Do you know what packages and if you updated old ones?

    It looks like you changed the MVC package but not correctly.
    Can you check the references folder in your project and check the version number for MVC?

    I upload using an FTP client, I've always uploaded like this and never had this issue before.

    You might be correct though, I've gone into the "Properties" tab in my System..Web.Mvc reference, and the version there is stated as being:

    Runtime version: v4.0.30319

    Specific Version: True

    Strong Name: True

    Version: 4.0.0.1


    I suppose I could set "Specific Version" to false and see if that sorts it out but I'm hoping to have it matched up properly in case I run into any other matching issues down the road, as I'm new enough to MVC.

    When I go into my project properties, it is targetted to .NET Framework 4.


  • Registered Users Posts: 47 NoelOC


    Do you have Version history or Github logs so you can check what packages changed?

    Revert back to the Version of MVC that you had before the error happened?


  • Advertisement
  • Registered Users Posts: 47 NoelOC


    You could also try to add a binding redirect to your web.config to point MVC to your new dll.
    Also make sure the new dll of MVC is in your FTP upload.

    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
    </dependentAssembly></dependentAssembly>
    </assemblyBinding>
    </runtime>

    You might already have the <runtime> tag in your web.config


  • Closed Accounts Posts: 1,143 ✭✭✭LordNorbury


    NoelOC wrote: »
    Do you have Version history or Github logs so you can check what packages changed?

    Revert back to the Version of MVC that you had before the error happened?

    That's the prob, I'm not that up to speed on MVC or Nuget or any of that stuff. I don't think I changed the version of MVC, I had it set to target Framework 4 from the get go and it always worked fine. Sorry I don't have the info, I went at it in a bit of a rush and just tried to get the problem sorted by fiddling around and I can't remember half of what I did in that process, I was sorting out other unrelated stuff as well in work and didn't keep track of what I was trying to do.


  • Closed Accounts Posts: 1,143 ✭✭✭LordNorbury


    NoelOC wrote: »
    You could also try to add a binding redirect to your web.config to point MVC to your new dll.
    Also make sure the new dll of MVC is in your FTP upload.

    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
    </dependentAssembly></dependentAssembly>
    </assemblyBinding>
    </runtime>

    You might already have the <runtime> tag in your web.config

    This might be the solution, in my web.config file, the newversion is stated as being 4.0.0.0 and not 4.0.0.1... Will try resolve this and upload and see where I end up.


  • Closed Accounts Posts: 1,143 ✭✭✭LordNorbury


    NoelOC wrote: »
    You could also try to add a binding redirect to your web.config to point MVC to your new dll.
    Also make sure the new dll of MVC is in your FTP upload.

    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
    </dependentAssembly></dependentAssembly>
    </assemblyBinding>
    </runtime>

    You might already have the <runtime> tag in your web.config

    Fair play to you Noel, this has resolved everything, thanks a mil you've been a huge help!


  • Registered Users Posts: 47 NoelOC


    Fair play to you Noel, this has resolved everything, thanks a mil you've been a huge help!

    Great! Glad I was able to help.

    There is nothing worse than "DLL Hell" have spent days in the past trying to fix those types of issues.


  • Advertisement
  • Closed Accounts Posts: 1,143 ✭✭✭LordNorbury


    NoelOC wrote: »
    Great! Glad I was able to help.

    There is nothing worse than "DLL Hell" have spent days in the past trying to fix those types of issues.

    I was genuinely fearing the worst, can't believe I got that sorted, huge thanks again, I'm going for a fancy coffee now haha, if that is all I get done this week I'm delighted!


Advertisement