Build ASP.NET Web Site App_Licenses.dll on command line - asp.net

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?

Related

.NET Core 31 - Single EXE - The application to execute does not exist

Converted an old .NET Framework project to .NET Core 3.1 yesterday. The application runs fine on my own machine and debugs correctly.
I have put both the following into my .vbproj/.csproj
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win81-x64</RuntimeIdentifier>
However when I move the .EXE to a remote machine and attempt to run said EXE on that remote machine I get told that the DLL (for the project in question) does not exists.
I moved the .dll to the same directory that the exe is in (not ideal) and get the following error instead
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
I used to use Costura.Fody to create a single file exe without any issues in .NET Framework, I was under the impression the above would do the same for the .NET Core packages.
Can someone point me in the right direction please.
For anyone else that may find this question and find it useless.
I was 'Building' the project instead of 'Publishing' the project, this in-turn wasn't creating the self-contained exe properly.
Don't be a donut like me.
In Visual Studio 2019, go to Build > Publish MyApp. This will open a tab in the editor area. Click on Show all settings to open the Profile settings dialog. Then click on File publish options and check Produce single file.

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

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.

How can I add or rename files in Visual Studio while the project is running?

How can I add or rename files in Visual Studio while the project is running?
I am currently developing a ASP.NET 5 web application and I continuously need new TypeScript files or html files. It is a pain to always have to stop and start the project again.
I have a gulp watcher running that copies all html changes and compiles all TypeScript files into one app.js towards wwwroot.
You can do this, you just need run through a few steps first.
Run your local site but bypass debug mode (CTRL + F5). Debug mode requires recompilation to pickup file modifications since the debugger isn't attached to the process.
Install dnx-watch by running this command dnu commands install Microsoft.Dnx.Watcher. This will add file change monitoring to your project. This is new as of beta8, you can read about it here.

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.

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