Publishing an asp.net web application - asp.net

I want to know a few things about Publishing an asp.net web application,
Why should i publish my web application?
What are the advantages of publishing a web application?

1- if you want to crypt your configuration settings you should publish. http://msdn.microsoft.com/en-us/library/53tyfkaw%28VS.80%29.aspx
2- first if you just copy your web site to your IIS it will compile first then starts serving. publishing wins that compile time. second if you want to send just dlls to your server it will be easier to deploy.
my personal opinion if you are the only developer on the project and you may need to change stuff on an editor like notepad and deploy ASAP then dont do it.
but if you have a big team and timeline and deploy is a one of a big issue for project. you need to do that to keep track.

You should use web application because of the advantages of Web application. :-)
I think web application has some advantages:
Web application will be compiled before published, so the code will be checked by compiler.
One web application(project) has only one DLL file.

use dll file and not use source code
can encrypt file

Related

Is it possible to precompile an ASP.NET Web Forms Project on a build server?

ASP.NET Web Forms apps have a large startup cost on the first request as they need to compile the views code (.ascx, .aspx, etc). We have to deploy these projects to several servers, which requires priming each of them so that the first users to hit certain areas of the site don't have a bad response time. Today this is a manual process, and we're making it automated by running aspnet_compiler.
Is is possible to run aspnet_compiler on the build server and deploy its output so that we do not have to run it on each web server we're deploying to?
Bonus Question: When we specify a target directory with the targetdir option in aspnet_compiler, how does IIS know where to look for the compiled files? i.e. Where is that information stored?
The project in question is a Web Application project (not a Web Site project).
There is an option in Visual Studio's Publish dialogue which may be what you want.
I've not used it to see if it actually has the effect you want, but there's several options in Configure for it. You may be able to do what you want with that.
(P.S.: This is an ASP.NET Web Forms Project as well, in VB.NET. Though the language is irrelevant.)
Also, according to this MSDN article you can add the -u and -v switches to the aspnet_compiler to get it to precompile the views for updating.
You may also want to look at this MSDN article as well, as it describes a scenario similar to yours. Especially the Compiling an Application for Deployment section, which states:
You compile an application for deployment (compilation to a target location) by specifying the targetDir parameter. The targetDir can be the final location for the Web application, or the compiled application can be further deployed.
Essentially, you might be able to run this command on your build server, and then distribute your binaries as needed.

Deploying a Visual Studio website vs web application

So I'm using visual studio 2010 to build a website that was formerly running on PHP, so I'm pretty new to the environment.
In starting the project I built a website project, not a web application project. I know that will probably generate a lot of "never use a website project, use a web application project instead" comments, but bear with me.
I'm attempting to provide our server team with the necessary files to compile on our server for the first time. However they're used to working with web application files, not website files.
Normally they are given the source code and a batch file that compiles the code into deployment directories and then they just move the files to the server from there. I'm pretty sure that the other teams use deployment packages to do this, which obviously isn't an option for a website.
My question is, what would be the equivalent steps for getting the source for a website ready to deploy vs a web application? I have published the website to a separate folder and this has rendered what I think is the equivalent in many ways, but I wanted to make sure.
Also, is it possible to publish certain parts of a website without others?
Please with-hold all the comments about how I should be using a web application instead, google seems to assume that's all that's used out there too.
Thanks!
There isn't much to deploying a web site other than copying the source files to a directory in IIS. It will compile the site automatically on the first page request.
I agree with Britton. I personally prefer web application but with the web site project you have 2 options.
Either a) Upload all the files (including the .vb or .cs files) and the web server will compile on the fly. OR, you can publish to a separate folder locally on your machine, and then upload that folder. I would do the publish if you don't want anyone seeing your source code.

How to deploy an ASP.NET web site

I have an ASP.Net website that I built in a computer science class. I built it in Visual Studio and the solution is on my local drive. How would I deploy this to a real website?
You will need to do a few things.
You will need to get a hosting account that supports ASP.NET
From there you can use the "Publish" option from within Visual Studio under the "Build" menu option to push out a copy of the site.
When publishing you should publish in release mode.
Get hosting that supports the version of .NET and ASP.NET you have used and copy the files over.
Assuming that already you have an IIS application and web folder set up on a web server somewhere, the simplest method goes like this:
In Visual Studio, right-click on the web application project, and click Publish.
Select File System as the publish method.
Select a target location. This is where the publishable files will be placed. Use c:\pub or something similar.
Hit Publish
Once the publish operation is done, copy everything in c:\pub (or whatever target folder you used in step 3) to your web folder on the web server. Depending on your server accessibility, you may need to do this via FTP.
You might also investigate ClickOnce Deployment if your server supports it.
If you don't already have server space, you'll need to find a good hosting provider that supports ASP.NET. Google has many suggestions.

Distribute ASP.net Application

I have an ASP.NET application and i selling it to different companies. I change the application settings according to the company information and publish the whole application to a output folder. And then take the output folder to clients machine with necessary dlls(My application dll and few third party dlls). I am wondering if it is possible for anyone to decompile the code from the dll's in bin folder and get the application code? Is there any standard process i need to follow so the my code are safe in client server.
You would need to obfuscate the dlls created for your project, but there are some issues with that related to ASP.NET. See this stackoverflow post
Enjoy!
Yes.... And see other answers for how to avoid it.
You can also try Redgate's SmartAssembly
Rather than Xcopy deploy, you should look have a look at web deployment projects for your deployment - http://msdn.microsoft.com/en-us/magazine/cc163448.aspx.
If you need to protect your assemblies from reverse engineering, you need to look at an obfuscator like http://www.preemptive.com/products/dotfuscator/overview

How can I ensure that my web pages are not modified by end customer?

I want to lock down my website so that the end customer cannot change the standard web pages(aspx). I have investigated code signing and digital certificates. But that is more suited for the dlls and executables, and not to the aspx/html pages themselves. Is this possible? If so, please provide me some links.
Thanks,
Murali
You can precompile your ASP.NET application.
"When you precompile an ASP.NET Web site for deployment you create a layout containing assemblies and other information that you can then copy to a production server. A Web site that is precompiled for deployment gives you the ability to create a compiled version of the site that can be deployed to a production server without source code."
http://msdn.microsoft.com/en-us/library/ms227976.aspx
Have you looked into providing your application as Software as a Service (Saas)?

Resources