How to run ASP.NET MVC app using MSBuild command line - asp.net

How do I compile and run an ASP.NET MVC app using nothing other than the MSBuild command line? My Visual Studio is super slow and I just want to be able to run an app quickly for bugfixes and showcasing etc. Is this possible? What's the command line for it?

MSBuild is for building your application. If you want to run your app outside of Visual Studio, you need a web server for it. I'd recommend you to publish your app on local IIS. Just point your IIS website to your Web project folder. After that you will be able to access your application from the browser without running it from Visual Studio.
You can build your project from command line. Use msbuild.exe utility for it:
msbuild.exe projectname
You can find it in one of your .NET Framework folders (I recommend you to use the latest one):
C:\Windows\Microsoft.Net\Framework\v2.0.50727\MSBuild.exe
C:\Windows\Microsoft.Net\Framework\v3.5\MSBuild.exe
C:\Windows\Microsoft.Net\Framework\v4.0.30319\MSBuild.exe
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\MSBuild.exe
C:\Windows\Microsoft.Net\Framework64\v3.5\MSBuild.exe
C:\Windows\Microsoft.Net\Framework64\v4.0.30319\MSBuild.exe
When IIS is set up, you can build your app and see changes in your browser. Visual Studio is not necessary at this point.
Instead of IIS you can use IIS Express. Here is an article of how to run application on IIS Express from command line.

Related

How to create an exe out of ASP.NET project

I need to create an .exe or find a way to run my project in other computer witch i don't have and i cant install Visual Studio. Is there a way to make this possible? Btw I'm using Visual Studio 2013. Thanks anyway.
You don't need visual studio to simply run an ASP.NET project, you can publish it to any machine that has the .NET runtime and a suitable web server.

How to package and deploy asp.net web application

I am currently working on automating the build and deploy of an asp.net web application which is developed using vb.net in visual studio. Currently, developers are building the solution and projects using visual studio IDE. In the solution, they have deployment/setup projects (vdproj) for each environment (e.g.: app.setup.dev, app.setup.uat, app.setup.prof) which creates msi for the deployment and the web.config is embedded on it.
We are using github for scm, jenkinsfor build/CI and udeploy for deployment.
I am able to build the solution using msbuild cli thru jenkins. However, vdproj cannot be built using msbuild. Alternatively, I installed Visual Studio and MS VS Installer Projects Extensions in my build server, then build the vdproj using devenv. I am not sure if that is a correct way, maybe it is just a workaround.
What is the appropriate way to package the deployment artifacts (contents files, dlls, web.config) and deploy them? And How? If there’s another way to do it rather than creating MSI, it would be great as I don’t have to get a license for the Visual Studio in my build server.
I am currently working on automating the build and deploy of an
asp.net web application which is developed using vb.net in visual
studio.
Maybe you can try publish asp.net web-app by msbuild command-line.
1.As far as I know, we can build and deploy by Visual Studio, see this document.
2.And without VS, you can build and deploy(publish?) by msbuild command-line, there are many resources about this topic.
See:
How to deploy an ASP.NET MVC application on build using MSBuild in Visual Studio 2015?.
How to build and deploy a web deployment package using MSBuild
Using MSBuild.exe to “Publish” a ASP.NET MVC 4 project with the cmd line
In this way, you can get similar function by specifying the parameters and don't need to have VS installed in the server.
What is the appropriate way to package the deployment artifacts
(contents files, dlls, web.config) and deploy them?
Do you have to package them into .msi or .zip and then publish it. If not, simple msbuild command like: msbuild xxx.sln /p:WebPublishMethod=xxx /p:PublishProfile=xxx is enough.
Not certainly sure if it's what you want, hope it helps.

Running MVC 5 website without iis or visual studio

I created a website using visual studio 2015 with MVC 5.
The website should run locally using local databse.
The problem is, I want to run this website as program, without need to install iis or visual studio to run it..
What can I do?
ASP.NET MVC is a website and not a program as such. It therefore requires IIS to run. You don't need Visual Studio however.
If you want a stand-alone executable, you need to use a different UI paradigm. Console, Winforms or Universal Windows App to name just three.
Your option is to migrate to dotnet Core which can host web application as a Windows service, or just a Console App. You dont need Visial Studio to host it at all.

Debugging and rebuilding a .net core web app

How do I actually run the debugger with a .net core web app using visual studio along side the dotnet watch tool?
I am using the dot net watch tool which greats work and picks up changes, however if I try to attach the debugger, the code doesn't match with what's compiled. So I have to ctrl-c and stop the hosted app, rebuild and rerun donet run and reattach the app to the dotnet process. Surely this can't be the workflow of .net core developers?

build ASP.Net default web site error

I am using VSTS 2008 and I am using Create new ASP.Net web site and using default settings/automatically generated files.
My questions are,
How to use command line script (msbuild) to build the ASP.Net web site automatically?
I want to build the web site into a DLL which could be easily copied to target IIS server later.
Any samples or quick answer how to do these tasks in msbuild?
EDIT1: There is no sln and csproj file in the web site folder. Here is the link.
http://tinypic.com/view.php?pic=dra5jp&s=5
Here is how I create in VSTS 2008.
http://i40.tinypic.com/208zfxv.jpg
I use VS.NET 2005 and using this command to build my asp.net web application in release mode :
cd "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\"
MSBuild "C:\Projects\MyProject.csproj" /t:Rebuild /p:Configuration=Release /verbosity:quiet /p:WarningLevel=0
"Web Applications" have .csproj files, "Web Sites" do not. http://damieng.com/blog/2008/02/07/web-site-vs-web-application
You want to compile it with aspnet_compiler.exe in the bin directory C:\windows\framework\version
http://msdn.microsoft.com/en-us/library/ms178466.aspx
Easier way is to use deployment projects or the "Publish Web Site" command in Visual Studio. (Right Click on website)
http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project-support-released.aspx

Resources