Visual Studio 2010 - Partially Publish Web Site? - asp.net

I just completed a website that is image heavy and I'm publishing the site to an FTP server. The publish time takes ~5 minutes. Is there a way for me to configure which file types get published? I'd like to push out changes only if the file extention is: (.config, .aspx, .cs, .asmx, .js, .html, .css, .master).
Is this possible?

No, the publish process publishes the whole website.
Publish it on your local computer first and then use an FTP tool (Filezilla, CoreFTP...) to selectively upload your files to the server.

Unfortunately No, it is not possible. Publish operation is either-all-or-none operation.
Even though, I sometimes only copy the DLL assembly (from bin directory to IIS website folder) if the change is only in the code-behind files and the markup/images/other-content have no changes.

you can set the Build Action for whatever you don't want published to None
These won't get copied to the deployment directory
I have just confirmed that it works (I tested on a MVC3 site)
so you'll have to change the setting for each file you want to exclude but you can change the setting of multiple at one time and folders can't be excluded

Related

ASP.net This is a marker file generated by the precompilation tool, and should not be deleted

I am currently getting this when visiting my http:// websitehere.com/excelData.aspx page:
This is a marker file generated by the precompilation tool, and should not be deleted!
The file system directory on the server looks like this:
--mainDir
|--excelData.aspx
|--PrecompiledApp.config
|--Web.config
|--bin
|--App_Web_cuydkh1j.dll
|--exceldata.aspx.cdcab7d2.compiled
Not sure what I need to add/remove in order for it to display my page without that precompilation tool text on it.
The IIS server is version 6.1
One of the reasons for this problem is the file PrecompiledApp.config is missing from the root of your site (this file is generated by the publishing wizard).
Hope this help others.
Problem:
When you upload the web application, sometimes the most important files in the bin folder (e.g., the .dll files) will not upload correctly.
Solution:
Re-upload the bin folder. Remember to overwrite.
Make sure the site is configured as an application on IIS

Changes not working after deploying

I have made some changes to .cs file and copied the file into server where web application is hosted. But the changes I did are not reflecting. Please suggest a solution.
I tried copying .cs file alone also copied entire application files.
Did IISRESET and app pool recycle as well. But nothing works.
Most of the time when you're dealing with .cs files, you need to compile and copy the results of your build to the webserver. A combination of the .aspx/.cshtml files and bin directory including the .dll files
Here is a procedure that you can follow.
Create the app_offline.htm file on the root of your site, so the site will be off
Upload the updated files.
Now when you upload your files, if you have an Updated DLL, for your bin all is ok. You can even copy at least one dll on the bin, even if its not updated.
If you do not have that, update the web.config even with an empty line on the end, to give a signal to the site that needs some update.
Rename/remove the app_offline.htm from root and make the site online again

way to excluding static folders like Images in publish website feature in Visual Studio 2010

In my website when deploying production most of the time I only need to deploy bin folder and just marker files if new pages added.Since my website contains gigabytes of images folder and static stuff not updates frequently, it takes ages to complete a one publish cycle in visual studio website publish feature is there workaround to overcome like excluding these static folders when website publishing
Thanks...
You could use the Web Site Copy Tool - deploying a web site using this tool only updates the files that have been changed.
After you connect to the remote site, each file will have one of the following statuses.
Unchanged
The file has not changed since the last time the file was copied.
Changed
The file has a timestamp that is newer than the timestamp taken when the file was last copied. If the same file has been changed in both the source site and the remote site and you synchronize these files, the tool prompts you to indicate in which direction you want to copy.
New
The file has been added since the last time the site was copied.
Deleted
The file has been removed since the last time the site was copied. These files are shown only if you select Show Deleted Files. If you synchronize a file that has been deleted in one site, the tool will prompt you to indicate if you want to delete the file from the other site.
See this article for further information
I don't know if there is another way. But if you make the folder hidden in the file system, then it would not be published.

Can you precompile and merge part of an ASP.NET website and then continue development?

A big part of the web site is precompiled and merged, since it's almost never going to change. The precompiled bits can be replaced in case of updates to the original. I want to continue development of new pages, but when I browse to a new page I get the following error:
The file '/Website/Test/Default.aspx'
has not been pre-compiled, and cannot
be requested.
Is there any way around this?
Edit:
If I remove the precompileApp.config file I get the contents of the marker files when I browse them:
This is a marker file generated by the precompilation tool, and should not be deleted!
Have you looked at the precompile with updatable UI option? This compiles all the source code and resources into a DLL but allows you to continue making changes to your .aspx pages after deployment.
Another option could be to precompile the website in place on the server instead of precompiling it then deploying it to the webserver.
Both options are addressed in this MSDN article:
http://msdn.microsoft.com/en-us/library/bb398860.aspx

How do you update an ASP.NET web application?

Simple question. If you have a compiled and published ASP.NET web application running on a server and you need to update, say, a line in one of the codebehind files. Do you shut down the entire site, republish, then load the site back up? Or do you publish straight to your live site with users still using it?
For myself, place an app.offline app_offline.htm file into the site, then overwrite the entire website with the latest published build.
there are a few options when building a site -> one dll for the site or one per page. if u just updated one line in a code behind, and you have chosen the build option for one per page, then you can just copy/paste that new page dll.
i don't like that method personally. I find it simple to app_offline.htm the site.
If it is a single file and a simple site that uses that app_code folder to store the code behinds, I simply xcopy up the new files. If I use http expiration headers I may need to do some better scheduling to make sure things like javascript files and css sheets match the rest of the site that was updated.
For emergency patches:
If its just a codebehind file, I copy the entire /bin/ out and replace all DLL's (mostly out of habit)
If its an aspx, I just copy the aspx.
For actual deployments, I have an automated system that checks out the code from source control, builds a clean release build, takes the site offline, and then robocopies it out to the deployment target. Its a one click process (Thanks CruiseControl!).

Resources