Can we do a file system publish of ASP.NET projects using Powershell? - asp.net

I use IIS Manager 6.1 to run my virtual Website.
I want to Publish my website and generate dlls using powershell script.
Is it possible?

Related

Deploy ASP.NET Core Razor page to Azure App Service

I'm trying to host a ASP.NET Core RazorPages project in Azure App Service.
As an example I've created a new project and that's the app I want to publish.
At first: the publish function from VS2019 (CE) failed with an exception. It is a common exception and I'm not investigate more time in in.
So I thought: I publish it using the portal. So i have a Free account of Azure, create a Resource Group, a Hosting Plan and a Web App. Then i've upload my website using OneDrive and that works.
I've add the ASP.NET Core 3.1 (x86) Runtime to the extensions and the stack is .NET Core (32 bit, because of free plan). I've build the app also for x86.
But the application doesn't work. When I add a default Index.html to the application it works (but not the Razor Pages).
Who can solve this problem??
Regards
Donovan
Looks like you copied too many files to your App Service. The bin/debug and/or bin/release folders should not be there. You need to prepare the website for deployment. In Visual Studio, you can do so by doing a right-click on the ASP.NET project and selecting 'Publish'. On the page that opens, configure a local publish to a folder. The contents of that folder should then be copied to the App Service.
For more information, see Deploy an app to a local folder using Visual Studio.
Also interesting: Host and deploy ASP.NET Core
The dotnet publish command compiles app code and copies the files required to run the app into a publish folder. When deploying from Visual Studio, the dotnet publish step occurs automatically before the files are copied to the deployment destination.
Folder contents
The publish folder contains one or more app assembly files, dependencies, and optionally the .NET runtime.
A .NET Core app can be published as self-contained deployment or framework-dependent deployment. If the app is self-contained, the assembly files that contain the .NET runtime are included in the publish folder. If the app is framework-dependent, the .NET runtime files aren't included because the app has a reference to a version of .NET that's installed on the server. The default deployment model is framework-dependent. For more information, see .NET Core application deployment.
In addition to .exe and .dll files, the publish folder for an ASP.NET Core app typically contains configuration files, static assets, and MVC views. For more information, see ASP.NET Core directory structure.

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.

What are the steps to host an asp.net 3.5 published website in iis 6.0?

What are the steps to host an asp.net 3.5 published website in iis 6.0? Any suggestion...
Create a virtual directory in IIS, then use Visual Studio's Publish wizard to publish the site.
Make sure server has microsoft .net framework 3.5 (with sp1 recommended) runtime installed. Use web deployment projects for deploying your asp.net application in single output assembly or use web publishing wizard for extract a release build. Make sure the build does not use debug configuration and it must be in release mode. Create a website or virtual diretory and configure it to run under asp.net 2.0. You will also need to define under which application pool the application shall run, it could be shared or isolated one. Copy your asp.net build to the root directory of the website or the virtual directory and you're good to go..

How to set the IIS File Security to Integrated Windows authentication with a Web Setup Project installer?

I wrote an ASP.NET web application with an installer. For the installer, I'm using the Web Setup Project under the Setup and Deployment project types in Visual Studio 2008.
How do I set the IIS File Security to Integrated Windows Authentication on only one .aspx page or directory during the installation process using a Web Setup Project? If it is not possible with the Web Setup Project how would I automate that task?
Currently I'm installing the application with the installer and manually setting the security permissions.
Look at the CustomAction Class for the Install Method.
Here's a sample:
http://www.codeproject.com/KB/install/SetIISettings.aspx

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