Why 'publish' website produces bin with one dll and build script produces bin with lots of dlls - asp.net

I have made a script that uses the following command...
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
"C:\Repositories\Software\trunk\main\upload\UploadWebsite.csproj"
/p:Configuration=Release
This makes a website pre-compiled the bin directory has lots of dlls in it and tons of .compiled files...
However when I 'right click' on the project in visual studio I am able to 'publish' the website to a folder and this creates a pre-compiled website with only one dll. This is the preferable option im just wondering what the difference between the two is....?

The problem is that for a Website project, the publish feature of Visual Studio compiles everything into one dll, while the normal build operation compiles every page into a seperate DLL.
Maybe these articles can help:
Publishing Web Application with MsBuild
How to publish a web site with MSBuild

Related

TFS build does not have the same output as file system web publish

I normally do a file system publish on my asp web applications before deploying in them on the web root of my web server myself and visual studio packages my aspx pages seperately along with my apis and libraries into DLLs nicely.
I was wondering how to achieve the same effects with Team Build. As of now, I'm able to run build definitions with the default template and the output I'd gotten are just the binaries DLLs without any aspx pages being generated at all
http://postimg.org/image/occoo03zh/
However I'm getting just the DLLs without web pages in Team Build
http://postimg.org/image/mat7co6vp/
I had tried passing various MSBuild Arguments in hopes that it would have changed the output, but no luck thus far. Anyone knows the exact reasons and ways that I can resolve this? Is this output from TFS build normal?
It hasn't been resolved yet, any insights is very much appreciated.
Asp pages are not compiled, your compiled dll's will be outputted to the binaries directory, but your asp pages will be left in the sources directory. you will need to add a post build activity to copy your asp structure into the drop folder.
Can you confirm this by looking in the build workspace (on build server) and seeing if the structure is correct in the sources directory and that the dll's were created in the bin folder. if so you can then copy that whole structure.
You need to pass MSbuild some arguments to get it to generate the published website as you would see it with a file system publish. See here for something similar done with Visual Studio Online.
/p:OutDir=$(build.stagingDirectory) /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true

Compiling VS Publishing a website in Visual Studio

Is there any difference using aspnet_compiler with Web application folder and using Publish from Visual Studio and using 'File System' publish method as publishing method ?
Compiling creates a new DLL of your website in your bin directory.
Publishing will compile your website, run all of the build job items, create an output directory (if required), copy all of the required files to the output directory, minimize your javascript code (when configured to do so), create a database, and much more.

visual studio 2005 compile website

How can I compile website (not web project) using visual studio 2005?
Whenever I compile, those dll for the website app_code is not found in my website bin folder, but instead, in a temporary dll folder (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files).
Is there anyway for me to have the compiled dll in the bin folder?
you can use publish web site feature:
In the publish Properties, check "Use fixed naming and single page assemblies".

ASP.NET Website No Publish Option

I took on a project that was developed by another developer. The client needs a few alterations made to the site so I got the source code and found out it was developed as an ASP.NET Website project (not web application). Looking at the FTP site, each code behind file is complied down to its dll in the bin folder.
I opened up the web site using Web Developer 2012 Express, made the alterations and even successfully debugged the application and everything looks good. The problem is I can not figure out how to publish it! When I build the web site no dlls are generated in the directory structure of the application. Further, there is not Build menu and thus no Build > Publish option to publish the website.
I've build and deployed major applications using APS.NET MVC but I can't for the life of me figure out how to deploy this simple website project as no dlls are being created.
How does one publish or deploy a website project with no Build > Publish option and no dlls created when Building?
I think it's a visual studio express thing. I don't have the build menu here at home on express but at work it shows up fine on projects.
Have you tried right-clicking on the site in Solution Explorer and observing any possible Publish Site options there?
Failing that, you might try copying the files directly to the site's root folder on the webserver.

How to build silverlight website & create XAP's using script?

I am just getting started with Silverlight and have recently added a Silverlight project to an established solution. In this particular scenario my solution included an existing ASP.NET web site which Visual Studio kindly offered to integrated my Silverlight application into, which I accepted.
So everything is fine and all, and the Silverlight XAP is being copied to the web site's ClientBin directory when i was buiding solution through visual studio, But
I want same thing through using nant script when i am used nant script that time all project in the solution are build but recenty added silverlight website do not create XAP's in ClientBin dierctory.
I m using following script :-
target name="build" description="compiles the source code">
exec program="${framework::get-framework-directory(framework::get-target-framework())}
\msbuild.exe" commandline="MY.sln" workingdir="ProjectFolder" />
what are the ways ??
You could reverse-engineer the MsBuild scripts used to build Silverlight apps and .Xap files, the files will be located in:
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v3.0
Your msbuild compilation should be creating the XAP file in the Bin\Debug folder of the silverlight project. You can simply use the Nant copy task to move it to the Web project's ClientBin folder.

Resources