Getting error in umbraco The type or namespace name 'Umbraco' could not be found - asp.net-mvc-4

The type or namespace name 'Umbraco' could not be found (are you
missing a using directive or an assembly reference?)
I am getting this error when I am inheriting my controller from
Umbraco.Web.Mvc.RenderMvcController
I have checked that umbraco.dll is referenced when I install umbraco from NuGet in Visual Studio 2012.
Intellisense allow me to select this reference but when I compile code it throw this exception like below screen explains it.
All other umbraco is working nice I have designs some static views, master pages, macros etc. all working fine.

In case of Umbraco.
my application was on .Net FrameWork 4.0
umbraco previous version was using .Net FrameWork 4.0
so i was try to use new release of Umbraco 7.0.1 on same FrameWork 4.0 after reading an post i check for .Net Framework for new release i found that was on .Net FrameWork 4.5 so i upgraded my application to 4.5 it resolve the issue.
thanks to everyone who visit to this post.

Related

Issues while upgrading System.Web.Extensions dll reference from 3.5 to 4.0

I need to migrate a website built on .net framework 3.5 to 4.0 and it should work fine in IE9
The solution got upgraded by the VS's version utility and the app compiled successfully. We are using Infragistics UltraWebGrid control v11.1 which is giving some script issue when we try to perform scroll or cell edit. The control has got lot of embedded javascript resource files which seems to be not working fine.
I created a poc website of .net framework 4.0 using the same third party dlls and everything works fine. What I can doubt on is the AJAX part. I tried to consume v4.0 of ajaxcontroltoolkit. But the issue what I am facing is, the toolkit internally references System.Web.Extensions.dll of version 4.0 and my application has many references to the dll of v3.5. Adding the reference to v4.0 doesn't replaces the references to v3.5 in the web.config. Finally I manually updated the version info in web.config which has given birth to other errors.
-Unknown server tag 'asp:ScriptManager','asp:UpdatePanel' etc..
-The type or namespace name 'Script' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Please give me some suggestions to upgrade the dll references successfully.
Thanks,
Vaishali

Is it possible to use a .Net 4.5 assembly (using Entity Framework 5) from a .Net 4 project?

I have a project written in VS2012/.Net 4.5 that is essentially a bog-standard, database-first Entity Framework 5 entity model and context, and associated business domain classes. That all works fine when I'm referencing the built assembly from a VS2012/.Net 4.5 application (I've used it successfully with an MVC website and with integration test projects). However when I try to use the exact same assembly from a VS2010/.Net 4 application on the same machine, Visual Studio will add a reference to the assembly with no problem, the classes will also show up under Intellisense (I can add a using statement, for example), but as soon as I try to build the project I get the following error:
Warning 3 The primary reference "MyDotNet45Assembly" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
My understanding (e.g. from Scott Hanselman here) was that .Net 4.5 was an in-place upgrade to .Net 4.0, so I can't understand why I can't call an assembly created for the newer version. What am I missing or misunderstanding? I can't believe I'm the only person who has hit this issue, but I'm genuinely struggling to find anything on the web that explains what's going on.
I've looked at a number other questions on StackOverflow, none of which seem to quite cover what I'm after, e.g:
Using EF4.0 in a .Net 3.5 app
Using a .Net 4.0 assembly in a .Net 4.5 project

ASP.NET Web API conflict after installing VS 2012 Ultimate

I installed asp.net mvc-4 beta a while ago to host our api. It worked fine until I just installed vs2012 ultimate on my machine. The project is neither compiling in vs2010 nor in vs2012. What can I do to resolve this conflict. Furthermore, I bin deployed asp.net web api assemblies on my server. What I have to do to run the latest build (once the previous problem is solved) on server?
Edit:
The compilation errors when I open in vs2012 are
'System.Net.Http.HttpRequestMessage' does not contain a definition for 'GetUserPrincipal' and no extension method 'GetUserPrincipal'...
'System.Web.Http.Hosting.HttpPropertyKeys' does not contain a definition for 'UserPrincipalKey'
In vs 2010 on the other hand, it refuses to accept types like DelegatingHandler and others. Some errors are as follows.
The type or namespace name 'DelegatingHandler' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'HttpResponseMessage' could not be found (are you missing a using directive or an assembly reference?)
I have installed the latest build of asp.net mvc 4 as well and the version its showing me is 4.0.20713.0. Previously, I added web-api beta using nuget. I have removed them all and installed latest builds of web-api from nuget. I don't know what could be the problem. One thing, I don't understand: why do I need to install web-api assemblies seprately when they are supposedly part of mvc framework?
thanks
Add using System.ServiceModel.Channels; to your file. The Extension methods for HttpRequestMessage exist in this namespace according to THIS.
add
using System.Net.Http;
You probably have the reference already, so just add the using for the extension method.
Otherwise add the Assembly of the same name.

ASP.NET MVC 4.0 RC and Newsoft.Json

I just installed the ASP.NET MVC 4.0 RC build on top of a Visual Studio 2010 SP1. My project that used to compile and work with the beta version of ASP.NET MVC 4.0, raises an error when I access the site saying that the Newtonsoft.Json assembly version 4.5 can not be found.
As I did not use this third party library in my current project, I configured Fusion Log to try to isolate the assembly that was relying on Newtonsoft.Json assembly.
And the guilty assembly is System.Net.Http.Formatting.dll which references Newtonsoft.Json version 4.5.
The beta build referenced System.Json.dll and not the Newtonsoft assembly.
I can hardly believe that Microsoft is starting to rely on external assemblies even if they publish more and more code in open source.
Does anyone have an explanation of what happened?
They are actually relying in third-party software (just like they ship MVC with JQuery and knockout.js). Scott Guthrie announced that MVC 4 will be shipped with JSON.NET (Newtonsoft). See below:
Json.NET: We plan to use the community developed Json.NET
serialization stack in our default JSON formatter in ASP.NET Web API.
Json.NET provides the flexibility and performance required for a
modern web framework.
http://aspnet.codeplex.com/wikipage?title=ASP.NET%20MVC%204%20RoadMap
You can keep the System.Json.dll btw, I've got them both. If you have any problems with JSON.NET, just reinstall it :)

Creating NuGet Packages - Why doesn't this folder structure work for .NET 4.0?

Here is the issue I'm having - I cannot get my project's NuGet package to work for .NET 4.0.
Here is what my folder structure looks like:
lib\
\.NET 4.0
binary.dll
\Silverlight 4.0
binary.silverlight.dll
Whenever I try to add this package to a Silverlight 4 project, it works just fine. When I try to add it to an ASP.NET MVC3 app I get the following error: "unable to find assembly references that are compatible with the target framework '.NETFramework, version=v4.0'"
What am I doing wrong?
Change the folder name to Net40 and SL4 (or Silverlight4 no spaces). You should file a bug though, those names should work. I think the "." in .NET might be throwing it off.