Compiling VS Publishing a website in Visual Studio - asp.net

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.

Related

Visual Studio Copy the Project to an external drive

I had done a project by using ASP.NET MVC. How do I copy and paste the project to an external drive. I have to submit my project as coursework yet they request to copy the entire project to a CD/VCD.
The problem is when I copy & paste the project into a CD, it can't run properly with loads of errors. How do I do this in the cleanest way possible?
Snippet:
Here's the warning message.
You can delete .vs folder. Visual Studio will recreate it, when you open the project.
The main issue is Visual Studio cannot read and write to CD. However, you can copy the project into USB Flash Drive, and open the project straight from it.
Starting from Visual Studio 2012, Microsoft uses IIS Express by default to host ASP.NET applications, which relies on a file applicationHost.config to store the site information.
The design of applicationHost.config, means a physical path to your project directory is hard coded which prevents this project from running if you simply copy the project to another location on another machine without updating applicationHost.config. What's worse, starting from VS2015 this applicationHost.config lives in .vs folder inside your project directory, which can be copied to other machines by mistake.
Read my blog post to understand the technical details if you like,
https://blog.lextudio.com/jexus-manager-secrets-behind-visual-studio-iis-express-integration-834f88c8e8b

Build ASP.NET Web Site App_Licenses.dll on command line

Our ASP.NET web site projects are built and published automatically by Jenkins - but no App_Licenses.dll file is generated from the licenses.licx file.
On my dev build this file is generated fine - is there any way I can find out what command line Visual Studio is using to build the file so I can add this to the build process?
Or does anyone know how to configure the right target for MSBuild to generate this file as part of the build?

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".

MVC: Visual Studio Publish Web dialog cannot find my application's Views

I am using these steps to publish my ASP.NET MVC 4 application using Visual Studio 2010 on IIS 7.5 running on a 64-bit Windows 7 Professional machine.
When I click the Publish button on the wizard after entering the values, it reports a single error that reads:
Copying file Views\Shared\Error.cshtml
to obj\Debug\Package\PackageTmp\Views\Shared\Error.cshtml failed.
Could not find file 'Views\Shared\Error.cshtml'.
I looked into the target folder where the wizard dumps the necessary files that will be needed to deploy the application. It turns out that the folder had the Views folder which had only the _ViewStart.cshtml of the root Views folder, but no other View. My application has at least 20 views, perhaps more.
I realized that it was my fault. The local copy of my project had the file Error.cshtml in the Views\Shared folder. However, the TFS copy of the project file did not. Apparently, the file had been excluded from the project at some stage.
I excluded the file from my project locally and ran the build and it worked.
In my case the problem was that the file was in the solution but didn't actually exist on the local file system.
For me, this problem occurred when I moved a file (via explorer) from the shared folder to another folder.
I added the file in visual studio, but did not "delete" the file from the shared folder (as far as visual studio was concerned).
For some reason, visual studio did not put a little flag or warning sign to tell me the expected file was missing (even after a refresh), so I didn't notice (although trying to open the missing file revealed the problem).
The error message is clear, and self explanatory. I just couldn't understand it for some reason.

Why 'publish' website produces bin with one dll and build script produces bin with lots of dlls

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

Resources