tags:

views:

51

answers:

2

In my application, I use some dll, let's say library.dll, version 1.0 In my webservice, I also use library.dll, but version 2.0

When I do an update of the webreference, the classes inside of the dll are also generated in the webreference.

And this gives troubles because in my application, the classes that are defined in the dll now are also available in the reference and there is a mismatch.

How can I solve this? I need to be able to tell the webservice to ignore the dll-code when updating the webreference in the one or the other way.

I use Visual Studio 2008.

A: 

You could use the reference switch when generating your client proxy:

svcutil.exe /reference:c:\library.dll http://example.com/service.svc?wsdl

This will look for classes in library.dll that are the same in the WSDL and it won't recreate them in the proxy (By same classes I mean same namespace and type name).

Darin Dimitrov
and if I have this problem with 5 dll's?
Natrium
You could use `/reference` switch multiple times for each of the libraries.
Darin Dimitrov
I have a webservice, not a wcf-service. Will this also work?
Natrium
nope, doesn't seem to work. The classes still get generated.
Natrium
I've just verified and it doesn't seem to work with non WCF services. Sorry.
Darin Dimitrov
and Wsdl.exe doesn't have some sort of reference-parameter...
Natrium
A: 

ok, I found the solution myself.

The extension must be deployed in the GAC and the machine.config must be changed.

something like this:

<system.xml.serialization>
    <schemaImporterExtensions>
      <add name="SchemaImporterExtensions"
           type="Library.DesignTime.SchemaImporterExtension,
                 Library.Framework.DesignTime" />
    </schemaImporterExtensions>
</system.xml.serialization>
Natrium