Updating a Web-Site

A

AG

Using VS2005 Pro.
I just deployed a ASP.NET 2.0 website (not web application) with the option
to make it updatable.

VS deployed all aspx, ascx files, but not all image or html files.
It also deployed dll's and .compiled files into the bin folder of the site.

This all looked fine and the site worked except for the missing image, html
and some other third party control support files that I then had to manually
upload.

Is there a way to specify which files should be uploaded when deploying a
website?

How does one update it without re-deploying the entire site again?
I had thought that 'updatable' meant that I would not need to deploy the
entire project again, but when I changed a couple of lines of code, I could
not find a method to update the site other than re-deploying the entire
site. What am I missing?

Is there a way to convert a website project to a web applicatin project?

TIA
 
S

Steven Cheng[MSFT]

Hi AG,

For the "deploy" you mentioned, do you mean you use the "Publish Web Site"
to precompile the ASP.NET 2.0 web application?

The "updatable" means after you precompile and deploy the ASP.NET
application, you can still modify the aspx or ascx template and the ASP.NET
runtime will still perform dynamic compilation against these file(not
completely precompiled). If you choose "nonupdatable", then aspx and ascx
file will contains no html or aspx template(just an empty placeholder).

In addition, if you want to update partial items(or manually specify the
items to update) in the web application before or after deployment, you can
use the "Copy Web Site" feature in VS 2005 IDE, it just act as a FTP client
that can help you synchronize items between your web application and the
target server:

#How to: Copy Web Site Files with the Copy Web Site Tool
http://msdn2.microsoft.com/en-us/library/c95809c0(VS.80).aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

AG

Thanks for the reply Steven.

Yes, by deploy, I mean publish.
I understand what you are saying about updataing the aspx files, but what
about the code?
How do I update the published site if I make code changes? Where do I find
the 'precompiled' code files?

And what about the files that VS did not 'publish'? I had to manually copy
them. Then I found out that if I published the site again, VS deleted all
the files that I had manually copied.

Copy website is of little use because one can't sort on anything. For
instance, if I want to copy only the latest files, I can't sort on date to
pick them. Synchronize is not usefull because it would include code and
other files that are not needed on the published site.

--

AG
Email: discuss at adhdata dot com
 
S

Steven Cheng[MSFT]

Thanks for your reply AG,

For the ASP.NET 2.0 site, if you publish it(perform precompile), no
codebehind file is required (since those code/classes are compiled into
assemblies), and those codefile are not required to deployment on the
target server directory.

Also, for normal static content files such as image, html, based on my
test, as long as they're in the web site project's folder(or sub folder),
they'll be copied to the target directory when performing
precompilation(publish). Have you also tested publishing it to a normal
file folder?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

AG

Thanks for the reply Steven.

I published to a web server via http. Publishing to the file system is not
possible, since I am publishing to a shared commercial web server.
Build > Publish Web Site (allow this precompiled site to be updatable):
All files/folders are NOT copied, even though they are in the project folder
or sub-folder. Some html, xml and some entire folders are NOT copied.

I understand that the code behind is not necessary on the web server as the
code is compiled into assemblies (dll's).
Is there a way to generate those dll's without publishing again.

For example, I might need to change one simple line of code somewhere. I
should not need to publish the entire site again - all aspx, dll's, images,
etc. are replaced on the web server AND the files/folders that I manually
added because the first 'publish' did not copy them - are deleted. Then I
need to copy the missing files/folders again.

Is there a way to generate the dll's, so that I can just publish them,
instead of the entire site. Or do I need to change to a Web Application
Project instead of a Web Site Project?

As a temporary solution, I am publishing to another local machine and then
copying the 'new' site files to the web server via ftp.
That way the files that VS wants to delete are not deleted from the web
server.

It just seems that there should be a better way.
 
S

Steven Cheng[MSFT]

Thanks for your reply AG,

For http based publish, I have also tested it on my side, it seems both
file system or http web based(target directory) can work well, all the
files in the application folder( static files and asp.net specific files )
can be be copied to the target location. I mentioned the "File system"
publish means suggest you try using file system to publish the website to
see whether all the content can be copied correctly, you can also try
publishing to a local (intranet) IIS server, this can help verify whether
the problem is specific to your publish web hoster.

In addition, for updating precompiled assemblies, so far there is no direct
means that can only updated the assemblies(when publishing site). Publish
site will always copy all the contents(necessary), there is no smaller
granularity to control which items to copy(which not). The ASP.NET 2.0/VS
2005 precompilation currently only provide some options to let us control
how to precompile the ASP.NET application(such as precompile the
application into a single assembly or multiple assemblies or naming the
assemblies ....), you can refer to the "Web Deployment Projejct" for more
information.

I think the following approach you used now is the reasonable one. You can
first publish the web site to a local location file system) and upload it
to target host site through FTP approach.

=======================
As a temporary solution, I am publishing to another local machine and then
copying the 'new' site files to the web server via ftp.
That way the files that VS wants to delete are not deleted from the web
server.
============

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

AG

So, basically, for a Web Site project, it is all or nothing?

Despite what it is 'supposed' to do, it does NOT copy all files.
I am using FCK HTML editor (http://www.fckeditor.net/) in my project. It
has many support files and folders of various types.
VS DOES NOT copy all the files/folders, just some.

What if I switch to a Web Application?
If I just change some code in the app, can I then 'build' the project to
generate the dll and then just copy that to the web server like with VS 2003
..NET 1.1?
 
S

Steven Cheng[MSFT]

Hi AG,

Yes, for web site application project, it should treat each item in the
application folder as a member of the project and will publish them(at
least those image, xml , html ... static files will be copied during
publishing).

For the following questions:

What if I switch to a Web Application?
=========================
If you use "Web Application Project", just like vs 2003 web project, you
can choose to include or exclude a item in the project. Thus, you can
control whether you'll include a item for build or deploy the application
project.



If I just change some code in the app, can I then 'build' the project to
generate the dll and then just copy that to the web server like with VS
2003
NET 1.1?
========================
For ASP.NET 2.0/VS 2005 web site project, you can still only update the
assemblies, however, you need to do the precompilation and redeploy those
precompiled assemblies and the "compiled" files (in bin dir).

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Hi AG,

If you have any further question later, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Top