0

I want to publish WCF Service Application created in Visual Studio 2010 on IIS Express.

So I'm using Project -> Publish -> Web Deploy:

Service URL: http://localhost
Site/application: wcf

But ran into some miss-understanding:

  • Web Deployment requires a virtual directory, it doesn't want to publish in the site root
  • IIS Express doesn't support virtual directories

How can I accomplish the task?

abatishchev
  • 92,232
  • 78
  • 284
  • 421

4 Answers4

1

You can add a virtual directory via a command line using appcmd:

appcmd add vdir /app.name:<site_name>/ /path:/<virtual_directory> /physicalPath:<physical_location> 

See here

Eugene
  • 2,678
  • 1
  • 22
  • 23
  • How to create vdir `wcf` on site `WcfService1` in `c:\WcfService1`? – abatishchev Apr 18 '11 at 17:51
  • If you already have site named WcfService1 the command is: `appcmd add vdir /app.name:WcfService1/ /path:/wcf /physicalPath:c:\WcfService1` – Eugene Apr 19 '11 at 06:37
  • I tried the same and got: `ERROR ( message:Cannot find APP object with identifier "WcfService1/". )` – abatishchev Apr 19 '11 at 06:56
  • It means that the site with name WcfService1 does not exists – Eugene Apr 19 '11 at 14:12
  • Are you sure you need to install under WcfService1 site. To install in default site you can use the following command: `vdir /app.name:"Default Web Site"/ /path:/wcf /physicalPath:c:\WcfService1`. To Create a new site you can use: `appcmd add site /name:WcfService1 /id:2 /physicalPath:C:\WcfService1 /bindings:http/*:8080` (this site will listen to port 8080 – Eugene Apr 19 '11 at 14:33
1

You should be able to specify the destination of your web site/application in site properties -> Package/Publish Web. In the field "IIS Web Site/application name to use on the destination server" put the site name. There, by default, the application is specified as a virtual directory but it does not have to be. You can just put the name of your site there, without the "/" and then it will deploy to the root of the site, not a virtual (sub-)directory. See screenshot:

Screenshot

Alen Siljak
  • 2,147
  • 1
  • 21
  • 26
0

IIS Express does support virtual directories. Using appcmd command provided by 'Eugene' should work.

vikomall
  • 16,953
  • 6
  • 44
  • 38
0

Fist of all, you need to specify the correct Service URL, i.e. http://server/MsDeployAgentService

abatishchev
  • 92,232
  • 78
  • 284
  • 421