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.
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.
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
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?
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!
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!
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?
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).
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.
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.
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'
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.
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:
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+
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:
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
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?
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
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.
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:
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.
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.
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:
Thanks,
David
I get the same error in VS2010, but works OK in VS2012.
Stephen
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
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
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
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
Btw, the assembly version of umbraco.dll that you have in packages\UmbracoCms.Core.6.0.0\lib is correct.
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
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
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
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
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
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
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
Yep, removing the reference to Our.Umbraco.uGoLive.47x solves the issue. Nice work Stephen!
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
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!
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?
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'
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
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.
Just had a tweet from Sebastiaan Janssen that the Umbraco Nuget is currently screwed apparently ... hence the issue.
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:
I'll try to figure out why this is happening.
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+
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
I get this problem in Umbraco 7.2. Exactly the same as Maff.
I'm running VS2012.
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
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
Have just replicate this too... need to figure out what the heck is going on again. Yes, cdf 1.8 is required.
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
This is fixed in issue: http://issues.umbraco.org/issue/U4-5996
Awesome - great work Shannon! :)
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.
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:
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
Cool - pleased you got it sorted :)
Just updated to 7.2.1 and this is still an issue :-(
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.
is working on a reply...