views:

4460

answers:

5

I'm deploying a webpart on sharepoint and getting some errors. The webpart consumes data from a Web Service and displays a chart using Microsoft Chart (Framework 3.5). When I try to acces it, I get the folowing error:

Could not 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 file specified.

StackTrace: at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

I tried copying System.Servicemodel.dll to the bin folder and registering it on the GAC, but the error does not change. Any idea?

Thanks

A: 

Is your website configured to use ASP.NET 2.0.5.something ?

Maybe this article can be helpfull:

Forcing ASP.NET 3.5 ON IIS

Frederik Gheysels
On my development server the webparts works fine without the compilers section in the web.config.I tried adding the system.codedom and compilers section in the web.config, but didn't work
nicoruy
A: 

Try installing .NET Framework 3.5 on your sharepoint server.

Otávio Décio
It's alredy installed. Microsoft Chart requires .net framework 3.5 SP1
nicoruy
+1  A: 

To expand on the above answers:

It does sound like your site is running on asp.net 2.x. Being that System.ServiceModel is a 3.x component, the assembly will not load. You will need to install 3.5 on the server, or if you already have it set IIS to run the site under 3.5

Joe
A: 

It sounds like the Web Part itself was built against an older version of the System.ServiceModel assembly (probably a beta version). If you have access to the web part's source code, you should recompile it against the latest stable version. Otherwise you'll have to find the exact same version of System.ServiceModel and register that into your GAC.

EDIT: You could also try going into your web app's Web.config and replace your System.ServiceModel reference with this:

<Reference Include="System.ServiceModel">
  <SpecificVersion>False</SpecificVersion>
</Reference>
davogones
A: 

The problem was within the Web Service, not the webpart. The machine where the web service was deployed has framework 2.0 installed. The exception was catched on the webpart and reported back. Thank you all for your comments.

nicoruy