Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

Publishing my Web Site

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jonathan Wood - 25 Jan 2008 18:23 GMT
Okay, looks like VS 2008 finally includes an automated feature to precompile
my site before publishing. Cool.

However, when I run this dialog box and click OK, it then complains that
access is denied by my database file (in the App_Data folder). And
everything appears to end there with no additional information. (I don't see
that the database is in use other than it is attached to SQL Server 2005.)

My database file should *not* be transferred to the site. The data has
already been copied via an involved process. But I seem to be given no
options regarding which files should not be transferred and the entire
process just stops if a file that cannot be copied is encountered.

Is there some trick to making this work?

Thanks.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Mark Rae [MVP] - 25 Jan 2008 19:03 GMT
> Okay, looks like VS 2008 finally includes an automated feature to
> precompile my site before publishing. Cool.
[quoted text clipped - 13 lines]
>
> Thanks.

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Mark Rae [MVP] - 25 Jan 2008 19:04 GMT
> Is there some trick to making this work?

http://blogs.msdn.com/webdevtools/archive/2007/12/01/web-deployment-projects-wdp
-for-visual-studio-2008-december-2007-ctp-released.aspx


Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Jonathan Wood - 25 Jan 2008 22:53 GMT
I'm not really clear on what that is but it is something quite different
from the Build|Publish Website command.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

>> Is there some trick to making this work?
>
> http://blogs.msdn.com/webdevtools/archive/2007/12/01/web-deployment-projects-wdp
-for-visual-studio-2008-december-2007-ctp-released.aspx
Mark Rae [MVP] - 26 Jan 2008 00:29 GMT
>>> Is there some trick to making this work?
>>
>> http://blogs.msdn.com/webdevtools/archive/2007/12/01/web-deployment-projects-wdp
-for-visual-studio-2008-december-2007-ctp-released.aspx

>
> I'm not really clear on what that is but it is something quite different
> from the Build|Publish Website command.

Yes, that's exactly what it is - an add-in to Visual Studio.NET designed
specifically to simplify the precise task with which you're currently having
difficulty...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Jonathan Wood - 09 Feb 2008 04:09 GMT
Sorry for the long delay. (I've been very busy.)

I still say it looks like something else but I will look into it further
when I get a chance to better explore what you are saying.

Thanks.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

>>>> Is there some trick to making this work?
>>>
[quoted text clipped - 6 lines]
> specifically to simplify the precise task with which you're currently
> having difficulty...
Mark Rae [MVP] - 09 Feb 2008 21:19 GMT
>>> I'm not really clear on what that is but it is something quite different
>>> from the Build|Publish Website command.
[quoted text clipped - 4 lines]
>
> I still say it looks like something else

Web Deployment Projects is exactly what its name suggests - what do you
think it looks like...?

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Lars - 09 Feb 2008 21:37 GMT
>>>> I'm not really clear on what that is but it is something quite
>>>> different from the Build|Publish Website command.
[quoted text clipped - 7 lines]
> Web Deployment Projects is exactly what its name suggests - what do you
> think it looks like...?

Is there a differense between publishing the page to a local folder and then
using another program to upload the page to the server or publishing the
page direct to the server. Imagine you have a database with several hundred
of megabites or several Giga Bytes. Then you might want to do it in the
backgroud using WSFTP Pro for example which handled interupted FTP and FTPS
connction very nicely.

As I've seen when you add a MasterPageFile to a document it adds "~/" to the
file name. I always remove this and use relative linking to the Master File.
After all I might want to add the page tu subdirectory to the homepage. For
example www.mysite.com/site2/

Is there a reason why VS 2008 adds "~/" to the page. On a linux server "~/"
means the users home directory. Renerally /home/username. What does it mean
if you use IIS?

Lars
Jonathan Wood - 11 Feb 2008 02:52 GMT
Well, as I thought I mentioned, it seems to be missing a bunch of stuff to
publish the site.

For starters, there doesn't appear to be any place to enter my FTP username
and password. Second, there doesn't appear to be any place to specify which
files should be copied, etc.

Am I the only one who needs a different web.config file on my site from the
one on my development machine? I seriously doubt it but MS seems to assume I
am.

When I attempt to run this command, I get an error that access is denied
with my database file. That is expected since it is attached to SQL Server.
But this feature doesn't seem to allow me to do anything about it.

I guess I just assumed a web deployment tool would allow me to specify login
information and specify which files need to be transferred.

Did I miss something?

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

>>>> I'm not really clear on what that is but it is something quite
>>>> different from the Build|Publish Website command.
[quoted text clipped - 7 lines]
> Web Deployment Projects is exactly what its name suggests - what do you
> think it looks like...?
Mark Rae [MVP] - 11 Feb 2008 03:09 GMT
> Am I the only one who needs a different web.config file on my site from
> the one on my development machine? I seriously doubt it but MS seems to
> assume I am.

I guess you haven't had time to read the documentation yet, so...

1) Right-click your web deployment project

