I am deploying the web part on sharepoint and getting some errors. A web page uses data from a web service and displays a chart using Microsoft Chart (Framework 3.5). When I try to get it, I get the following error:
Failed to load file or assembly 'System.ServiceModel, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089' or one of its dependencies. The system cannot find the specified file.StackTrace: at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse (SoapClientMessage message, WebResponse response, responseStream stream, logical asyncCall)in System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke [String methodName
Failed to load file or assembly 'System.ServiceModel, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089' or one of its dependencies. The system cannot find the specified file.
StackTrace: at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse (SoapClientMessage message, WebResponse response, responseStream stream, logical asyncCall)in System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke [String methodName
I tried to copy the System.Servicemodel.dll file to the bin folder and register it in the GAC, but the error did not change. Any idea?
thanks
The problem was with the web service, not the web part. The machine on which the web service was deployed has 2.0 installed. An exception was found in the web part and was sent back. Thank you all for your comments.
To expand on the answers above:
It sounds like your site is running asp.net 2.x. Since System.ServiceModel is a 3.x component, the assembly does not load. You will need to install 3.5 on the server, or if you have already installed that IIS runs the site under 3.5
, - , .NET /, , . , , , .
"dotnetfx_cleanup_tool" http://blogs.msdn.com/b/astebner/archive/2008/08/28/8904493.aspx ( , , )
2.0 ( 3.5, 3.0, 2.0. 2.0 ).
: C:\WINDOWS\Microsoft.NET\Framework .NET.
.NET Framework 2.0 SP2 ( ). . .NET Framework 3.5 SP1 ( ), .
- ASP.NET 2.0.5.something?
, :
ASP.NET 3.5 IIS
.NET Framework 3.5 sharepoint.
, - System.ServiceModel(, -). -, . System.ServiceModel GAC.
EDIT: - Web.config System.ServiceModel :
<Reference Include="System.ServiceModel"> <SpecificVersion>False</SpecificVersion> </Reference>
launch your command line in Visual Studio 2010 or select "C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319". And run the following command at a command prompt:
aspnet_regiis.exe -iru
I ran into the same issue with a Silverlight 4 application and solved it by disabling Debug debugging check for
Common Language Runtime exceptions
in Debug => Exceptions
Hope that helps
Mike