I was trying to use svcutil.exe to generate proxy classes for a service but when I use the /reference
option to reference an assembly that is built for .NET 4.0 I g
Why not rebuild as .NET 3.5 to generate the classes? I suspect the types you're generating classes for don't rely on any .NET 4.0 functionality. The cs files won't care what version the DLL was built for so you can use them in a 4.0 project just fine.
The latest version of the SDK for .Net 4.0 is available at
http://msdn.microsoft.com/en-us/windows/bb980924.aspx
svcutil.exe which resides in v7.1/bin has version 3.0.4506.2152.
svcutil.exe which resides in v7.1/bin/NETFX 4.0 Tools has version 4.0.30319.1.
Answering my own question. The new version of svcutil
will probably come with v7.1 of the Windows SDK that is released in mid-June.
Update: Newest version of util is not v7.0 as per:
Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools
SvcUtil.exe v8.0A is now available after installing Visual Studio 2012 (VS 2012)
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\SvcUtil.exe"
What you really want is the full definition for turning a WSDL file into a service client:
/n:*,MyCompany.Services.Client /out:IServiceInterface.cs ServiceDefinition.wsdl.xml
Where service definition.wsdl is obviously the ?wsdl response from any old soap endpoint.
Minions and Trolls remember! Everything is now Async so look for and take advantage of the new Async support generated by v8.0 of SVCUtil.exe
I'm having the same problem.
Microsoft says that you can only use .Net 4 DLLs with the new SvcUtil that comes wit the latest version of .Net (http://msdn.microsoft.com/en-us/library/aa347733.aspx) but that version seems to be the one you are mentioning above. It won't access .Net 4 DLLs as references at all.
I had the same issue. If your project is set to use the .NET 4.0 Framework, you must choose the right version of SvcUtil.exe, or it will throw an error: "Could not load..."
However, there is another version of SvcUtil.exe located in "Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools" which is version "4.0.30319.1", and if you use it, everything should work.