2) Select the build for which you want different web.config sections
(usually the Release build)

3) Click Deployment

4) Check the checkbox entitled "Enable Web.config file section replacement"

5) Click the [examples] hyperlink for some examples

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Jonathan Wood - 11 Feb 2008 17:10 GMT
Mark,

>> Am I the only one who needs a different web.config file on my site from
>> the one on my development machine? I seriously doubt it but MS seems to
>> assume I am.
>
> I guess you haven't had time to read the documentation yet, so...

Huh? I've read boatloads of documentation and have stacks of books I'm still
reading. If you mean that I haven't had time to read all the documentation
ever written, then you'd be correct.

> 1) Right-click your web deployment project

I don't know what this means. I have an ASP.NET project. I want an easy way
to place it on my Web server, preferrably precompiled. So I don't have a
"web deployment project."

> 2) Select the build for which you want different web.config sections
> (usually the Release build)
[quoted text clipped - 5 lines]
>
> 5) Click the [examples] hyperlink for some examples

Right now, my project is working on the Web. But a better way to publish it
would be nice. Clearly, there is some functionality here I guess I need to
look into. But if I need to learn a whole different project type in order to
accomplish that, then it's going to have to wait for some other things I
have to learn.

Thanks.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Mark Rae [MVP] - 11 Feb 2008 17:23 GMT
>> 1) Right-click your web deployment project
>
> I don't know what this means. I have an ASP.NET project. I want an easy
> way to place it on my Web server, preferrably precompiled. So I don't have
> a "web deployment project."

At the risk of repeating myself, Web Deployment Projects are a *separate
add-in* to Visual Studio.NET... The purpose of this separate add-in is to
make the whole business of deploying web projects much easier. One of the
many functions which it supports is the ability to have different web.config
settings for development, testing, production, etc...

Being a separate add-in, if you want to use it you have to download it and
install it:
http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project
-support-released.aspx


There's also an older version for Visual Studio.NET 2005...

See also:
http://blogs.iis.net/msdeploy/archive/2008/01/22/welcome-to-the-web-deployment-t
eam-blog.aspx


Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Jonathan Wood - 11 Feb 2008 18:42 GMT
Mark,

>> I don't know what this means. I have an ASP.NET project. I want an easy
>> way to place it on my Web server, preferrably precompiled. So I don't
[quoted text clipped - 9 lines]
> install it:
> http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project
-support-released.aspx

I will definitely look into this, but this is still a little confusing. We
were discussing the Build|Publish Web Site command. I have that command now.
But now you're saying this is an add-in that I must download. If I have the
command we were discussing, but need to download this "separate add-in",
does that not mean that these are two different things?

Thanks.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Mark Rae [MVP] - 11 Feb 2008 19:00 GMT
> We were discussing the Build|Publish Web Site command.

That's right - the command that was causing you difficulty...

I was merely suggesting that you download and install an add-in to Visual
Studio.NET (written by the same people who write Visual Studio.NET) which
would have solved all your problems for you...

> But now you're saying this is an add-in that I must download.

You don't have to download anything if you don't want to...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Jonathan Wood - 11 Feb 2008 19:32 GMT
Mark,

>> We were discussing the Build|Publish Web Site command.
>
[quoted text clipped - 7 lines]
>
> You don't have to download anything if you don't want to...

I'm sorry that I have been unable to find the words that correctly convey
the point that's causing confusion. Earlier in this thread, you were telling
me about using this command to copy my project to my server. I responded
that the command in question did not appear to have the functionality that I
was asking for. It seems you responded by insisting it had exactly that
functionality. When I went into more detail about why it didn't seem to do
what I needed, you responded with some information that included that I must
download an add-in.

I understand that I do not have to download anything if I don't want to. And
I've already indicated I will research the link just as soon as I get a
moment. What I don't get is what part I missed between you telling me what a
particular command did, and you telling me that I need to download an add-in
to use the functionality being discussed.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Scott Roberts - 11 Feb 2008 17:32 GMT
> Well, as I thought I mentioned, it seems to be missing a bunch of stuff to
> publish the site.
>
> For starters, there doesn't appear to be any place to enter my FTP
> username and password. Second, there doesn't appear to be any place to
> specify which files should be copied, etc.

How many files do you want to exclude? Just the DB and web.config?

