Issues while upgrading System.Web.Extensions dll reference from 3.5 to 4.0 - .net-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

Related

Getting error in umbraco The type or namespace name 'Umbraco' could not be found

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.

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

Missing assemblies with mono 3 MVC web app

I've installed the freshly released Mono 3 and MonoDevelop on my Mac, and I was keen to get a simple MVC web application working with razor view pages.
When I File-New-Solution up a MVC 3 Web Application (razor), the thing doesn't compile, giving the error:
The type or namespace GlobalFilterCollection could not be found
It's because 2 references are not working - System.Web.Helpers and System.Web.WebPages. When I look at these in the references list in MonoDevelop, they are red with "Assembly not available" - looking at the references in more detail it seems I'm referencing system.web.mvc 2.0.0.0, whereas everything else is 4.0.0.0. Can anyone advise?
I eventually got mine to run by referencing the System.Web.Mvc.dll found in /Library/Frameworks/Mono.framework/Libraries/mono/4.5/
I also had to bring over System.Web.Helpers.dll from a Windows box and update the Web.Config using one generated by Visual Studio.
There's probably a better way to do this (please be a better way), but figured I'd pass on what I found.
Add packeges "Microsoft ASP.NET MVC" and "Microsoft ASP.NET Web Pages" from NuGet.

Why can't my .NET 4.5 project use a DLL compiled for .NET 4? (Both use EF 5)

I have an application that consists of a client-side application and a WebApi website.
My client-side stuff is targetting .NET 4 so that I don't have to insist that users install .NET 4.5. My website, however, is entirely under my control, so I'm targetting .NET 4.5.
There is one shared assembly, which I use for data access. It uses Entity Framework 5.
When I build the client application, the DLL used is version 4.4.xxx, whereas when I build the web application, the DLL is 5.0.xxx.
Up until now, I've been able to run the client application with no problems, and I've also been able to run the web application, again without problems.
However, I've now re-created my web application project from scratch (*), and suddenly I can't run it. I get a YSOD saying "Could not load file or assembly 'EntityFramework, Version=4.4.0.0 ..." at the point where my data-access assembly is first invoked.
Now, it's perfectly clear what that error means - it can't find the v4.4 DLL as used by the data-access assembly - but I don't understand why that's a problem with my new project when it wasn't a problem with my old project. As far as I can see, the same DLLs are referenced in each project.
(*) I should explain why I'm re-creating my project. I originally created the project in VS 2012 RC, and then later upgraded to the release version. Although this supposedly upgraded my project, I've had a few problems with it, and have also noticed some differences v. a newly-created project. So, to be on the safe side - and hopefully circumvent those other problems - I'm re-creating it from scratch.
So, my question: why is this suddenly a problem, and what can I do to resolve it?
Is the code depending on the assemblies set to require the exact version? If so, you will need a publisher policy for the EntityFramework assembly or bindingRedirect for the referencing application (web 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.