How to start a released Asp.net Core project? - asp.net-core

I'm an asp.net developer and recently trying to archive asp.net-core.
Since it's quite new, I would like to ask, how do you launch a asp.net-core project in a Windows machine?
For normal asp.net, my approach is publishing the project using Visual Studio, bring everything to a Windows machine, use IIS to create a website and point the directory to my physical file.
How about a website that created by asp.net-core?
Do I need to install asp.net-core in server machine? (i don't prefer this)
What should I do with the published file? There are two folders generated after publishing the project:
netcoreapp1.0
PublishOutput

Well, you still can use the file system mechanism to publish an ASP.NET Core project from Visual Studio. But VS uses the dotnet CLI under the hood to do the same stuff. Usually you configure your deployment depending upon your hosting environment such as Windows Server and Linux Server.
For Windows Server
You have to install ASP.NET Core Module in order to publish on IIS successfully. This will also install .NET Core SDK. You can than have the advantages of SSL Terminations and others provided by IIS on Windows Server.
For Linux
You have to use the .NET Core SDK here as well for a published app to acquire the .NET Core runtime (This is why you get those 2 folders). You use Nginx or HAProxy to get all SSL Terminations, Port-Forwarding etc.

Related

IIS + ASP.NET Core 6 + Hosting Pack resulting in default document/directory listing error

I'm attempting to get IIS to serve our ASP.NET 6 web application, but every time it complains of needing a default document. If I run the exe (kestrel) one it will serve it, but we want it to be hosted by IIS with the other components of the site.
I installed the 6.0.10 runtime w/ hosting package and these are the results when listing runtimes:
When looking at the site modules, I think it should have what is needed (think the AspNetCoreModuleV2 one handles the compiled routing scenario?):
Have rebooted the server and the app pool specifically, set to No Managed Code, and whenever I attempt to load the page at the localhost level, I get:
The views are compiled so I don't think I even need IIS to open views locally in any capacity.
Everything you've posted ticks off the major deployment steps for hosting a .NET 6 project on IIS:
Installed the .NET Core 6.0 Runtime Windows Hosting Bundle
Set up the IIS app pool with "No Managed Code"
Rebooted the server: "Have you turned it off and on again?"
After our exchange in the comments, the only thing that appeared to be missing is to use the .NET publish command; not the build command.
When deploying to IIS, you'll want to run the dotnet publish command and then deploy those artifacts to your IIS server. From the docs:
The dotnet publish command's output is ready for deployment to a hosting system (for example, a server, PC, Mac, laptop) for execution. It's the only officially supported way to prepare the application for deployment. Depending on the type of deployment that the project specifies, the hosting system may or may not have the .NET shared runtime installed on it.
You also may want to review: Publish .NET apps with the .NET CLI.

Deploy website to IIS from linux build agent

Problem description
I have a jenkins master that uses a linux build agent to build my ASP.NET Core websites using official MS linux docker containers.
I previously used a windows VM with the necessary tooling installed to build these projects and used MSDeploy.exe to deploy the sites to an IIS webserver. For this deployment I created a web package.
In my linux docker container I obviously can't use MSDeploy.exe.
Question
How can I savely deploy an ASP.NET Core website to an IIS webserver from a linux docker container?
MSDeploy.exe connects to the IIS using a local IIS Users credentials, shutsdown the app, replaces all files that are also present in the new package, so it not just replaces the files but also does some safety settings around the actual replacement.
Misc
I've found this question here, but unfortunately no real answer was found there.
Thanks in advance

How to run a .Net Core webapplication on a Windows 7 machine?

I want to run a ASP.Net Core webapplication on a Windows 7 machine without having to install Visual Studio.
Can I just install .Net Core on the production environment or are there some preconditions that have to be met prior to installing .Net Core?
I tried out some scenarios and I found out the following:
For running .Net Core you only need the .Net Core runtime (or the SDK) installed on the production environment. You can find the downloads here: https://github.com/dotnet/core/blob/master/release-notes/download-archive.md
For ASP.Net Core, which uses Kestrel for hosting, you only need the runtime (or the SDK) as well. (I tested this on Windows 7 and Linux Debian)
When hosting with IIS, see Andre.Santarosa answer
Prior to run .NET Core on windows 7, your system must have SP1 and Hotfix KB2533623 insalled, install IIS package via Control Panel then DotNetCore WindowsHosting (this allow IIS to handle ASP.NET Core requests) - Link: https://go.microsoft.com/fwlink/?LinkID=827547
When you create your IIS application, it will create an application pool, set .NET CLR in this pool to "No Managed Code".
This should be enough you to run

Do i need to install asp.net mvc4 on iis server

I am going to deploy my application tomorrow ,so i have few questions.I want to deploy asp.net mvc4 application on 2003 server where .net framework 4.0 is installed.My question is do i need to install asp.net mvc4 also there.Or if i copy the dll responsible for mvc in to that system is sufficient?
another question is i am using entityframework and oracle database so using ODP.NET, if this is the case do i need to install ODP.NET over there or just copying DLL system.dataaccess dll is sufficient?
Rest all i follow this two links will it work
The two links are http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx/
How to deploy MVC application in 2003 server IIS
UPDATE
today i tried and unfortunately i came to know that the framework which i was running .net 4.5 will not be supported in 2003.I made my project in to .net 4.0 and everything working fine in local system,but remote system lot of errors are coming.Method not found etc. I came to know that i have to degrade EF 5.0 to 4.4 i did it like replaced dll and changed one line begin with section but no luck as of now.I have to change somewhere else also.Do you know any proper mechanism which i need to carry forward for this?
No need to install anything explicitly except .Net 4.0. All you need is make sure that all dependencies (assemblies) of your application i.e. MVC, ODP.Net etc are present in bin directory of your application. Also make sure that ASP.Net v4.0 Web service extension is enabled in IIS.
Steps to enable web service extension.
Open IIS 6.0 Manager
Click Web Service Extensions
Enable ASP.NET 4.0
Check below screenshot.

How do I manually deploy a .NET MVC app to AWS via Elastic Beanstalk

I'm trying to deploy a simple Hello World ASP.NET MVC 4 app to an free tier EC2 instance using elastic beanstalk. I'm using Visual Web Developer Express (2010) which doesn't support the AWS Toolkit extensions, so how do I deploy the site without the extension?
It seems that with the Elastic Beanstalk web console, you can upload a file as a new applicaiton. But I can't figure out what's supposed to be in the file. Is it a zip containing a published mvc app? I tried that, and when navigating to the instance after it loaded it just displayed the IIS 8 logo. There's a sample zip on a walkthrough page, but it's an old ASP.NET page with 3 xml files in the root. I have no idea what to change in those files for MVC, .NET 4, Server 2012, or IIS 8. I can't find this information anywhere.
I tried creating some EC2 instances manually, remoting in and deploying the site myself. However the free Windows Server 2008 images don't have .NET 4. And the free Windows Server 2012 image doesn't have IIS... I couldn't figure out how to actually deploy my site.
The command line tool that's called by the AWS Toolkit extension can be used manually. Here is the documentation I found on deploying using this tool.
You have to publish your site as a Web Deploy Package in Visual Studio. Then use the tool located in Windows by default at
C:\Program Files (x86)\AWS Tools\Deployment Tool>awsdeploy.exe
You have to pass it a text file that contains the deployment configuration. There's a template for the file at
C:\Program Files (x86)\AWS Tools\Deployment Tool\Samples\ElasticBeanstalkDeploymentSample.txt
The first time I used the tool, deploying the package archive generated by Visual Studio, I still got the plain IIS 8 landing page. However, when I did an incremental deployment, which is done via an extracted version of the archive being pushed to the server, it worked fine.