Here's what I do:

1. Publish to a local folder.
2. Remove/modify files as needed (try to minimize this, of course).
3. Zip the entire folder.
4. FTP zip file to "sandbox" site.
5. Unzip the file on the server (hopefully your web host gives this ability)
6. Test
7. Copy the exact same zip file to production site.
8. Unzip the file on your production site.

> Am I the only one who needs a different web.config file on my site from
> the one on my development machine? I seriously doubt it but MS seems to
> assume I am.

What, specifically, is different? For me, it's only connection strings,
which I modify manually after the "publish" to a local folder.

> When I attempt to run this command, I get an error that access is denied
> with my database file. That is expected since it is attached to SQL
> Server. But this feature doesn't seem to allow me to do anything about it.

Hmmm, I assume you mean the ".mdf" file? If so, why is it located inside
your web site? I'd say put it somewhere else.
Mark Rae [MVP] - 11 Feb 2008 17:47 GMT
> Here's what I do:

That's precisely what I used to do too - until the Visual Studio.NET team
released the Web Deployment Projects add-in...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Scott Roberts - 11 Feb 2008 17:50 GMT
>> Here's what I do:
>
> That's precisely what I used to do too - until the Visual Studio.NET team
> released the Web Deployment Projects add-in...

Your link is open in another window. I'll check it out. Thanks.
Jonathan Wood - 11 Feb 2008 18:46 GMT
Scott,

>> For starters, there doesn't appear to be any place to enter my FTP
>> username and password. Second, there doesn't appear to be any place to
>> specify which files should be copied, etc.
>
> How many files do you want to exclude? Just the DB and web.config?

I also have a folder that I keep my notes and some working graphics files.

> Here's what I do:
>
[quoted text clipped - 7 lines]
> 7. Copy the exact same zip file to production site.
> 8. Unzip the file on your production site.

I'm not sure if I have the ability to unzip a file on my host server. I'll
check it out though.

>> Am I the only one who needs a different web.config file on my site from
>> the one on my development machine? I seriously doubt it but MS seems to
>> assume I am.
>
> What, specifically, is different? For me, it's only connection strings,
> which I modify manually after the "publish" to a local folder.

There's a few things (some error settings, for example). Does this mean you
have to recreate the settings after every time you publish your site?

>> When I attempt to run this command, I get an error that access is denied
>> with my database file. That is expected since it is attached to SQL
[quoted text clipped - 3 lines]
> Hmmm, I assume you mean the ".mdf" file? If so, why is it located inside
> your web site? I'd say put it somewhere else.

It's been a long road getting the darn thing to work. The next one won't be
in a subfolder like that. I may move it sometime.

Thanks.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Scott Roberts - 11 Feb 2008 19:16 GMT
>> How many files do you want to exclude? Just the DB and web.config?
>
> I also have a folder that I keep my notes and some working graphics files.

Gotcha. Just delete the folder after the "local publish".

>>> Am I the only one who needs a different web.config file on my site from
>>> the one on my development machine? I seriously doubt it but MS seems to
[quoted text clipped - 5 lines]
> There's a few things (some error settings, for example). Does this mean
> you have to recreate the settings after every time you publish your site?

Well, yes and no. I tend to not change my web.config very often so many
times I simply exclude it from the zip file that I upload to the web host.
Since I don't delete existing files first, the new files simply overwrite
the existing ones and the existing web.config remains in-tact. On bigger
changes (where you *do* want to delete existing files) or if you have added
settings to your web.config then yes, you have to modify web.config after
the "local publish".

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.
Jonathan Wood - 11 Feb 2008 19:34 GMT
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.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Mark Rae [MVP] - 11 Feb 2008 23:46 GMT
> 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...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Paul Shapiro - 12 Feb 2008 05:22 GMT
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>

>> If all of this "modify after you publish locally" stuff is too
>> cumbersome, you might consider the add-in recommended by Mark. It appears
[quoted text clipped - 8 lines]
> anything, no deleting extraneous files, no manually modifying (or
> excluding) web.config - all of that is done for you automatically...
Mark Rae [MVP] - 12 Feb 2008 10:38 GMT
> 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/archive/2008/01/28/vs-2008-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
[quoted text clipped - 7 lines]
>    <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...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Paul Shapiro - 12 Feb 2008 19:13 GMT
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

>> Do you let the Web Deployment Project target the web host directly?
>
[quoted text clipped - 36 lines]
>
> Replace MyProject above with the name of your project...
Mark Rae [MVP] - 12 Feb 2008 21:16 GMT
> 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
[quoted text clipped - 4 lines]
> 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

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.