Publishing my Web Site

J

Jonathan Wood

Scott,
If all of this "modify after you publish locally" stuff is too cumbersome,
you might consider the add-in recommended by Mark. It appears to have been
developed specifically to address the short-comings of the built-in
"publish" command.

Yes, it is sounding a little cumbersome, and I will check out that add-in as
soon as I get a moment. Personally, I find web.config far too unwieldy to be
having to mess around with it and/or having to remember not to overwrite it
everytime I was to update my site (which is frequently at this time).

Thanks.
 
M

Mark Rae [MVP]

If all of this "modify after you publish locally" stuff is too cumbersome,
you might consider the add-in recommended by Mark. It appears to have been
developed specifically to address the short-comings of the built-in
"publish" command.

Correct - that is precisely why it was developed...

Once you have added a Web Deployment Project to your solution and configured
it the way you want it, it really is just a matter of right-clicking it and
selecting "Rebuild"... No zipping / unzipping anything, no deleting
extraneous files, no manually modifying (or excluding) web.config - all of
that is done for you automatically...
 
P

Paul Shapiro

I've been experimenting with the Web Deployment Project. I set it to output
the Release-configured build to a local file folder. Then I still have to
copy those files to the web host. Do you let the Web Deployment Project
target the web host directly? I think I saw some notes to the effect that
the VS 2008 version of the WDP will not output any files if the build fails.
It would certainly be more convenient to build and deploy in one step if
that's reliable. Also, can WDP deploy via FTP?

One other question about the WDP. I got the web.config replacement working
now. The only thing I haven't been able to do is remove the extra config
files from the build output. At the end of the WDP project file I added the
following, which I thought would delete the extra files, but it's not
working. No errors, but not working.

Any suggestions?
<Target Name="AfterBuild">
<Delete Files="$(OutputPath)\*.Debug.config" />
<Delete Files="$(OutputPath)\*.Release.config" />
</Target>
 
M

Mark Rae [MVP]

Do you let the Web Deployment Project target the web host directly?

Indirectly - see below...
I think I saw some notes to the effect that the VS 2008 version of the WDP
will not output any files if the build fails.

That's correct.
It would certainly be more convenient to build and deploy in one step if
that's reliable. Also, can WDP deploy via FTP?

See the "More Deployment Features" here:
http://weblogs.asp.net/scottgu/arch...-web-deployment-project-support-released.aspx
One other question about the WDP. I got the web.config replacement working
now. The only thing I haven't been able to do is remove the extra config
files from the build output. At the end of the WDP project file I added
the following, which I thought would delete the extra files, but it's not
working. No errors, but not working.

Any suggestions?
<Target Name="AfterBuild">
<Delete Files="$(OutputPath)\*.Debug.config" />
<Delete Files="$(OutputPath)\*.Release.config" />
</Target>

I use variations on the following:

<Target Name="AfterBuild" Condition="'$(Configuration)|$(Platform)' ==
'Release|AnyCPU'">
<Delete Files="$(OutputPath)\appSettings.config" />
<Delete Files="$(OutputPath)\connectionStrings.config" />
<Delete Files="$(OutputPath)\MyProject.csproj" />
<Delete Files="$(OutputPath)\MyProject.csproj.user" />
<RemoveDir Directories="$(OutputPath)\code" />
<RemoveDir Directories="$(OutputPath)\obj" />
<RemoveDir Directories="$(OutputPath)\Properties" />
</Target>

Replace MyProject above with the name of your project...
 
P

Paul Shapiro

Mark, thank you VERY much for the Target Task delete file syntax examples. I
guess wildcards are not supported? Anyway, once I saw your samples it was
easy to add a line for each file.

For deployment, the reference you gave is for the in-development IIS Web
Deployment tool, right? From the documentation and walkthroughs, it seems
you need command-line access to the hosting web server. I'm deploying to a
hosting service, on a shared server, and don't have command-line access. In
that case I don't see how to use the IIS Web Deployment.

I used the Copy Web command from VS2008 to copy to my hosting server via
FTP. That worked fine after I added the Web Deployment Project output folder
as a file-system website in my solution so. But since my whole solution is
under Source Control, the deployment folder was automatically added to
source control, which is completely unnecessary. I didn't see any way to
keep the deployment folder out of source control? Is the only answer to
create a separate deployment solution? That's all I can think of to keep it
out of the source control.
Paul Shapiro
 
M

Mark Rae [MVP]

I used the Copy Web command from VS2008 to copy to my hosting server via
FTP. That worked fine after I added the Web Deployment Project output
folder as a file-system website in my solution so. But since my whole
solution is under Source Control, the deployment folder was automatically
added to source control, which is completely unnecessary. I didn't see any
way to keep the deployment folder out of source control? Is the only
answer to create a separate deployment solution? That's all I can think of
to keep it out of the source control.

I must admit I've never tried that... I don't use the Copy Web command at
all - I use WDP and this: http://www.ftpsynchronizer.com/ which makes
everything extremely simple and efficient:

1) Change

2) Test

3) Debug and re-test

4) Rebuild with WDP

5) Sync
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,192
Latest member
KalaReid2

Latest Threads

Top