Error building empty website in VS2012 - asp.net

I am using Visual Studio 2012 Update 3 and whenever I create a new ASP.NET empty website and build it for the first time compilation is successful but I get a server error when accessing the site of "Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest."
If I then go back and build the website again I get a single error of "Object reference not set to an instance of an object" but no line number.
This error occurs whichever framework I am targeting and whether I am using C# or VB.
Can anyone point me in the right direction please?
Thanks,
Richard.

Possibly AjaxControl Toolkit is the issue.
Depending on your Framework version( 4.5, 4.0, 3.5 ),, install the correct version of AjaxControl Toolkit from here: http://ajaxcontroltoolkit.codeplex.com/releases/view/94873.
Another solution I found is to place System.Web.Extensions.dll and System.Web.Extensions.Design.dll directly in the Bin folder of your web application.

Related

Error While loading project in VS2012

Error 109 'Could not load file or assembly 'DevExpress.Web.v14.1,
Version=14.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' or
one of its dependencies. Invalid pointer (Exception from HRESULT:
0x80004003 (E_POINTER))'
I use to work on VS2008 previously, but recently I have moved from VS2008 to VS2012. Everything is working good, but whenever I add Devexpress Control(Grid View) in my project, I am getting this error message.
I have searched for this error on Google, and everytime I have found the below mentioned link but it didn't solved my problem.
Link I use to get from Google : https://www.devexpress.com/Support/Center/Question/Details/KA18620
Please help.
I think that your project is targeted to a .NET version prior to 4. Version 14.1 of DevExpress components requires .NET 4+. Change your .NET version in the project properties.

Microsoft chart controls 3.5 compatibility issues with .net 4.0+

I made an .net application using VB with a target framework of 3.5. I also use Microsoft's chart control for .net 3.5. The problem is the chart control has compatibility issues with 4.0 and above. Micrsoft listed a fix for it on their website, but when I attempt to launch the application it gives me an error due to their "fix"
Here is the link to the Microsoft fix on their website: http://msdn.microsoft.com/en-us/library/dd990785(v=vs.110).aspx and here's the error I get upon trying to launch the application after applying their fix: An unhandled exception of type 'System.InvalidOperationException' occurred in test.exe
Additional information: An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'System.Windows.Forms.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I understand that it can not seem to find the assembly file, but I have no clue how to fix it. I need help, thanks!

ASP.Net 3.5 web app trying to load System.Web.Mobile.dll version 4.0.0.0

I'm trying to debug a web application that I inherited from a previous developer, it was written using Visual Studio 2008 with the .Net 3.5 framework (hence using asp.net 2.0). I can see temporary asp.net files show up in the 2.0 folder (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files)
Unfortunately every time I try browse to the login page on my local IIS server I get the following error:
"Could not load file or assembly 'System.Web.Mobile, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)"
The assembly is not referenced anywhere in the application, I have no idea why it's trying to load it when I browse to the page. I tried explicitly referencing the the 3.5 version as follows in the web.config using the 2.0 framework dll:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll
No matter what I do however it seems to try to bind to the 4.0.0.0 version and fails to load the page.

Old web application on server with .NET 4.0 stopped working

I have an old ASP.NET web application on a server, which was developed in Visual Studio 2008 in the year 2008. The server now has .NET 4.0 installed also. When I try to access the web app I get:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1703: An assembly with the same identity 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' has already been imported. Try removing one of the duplicate references.
Source Error:
[No relevant source lines]
Is there anything I can do to get it to work without access to the original Visual Studio solution? I believe it has to do with the fact that .NET 4.0 is also installed on the server.
1) Have you checked the application pool your application is running under? Is it still .net 2.0 integrated/classic, or has it automagically changed to 4.0? If so, try changin back to 2.0.
2) Do you by any chance have a System.Web.Extensions.dll in the bin folder of the application? If so, try renaming it (similar situation as here)
3) If 1 is not an option and 2 is not the case, do you have any explicit references to the System.Web.Extensions in the app's config file? Are they requesting a different version of the file?

Could not load file or assembly 'Microsoft.Windows.Design.Extensibility'?

Strange. I am trying to deploy my application, normally there is not problems but recently i played with adding LINQ2SQL to the project and adding Entity Framework.. but removed them. Now when i try to deploy to my server, running it i am getting this error.. and i can't find a way to fix it ! I never used this assembly.. but i suspect Entity Framework or LINQ2SQL to have caused this.
Could not load file or assembly
'Microsoft.Windows.Design.Extensibility, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.
Additional infos:
I am using a Website project and not
a web application project.
I am
using DevExpress but i added all
their dll to the bin folder and that
never caused any problems.
Any ideas ?
Thanks!
I had this issue and solved it by removing the DevExpress.Xpf dlls from the bin folder after reading a comment on this DevExpress thread
This DLL is part of Visual Studio. You should be able to add it through Add Reference > Assemblies
Hover over the name to see where the location is and pick the one corresponding to your version of Visual Studio.

Resources