System.ServiceModel Error While trying to open ASP.net website - asp.net

I tried to open ASP.Net Website , but I received this error.
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
what is this about ?

below links are very much helpful you can refer to it :
http://blogs.msdn.com/b/webtopics/archive/2010/04/28/system-typeloadexception-for-system- servicemodel-activation-httpmodule-in-asp-net-4.aspx
http://social.msdn.microsoft.com/Forums/en/wcf/thread/39571e42-aca7-469d-8c68-aa59c2da4fcc
This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.
To resolve this problem, you must use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe,) to register the correct version of ASP.NET. This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:
aspnet_regiis.exe -iru
OR
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
good luck

Related

Duplicate reference to mscorlib CS1703 Error

So I am currently working on migrating an application that was living on a windows 2k3 server to a machine running Windows 2012 server. After moving the site over, setting the app pool correctly and configuring the rest of the site, I am receiving this error. After doing some research it appears to be a reference to one of the main .net core libraries, and they are added by default to any project started in Visual Studio. I have not been able to find them referenced within the project anywhere. I've pretty much exhausted google search and have not been able to find a solution to this problem.
The error:
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
'mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' has already been imported. Try
removing one of the duplicate references.
Source Error:
[No relevant source lines]
Source File: Line: 0
Show Detailed Compiler Output:
C:\Windows\SysWOW64\inetsrv> "C:\Program Files (x86)\LINQ
Preview\Bin\csc.exe" /noconfig /fullpaths
#"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\cts\67846b7a\f5d88660\sfsllqyb.cmdline"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50916 for Microsoft
(R) Windows (R) 2005 Framework version 2.0.50727 Copyright (C)
Microsoft Corporation 2001-2005. All rights reserved.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll: error
CS1703: An assembly with the same identity 'mscorlib, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been
imported. Try removing one of the duplicate references.
c:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll: (Location
of symbol related to previous error)
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.6.1069.1
Would appreciate any insight.

ASP 5 MVC 6 (RC1) - Web API with EF 6 works locally but not deployed

I have a Web API I created in ASP 5 MVC 6 (FULL CLR). The web API references a standard .net class library, which has the entity framework 6 NUGET package installed. If I launch the web api locally (IIS express) and then try to run a method which contacts the database, everything works fine.
When I deploy the web API (I set it up in IIS), using the "Publish" command, to my DEV server (Windows Server 2012) and try to contact the same method, but on the server, I get the following exception (any other method that doesn't touch the database works):
{
"$id":"1",
"ClassName":"System.IO.FileNotFoundException",
"Message":"Could not load file or assembly 'EntityFramework,
Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
or one of its dependencies. The system cannot find the file specified.",
"Data":null,
"InnerException":null,
"HelpURL":null,
"StackTraceString":"
at CMAllocation.Web.Data.InvestorRulesRepository..ctor()\r\n
at CMAllocation.Web.CMAllocationWebApi.Controllers
.InvestorRulesController.GetInvestors()
in E:\\CMAllocation\\WebServices\\CMAllocationWebApi
\\Debug\\approot\\src\\CMAllocation.Web.CMAllocationWebApi
\\Controllers\\InvestorRulesController.cs:line 45",
"RemoteStackTraceString":null,
"RemoteStackIndex":0,
"ExceptionMethod":
"1\n.ctor\nCMAllocation.Web.Data, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null\nCMAllocation.Web.Data.InvestorRulesRepository\nVoid .ctor()",
"HResult":-2147024894,
"Source":"CMAllocation.Web.Data",
"WatsonBuckets":null,
"FileNotFound_FileName": "EntityFramework, Version=6.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089",
"FileNotFound_FusionLog":
"WRN: Assembly binding logging is turned OFF.\r\n
To enable assembly bind failure logging, set the registry value
[HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.\r\n
Note: There is some performance penalty associated with
assembly bind failure logging.\r\n
To turn this feature off, remove the registry value
[HKLM\\Software\\Microsoft\\Fusion!EnableLog].\r\n"
}
Any help would be appreciated.
UPDATE I can clearly see the EF 6 dll's in the approot/packages folder:
Your server is missing 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
Build on the server with msbuild.
Run NuGet restore. Dave Ebbo has a good article. It is nuget restore from the cmd line.
If that doesn't work, install the EntityFramework package into the GAC on your server.

Oracle.ManagedDataAccess The system cannot find the file specified

In my website project built on .net 3.5, when I add reference to the Oracle.ManagedDataAccess.dll by adding this in the web.config
<add assembly="Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89B483F429C47342"/>
it give this error
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.
This error comes at .net version 3.5
The solution is to upgrade the .net version to .net 4.0 or above
Upgraded my project version to .NET 4.8 from .NET 4.5.2 and then
Installed the OracleManagedDataAccess nuget package into the solution (seems it wasn't installed)
This resolved the error.

ASP.NET Web Api nightly builds doesn't run on server

I get this error message on my server:
Method 'GetVirtualPath' in type 'System.Web.Http.WebHost.Routing.HostedHttpRoute' from assembly 'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
RouteTable.Routes.MapHttpRoute(...)
I use Nuget to download the latest nightly build of Microsoft ASP.NET Web Api.
It's seems like a bin/gac problem but I'm not sure.
An older version of System.Web.Http was installed in the GAC.
gacutil /uf system.web.http
That fixed it.

ASP.NET website is working in IIS but not in browser

I have deployed my asp.net 2.0 website on IIS, and I tested there by browsing website in IIS and it's working fine.
But I am getting the below error while browsing the website
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'xmlns'.
Source Error:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Previously when we used to create a website in IIS, it worked fine. I have checked the website folder in IIS [ By clicking Property > ASP.NET] and the framwework tageted there is 1.1, and it is in read only mode. If the problem is related to this issue than please let me know how to change it.
In the Property > ASP.NET tab you need to select the 2.0 version in the version combo. If not available, it means that .NET 2.0 is not properly installed with IIS.
I had this exact error message on a machine where I installed .NET 2.0 prior to IIS.
You can fix this by opening a .NET 2.0 SDK Command Prompt, and run
aspnet_regiis.exe -ir
This will register .NET 2.0 in IIS, and you will get it available in the version combo.
NOTE:
An alternative to run it in the SDK command prompt, is to open a standard command window and navigate to the .NET Framework 2.0 installed location and run aspnet_regiis.exe -ir from there.
On my installation this is:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50110>
The error message you're getting is that the attribute xmlns of the element configuration is not recognized. Before anything else, have you tried removing the xmlns attribute?
I've just double checked by looking at a web.config file I have to hand and the start of it looks like this:
<?xml version="1.0"?>
<configuration>
<configSections>
i.e. No xmlns attribute on the configuration element

Resources