How to run Orchard Core with IIS - c#

How do I run Orchard Core in IIS on my local machine. I am able to run the site by using dotnet run, but every time I create a new site in IIS with the physical path OrchardCore\src\OrchardCore.Cms.Web, I get a 403 error. I added IIS in the security tab and gave it full permission but I am not sure how to continue.

Hey to run your site in IIS you'll need to do the following
Install .NET Core hosting bundle on the server.
Run the following in an elevated terminal net stop was /y (stops IIS).
Run the following in an elevated terminal net start w3svc (start IIS).
Run dotnet publish --configuration Release in your project root.
Copy the output bin/Release/{TARGET FRAMEWORK}/publish to you IIS physical path.
Official docs are here. If you need more help, there are also different ways of hosting .net core apps, In-process vs Out-of-process hosting.

Related

Server Error 403 Forbidden on Blazor server app published to Linux hosting

I want to deploy a Hello World Blazor Server App created with the Blazor App Source Template 3.1.11 in VS2019 C#
The app is created in VS2019 on Windows 10
The docs show how to create the /bin/Release/{TARGET FRAMEWORK}/publish folder
I copied the files here to the domain folder in my hosting package, but do not know the next step.
web.config is for windows hosting.
What do I need to do for Linux?
At the moment I get a 403 error if I go to the site.
I can publish the app to a windows hosted site.
[Update]
It turns out that the Linux server does not have DotNet installed.
By default, dotnet publish publishes the entire application for running on the current operating system. When that does not match where you intend to run the application you can specify the runtime to publish for with -r|--runtime.
Something like this should work: dotnet publish -r linux-x64
A 403 error would lie somewhere in the IIS/web server configuration. Look at the config file or the IIS settings.

How to run .Net MVC in IIS (vs using `dotnet run` for testing locally)

So this is a C#-based .Net WebApp for a client on an Azure deployment on their network.
Testing locally, I can do dotnet run and test on http://localhost:5000 fine, but in the final environment, it'll need to be served by IIS. I believe dotnet run (Kestrel) and IIS have a way of talking to each other (there is a method called something like .useIISIntegration I believe).
But I'd like to skip any deployment script that requires I dotnet run to start the application if possible, but let IIS handle all of that. Once deployed, is dotnet run absolutely necessary? How does IIS handle it directly, if possible?
I guess that for your purpose you can simply:
run dotnet publish
create an application in IIS against the program
create an application pool and start it.
Don't forget to install the SDK/Hosting bundle in the destination server otherwise IIS will not be able to run it.

ASP.NET Core publishing application by CLI

I have problem with publishing under IIS. i have been trying to automate publishing web app to the IIS by following cmd dotnet publish App.csproj -c -o C:\inetpub\wwwroot\App.Web -c release, but it just added it as folder, how to publish it as a Web Application, is it possible?
you will need to convert your folder to an application.
To do so, just right click on it, and select "convert to application"
After that, as you're publishing a .netCore application, you will have to configure the application pool running that app, and set "Framework version" to unmaged. (and leave
the pipeline to integrated)
more information on hosting .NetCore on IIS
This is a one step configuration.
All you next publish should work fine.
Some more explanations :
.NetCore is platform agnostics, so it can't know you're deploying on IIS.
When you deploy with legacy .net (4.xx) Visual studio has an IIS target for deployment, and did all the work.
With .net core, as it can also be run under linux, mac, etc.. the IIS specificities have been removed.

Unable to run ASP.NET Core rc2 in IIS

So, I've been trying to publish my Core App to local IIS server but whatever I do it just doesn't want to run.
What I do is find the project in windows explorer and open a command window there, and write the following:
dotnet publish --framework netcoreapp1.0 --output "C:/ReleaseWebsite" --configuration Release
Which well executes without any errors, and finally says that it published the project correctly.
After that I go to IIS and Add New Website, set it to port 80 or 8080, I even tried with 8088, and after set the path to the published files, I edit the Application Pool and set it to No Managed Code. Start the website but all I get it 500 error An error occurred while starting the application.
If I go manually to the published files and open GST.Web.exe it starts without any issues, and rusn on port 5000 and I can access it without any problems. But I want to run it in IIS. Any help?
Refer Publishing to IIS article.
I think you must have done all the steps from this article except installing .NET Core Windows Server Hosting bundle on the server.
Install the .NET Core Windows Server Hosting bundle on the server.
This bundle will install the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module. The module creates the reverse-proxy between IIS and the Kestrel server.
See if this helps.

Web API 2 get up and running on local IIS

I have Web API 2 C# project which runs fine through visual studio. I type URL to test like this:
http://localhost:51754/api/email/1
It shows me XML file. However when I publish and set up IIS I get
HTTP Error 403.14 - Forbidden.
I am new to this and my question is what kind of configuration I need to have it run on IIS. I am using .NET Framework Version 4.0 Integrated Application Pool to run it.
Probably ASP.NET is not registered within your IIS. Try running the following command from a DOS prompt with elevated user account:
C:\windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
Obviously you might need to adapt the path to aspnet_regiis.exe depending on your specific OS and version of the framework. Once you have registered ASP.NET 4.0 with IIS make sure that you restart it for changes to take effect:
iisreset

Categories