Update webreference gives troubles with different versions of dll
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.
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).
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>
精彩评论