Search code examples
c#web-servicesvisual-studiovisual-studio-2012wsdl

WSDL.exe Destination Location Error


I am trying to create a proxy class from a wsdl of my web service which is on localhost. I am using Visual Studio 2012. i used the vs2012 command prompt tool and did below:

C:\Program Files\Microsoft Visual Studio 11.0\VC>wsdl.exe "url to my wsdl ?WSDL" /l:C#

I get the following error:

Error: Destination location 'C:\Program Files\Microsoft Visual Studio 11.0\VC\Service1.cs' could not be opened for write operation", - Access to the path 'C:\Program Files\Microsoft Visual Studio 11.0\VC\Service1.cs' is denied.


Solution

  • Try doing it via command line ran with Administrator privileges. (Or start VS as Administrator).

    Or use switch /out switch to write to some path where you have permissions, something like this

    /out:"C:/temp/Service1.cs"