I have developped an asmx webservice with visual studio and I deploy on IIS 7 which has 3.5 Framework by copying all the files.
When testing it says
Could not load file or assembly
‘System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35’ or
one of its dependencies. The system
cannot find the file specified.
I don’t use [System.Web.Script.Services.ScriptService] so I don’t understand why it tries to load System.Web.Extensions.
So I change in Visual Studio from .NET 2 to 3.5 but got another error:
Could not load file or assembly
‘WebServiceTest’ or one of its
dependencies. An attempt was made to
load a program with an incorrect
format.
How to fix this ?
Note: I’m not using any other assembly/lib I’m just learning webservice so it’s very simple: I create a webservice Test.asmx with one method which uses one class Test.cs within same namespace WebServiceTest. This works locally.
Finally I have started from scratch again now it works, I think I have mismatched by renaming namespace, class etc.
Maybe you are using a third party assembly which relies on
System.Web.Extensions. Make sure this assembly is not referenced in your project either explicitly or implicitly. Also normally the version of this assembly is 3.5.0.0. From the error message it seems that your project is using version 1.0.61025.0 which is an old version. Try looking at every referenced assembly to see what uses this old version. You might need to deploy it on the target server.