Copied to clipboard

Flag this post as spam?

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


  • David Conlisk 432 posts 1008 karma points
    Feb 12, 2013 @ 11:31
    David Conlisk
    0

    Error creating Controller in Umbraco v6

    Hi guys,

    Maybe someone can confirm that this is an issue - or maybe I'm just going about it the wrong way?

    I want to create a Controller in Umbraco v6, but when I right-click the Controllers folder and choose Add -> Controller... I get the error message:

    I'm using VS2010. Steps to recreate:

    File -> New -> Project...
    ASP.NET MVC 4 Web Application
    Empty template, Razor view engine.
    Install Umbraco using nuget (install-package umbracocms)
    Right-click the Controllers folder, choose Add -> Controller...
    Note error message above.

    Thanks,

    David

     

  • Stephen 46 posts 248 karma points
    Feb 12, 2013 @ 11:54
    Stephen
    1

    I get the same error in VS2010, but works OK in VS2012.

    Stephen

  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Feb 12, 2013 @ 11:57
    Morten Christensen
    1

    Works on my machine ;) ... Just tried creating a blank/empty ASP.NET 4 Web App and installed the nuget, created a controller without getting the error you listed above. I'm running VS 2012 though.

    A side note: When you create a blank MVC4 project it still creates a Global.asax with a codebehind, but the asax file is actually overridden by the one that ships with umbraco, so if you need it for anything just make sure that the Global.asax file is properly setup, as the codebehind (.asax.cs) becomes kind of orphaned when the asax file is overridden.

    - Morten

  • David Conlisk 432 posts 1008 karma points
    Feb 12, 2013 @ 12:07
    David Conlisk
    0

    Hi guys,

    That's great that it works in VS2012, but what about all the developers who still use VS2010? I can get around the problem by just dropping my controller.cs file into the correct directory, but for new users of Umbraco this could be pretty frustrating.

    Cheers!

    David

  • David Conlisk 432 posts 1008 karma points
    Feb 12, 2013 @ 12:10
    David Conlisk
    0

    Hi Morten,

    I added a reference to the umbraco.dll to my project, but the version numbers are different. The version in packages/UmbracoCms.Core.6.0.0/lib is 1.0.4779.24225, while the error is 1.0.4090.38017

    Thanks,

    David

     

  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Feb 12, 2013 @ 12:20
    Morten Christensen
    0

    I just don't get why VS would care about the version of the umbraco.dll when adding a Controller. It doesn't make sense to me. A standard controller doesn't have any relation to umbraco what so ever, so not sure what is going on.
    Have you anything to web.config or maybe previously had some kind of (umbraco related) scaffolding installed?

    - Morten

  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Feb 12, 2013 @ 12:21
    Morten Christensen
    0

    Btw, the assembly version of umbraco.dll that you have in packages\UmbracoCms.Core.6.0.0\lib is correct.

  • David Conlisk 432 posts 1008 karma points
    Feb 12, 2013 @ 12:22
    David Conlisk
    0

    Nothing at all - it's a totally fresh install in a brand new folder - the steps I show you above include everything I've done. It's weird!

    The only thing umbraco-related is that I called

    install-package umbracocms
  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Feb 12, 2013 @ 12:25
    Morten Christensen
    0

    Strange strange strange! I don't get it :/
    Have you tried turning your machine off and on again? :-P

    Sorry I can't be of more help,

    - Morten

  • David Conlisk 432 posts 1008 karma points
    Feb 12, 2013 @ 12:28
    David Conlisk
    0

    Hi Morten,

    Thanks for your help anyway! 

    I do wonder though if this is something that should be fixed for VS2010 developers... If I'd never used Umbraco before I'd be tempted to throw it out the window at this point!

    David

  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Feb 12, 2013 @ 12:31
    Morten Christensen
    0

    Do you have the latest service packs and tools for VS2010 ? Maybe there is something in the Web Platform Installer that can fix this?

    - Morten

  • David Conlisk 432 posts 1008 karma points
    Feb 12, 2013 @ 12:40
    David Conlisk
    0

    Hi Morten,

    I don't have the latest service pack installed but Stephen does, and we both get the issue. When I try to install the service pack it complains about me having a later version of NuGet installed that is incompatible, so I'm going to stay away from that - I need to install VS2012 soon anyway!

    Cheers,

    David

  • Stephen 46 posts 248 karma points
    Feb 12, 2013 @ 12:59
    Stephen
    102

    The problem looks to the the referenced Our.Umbraco.uGoLive.47x library. This references umbraco, Version 1.0.4090.38017 (a different version to the one installed - 1.0.4779.24225)

    Removing this refrence from the project allows you to "Add Controller" in VS2010.

    Can that library be safely removed, is it just for 4.7?

     

    Stephen

  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Feb 12, 2013 @ 13:02
    Morten Christensen
    0

    Unfortunate naming IMO. Its a plugin thats included in the core as is, so I believe it can be safely removed. There is probably a dashboard using these assemblies somewhere, but you should be able to remove it all without any problems (as far as I know).

    - Morten

  • David Conlisk 432 posts 1008 karma points
    Feb 12, 2013 @ 13:23
    David Conlisk
    0

    Yep, removing the reference to Our.Umbraco.uGoLive.47x solves the issue. Nice work Stephen!

  • Suraj Pant 11 posts 42 karma points
    Dec 06, 2013 @ 14:36
    Suraj Pant
    0

    Hi All,

    This seems to be linked to same error hence sharing here. 

    After a similar error resolved as suggested in this post I am again getting below error while adding a controller :  

    When I am trying to add controller I am getting error like Could not load file or assembly 'umbraco, Version=1.0.4868.24773, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    Can anyone suggest please.

    Regards,
    Suraj 

  • Thanh Tran Huy 22 posts 42 karma points
    Dec 11, 2013 @ 10:34
    Thanh Tran Huy
    0

    Hi David! Hi all!

    I got error like you.

    Did you install any package like ucomponent?

    I have just remove ucomponent and I can create "controller". Please try and give your result.

    Maybe we must install package before run source code and install umbraco.

    Kind and Regard!

  • Sean Dooley 283 posts 522 karma points
    Jan 08, 2014 @ 23:11
    Sean Dooley
    0

    I'm getting the following error when attempting to add a Controller in VS2010 and VS2012 Express

    Could not load file assembly 'ClientDependency.Core, Version=1.7.0.4, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    Any ideas?

  • Michael Roodt 1 post 21 karma points
    Jan 09, 2014 @ 15:25
    Michael Roodt
    0

    I have the same error. I setup A blank MVC 4 project. Then add Umbraco CMS Core Binaries via NuGet and when I try add controller , I get could not load file assembly 'ClientDependency.Core'

  • Sean Dooley 283 posts 522 karma points
    Jan 10, 2014 @ 10:30
    Sean Dooley
    0

    Same issue is happening to me if I install UmbracoCms.Core 6.1.6 in a separate project. As at test, I tried the following

    • Created a ASP.NET Empty Web Application in VS2010
    • Installed Umbraco 6.1.6 from Nuget
    • Added a Controllers folder
    • Added a Web API Controller successfully i.e. ProductApiController
    • Inherited UmbracoApiController i.e. ProductApiController : UmbracoApiController

    All works as expected.

    If anyone can shed some light on why ClientDependency.Core is causing issues when using a ASP.NET MVC 4 Web Application, it would be greatly appreciated.

  • Sean Dooley 283 posts 522 karma points
    Jan 10, 2014 @ 15:15
    Sean Dooley
    0

    Just had a tweet from Sebastiaan Janssen that the Umbraco Nuget is currently screwed apparently ... hence the issue.

  • Shannon Deminick 1523 posts 5255 karma points MVP
    Jan 11, 2014 @ 00:59
    Shannon Deminick
    0

    I can replicate this issue but I can't figure out why this would be happening. The new CDF version just contains bug fixes, there's no assembly manifest changes or anything. I'm not sure what has a hard reference to that specific version. If you "Uninstall-Package UmbracoCms.Core" and CDF is left install, there is no problem so for some strange reason some umbraco assembly has a hard reference to that specific version. Even putting assembly redirects in the web.config doesn't fix the issue.

    It definitely seems to be a problem with the 2 DLLs: Umbraco.Web.UI and umbraco.editorControls. If you remove those 2 DLLs as references then the dialog appears correctly. If you only remove one of those 2 DLLs the error still occurs so something tells me that the umbraco core references have some reference problems.

    To get around this issue for the time being you can run these nuget commands:

    Uninstall-Package ClientDependency -Force
    
    Install-Package ClientDependency -Version 1.7.0.4
    

    I'll try to figure out why this is happening.

  • Shannon Deminick 1523 posts 5255 karma points MVP
    Mar 21, 2014 @ 07:13
    Shannon Deminick
    0

    The reason this was occuring was because those umbraco assemblies were built with specific versions - even though the 'specific version' flag on the ref statement is false - this is due to provider loading or something. Those refs are fixed in 6.2+

  • Maff 141 posts 465 karma points
    Dec 05, 2014 @ 10:34
    Maff
    0

    Hi Shannon,

    FYI I just ran into the same issue with Umbraco v7.2:

    I followed your steps above and reinstalled ClientDependency (v1.7.1.2) and now it works fine. However I noticed that uninstalling ClientDependency showed that the installed version was 1.8.0.0:

    Not sure if this is a bug with Umbraco v7.2?

    Cheers,

    Maff

  • Marianne Hildesheim Bertelsen 25 posts 146 karma points
    Dec 10, 2014 @ 11:25
    Marianne Hildesheim Bertelsen
    0

    I get this problem in Umbraco 7.2. Exactly the same as Maff. 

    I'm running VS2012.

  • Shannon Deminick 1523 posts 5255 karma points MVP
    Dec 11, 2014 @ 02:05
    Shannon Deminick
    0

    CDF's latest version is 1.8.x which is why it is showing up. The latest version is 1.8.1

    The issue must be that either your own code has a strong reference to an older version of CDF or some plugin you have installed has a strong reference to an old version. The umbraco core definitely works OOTB

  • Maff 141 posts 465 karma points
    Dec 11, 2014 @ 07:24
    Maff
    0

    Hi Shannon,

    I just tried this again - I set up a fresh MVC4 project (VS2012), installed Umbraco via nuget and get the same result.

    Before installing Umbraco I can create a controller, but afterwards I get the above error.

    Is there any reason why Umbraco has a dependency on CDF 1.8? Could it be removed so it works with MVC4 projects without having to do this extra uninstall/install step?

    Thanks for your help so far on this :)

    Cheers,

    Maff

  • Shannon Deminick 1523 posts 5255 karma points MVP
    Dec 11, 2014 @ 07:35
    Shannon Deminick
    0

    Have just replicate this too... need to figure out what the heck is going on again. Yes, cdf 1.8 is required.

  • Shannon Deminick 1523 posts 5255 karma points MVP
    Dec 11, 2014 @ 07:45
    Shannon Deminick
    0

    Hrm, actually it seems that our nuget package references CDF minimum 1.8 but our projects reference an older version, not sure where that change came from. This is the rev: 9f4d72e137043772f8c50f7c812f2e927ec16cd1

    anyways, I'll just update the core to reference the latest cdf

  • Shannon Deminick 1523 posts 5255 karma points MVP
    Dec 11, 2014 @ 08:58
    Shannon Deminick
    1

    This is fixed in issue: http://issues.umbraco.org/issue/U4-5996

  • Maff 141 posts 465 karma points
    Dec 11, 2014 @ 11:14
    Maff
    0

    Awesome - great work Shannon! :)

  • Nathan Skidmore 63 posts 251 karma points c-trib
    Dec 11, 2014 @ 12:22
    Nathan Skidmore
    0

    Nice work on fixing this issue Shannon. Unfortunately I just upgraded a site yesterday and am now having this issue. The inability to create a controller is going to seriously hamper the development.

    Is there a work around I can apply to the 7.2 codebase or do I need to wait for 7.2.1 to be released? I don't want to upgrade to a nightly build as I need something stable. The alternative is to roll back to 7.1.9 but I was hoping that wouldn't be neccessary. Any tips would be appreciated. Thanks.

  • Maff 141 posts 465 karma points
    Dec 11, 2014 @ 12:29
    Maff
    0

    Hi Nathan,

    You can fix it by following Shannon's instructions on the previous page - uninstall Client Dependency via the nuGet package manager console and then re-install the correct version (i.e. the one your solution says is missing when you try to create a controller)

    Alternatively you can just create a generic class in your controller folder and build the controller manually:

    public class MyController : SurfaceController 
    {
    }
  • Nathan Skidmore 63 posts 251 karma points c-trib
    Dec 11, 2014 @ 12:41
    Nathan Skidmore
    0

    Thanks for the prompt response Maff. That worked. I wasnt sure that Shannon's fix from January was still relevant as Umbraco 7.2 may have had a required dependency on 1.8.0.

    FYI I ran the following commands in nuget:

    Uninstall-Package ClientDependency -Force

    Install-Package ClientDependency -Version 1.7.1.2

  • Maff 141 posts 465 karma points
    Dec 11, 2014 @ 12:44
    Maff
    0

    Cool - pleased you got it sorted :)

  • Gordon Saxby 1406 posts 1747 karma points
    Dec 16, 2014 @ 10:33
    Gordon Saxby
    0

    Just updated to 7.2.1 and this is still an issue :-(

  • Shannon Deminick 1523 posts 5255 karma points MVP
    Dec 17, 2014 @ 23:46
    Shannon Deminick
    0

    It's because 7.2.1 didn't include the change, we ended up releasing 7.2.1 with only a few critical changes, this fix will be in the next version and is already committed to source code.

Please Sign in or register to post replies

Write your reply to:

Draft