how to run asp.net core develop file in iis server - iis

I have a aspnetcore webapi application,i want run it in iis(not vs iis),and dont publish the app,just in use the develop file like:
app develop file
because i dont want publish my app into iis every time I change code
I don't want to see the swagger page only I start vs
I set the iis site path to app develop folder but I get the error code:403.14
error page

Check this article
There should be very few reasons for you to run IIS during
development. Yes, in the past there were very good reasons to run full
IIS because there were always a number of things that behaved very
differently in full IIS compared to IIS Express.
However, with ASP.NET
Core there's little to no reason to be running full IIS during
development.
You could use dotnet-cli to run your api

You cannot fight the fight that is doomed to fail,
https://blog.lextudio.com/how-visual-studio-launches-iis-express-to-debug-asp-net-core-apps-d7fd3677e3c3
Visual Studio uses a trick, which I documented with full detail in the blog post, to run ASP.NET Core apps on IIS/IIS Express. So you only options are,
Use Visual Studio.
Publish the app and then run it on IIS.
There is no obvious third option.

Related

How to host a asp.net core MVC app in IIS?

I am familiar with .Net in general but new to ASP.Net Core. I just had my first "self-hosted" ASP.Net Core MVC app running (created using templet and runs under Kestrel by default) . What I would like to do now it to host it in-process with IIS. But what I am struggling with is that I couldn't seem to find a clear and detailed instruction/document about what I need to do to get it to work. I have tried various configuration changes on my own but nothing works so far. I am running .Net Core 3.1 and using VS.Net 2019 on my Windows 10 environment. If someone could point me to the right direction it would be highly appreciated.
As far as I know, if you want to host the asp.net core application on the IIS. You should make sure you have installed the right hosting bundle.
Notice: No matter you use in-process or out-of-process, you all need install the IIS hosting bundle.
More details about how to install it, you could refer to this link.
After install the link, you could check your IIS module to make sure you have installed the right asp.net core module.
Then you could use VS to publish the application to right folder and create the IIS web site as below:
Create IIS website:

Page keeps loading forever

Im using IIS 8.5 on Windows Server 2012 R2 so I add my Web Api but when I try to view the site it stays in a loading state like this:
Do not show any message or error just stays loading, I think that i miss some configuration or feature in my IIS but I don't know which one.
Edit: I use .Net framework, it is a REST .net web api like this reference, the IIS have installed .Net versions 3.5 and 4.5, it's IIS not the express and the default IIS website runs fine.
I would really appreciate any help.
Try to reduce the timeout settings to a minimum level, say 10 seconds.
See if it throws a Timeout error.
Without much information from your side its hard to judge.
Perhaps it could be an external service you are trying to access(Web service) or a DB connection?
Please check if the application pool you assigned to your solutions runs under the correct version of .net framework and in integrated mode. I had similar issues when trying to run an mvc app in classic mode. Check this out.
EDIT 1 - Reconfiguring IIS
If problems persists then try the ASP.NET IIS Registration tool. Execute the followig command as administrator:
aspnet_regiis -i
At the end of this post the different locations for aspnet_regiis are described. You should select a .NET Framework version corresponding to that of your project, run aspnet_regiis and assign the proper application pool to your app.

IIS does not start .net core 1.0 executable

so after .net core 1.0 got published I started a new console project and imported the code from a small prototype that is supposed to run without IIS. Besides having to use net46 in my project.json due the not-yet updated MongoDB.Driver, that worked fine. When I build the app in Visual Studio a small App.exe with a lot of dll is build and can be run fine locally without IIS.
I then noticed the option to build for IIS Express and thought that I can use the IIS on our server (IIS 6.2, Windows Server 2012 R2) too. It publishes fine with WebDeploy, but nothing happens after that. I was following this official guide. I installed the .NET core Windows Server Hosting bundle and everything appears to be in order, but when I browse to the url, I get a ERR_NAME_NOT_RESOLVED. Theapp.exedoes not appear in the Task Manager and I can't find any log file, although it is enabled in theweb.config. I can execute the app manually, but then it only listens on the defaultlocalhost:5000` address.
If I understood it correctly, the IIS is supposed to act as a reverse-proxy to the dotnet tool which starts a dll, but in my case it's already a compiled exe that works standalone. But I can't figure out how to build a dll from this app..
What am I doing wrong?
If you target full .NET Framework the application will be .exe and not .dll and it is fine. ERR_NAME_NOT_RESOLVED indicates that the url you provided in your browser could not be resolved and the request to the application was not made. AspNet Core Module starts the application on the first request and because the host could not be resolved the request was not made and the application was not started. Once you figure out why the name could not be resolved and you still have issues with making your application work with IIS take a look at my post which explains how things work and how to troubleshoot issues. This, however, only applies after the request can reach your application.

When should I use WebDev.WebServer.exe?

I have a ASP.NET MVC6 web application developed in VS 2015. I run it on Windows 10. I have client side JavaScript compiled by Gulp which is dropped in the wwwroot folder which I want to debug as well as debug the WebAPI controllers on the server side. The application will be hosted on Azure after the development is complete.
During the development, should I use (1) WebDev.WebServer.exe (2) IISExpress.exe (3) IIS10 or (4) DNU to host the ASP.NET website?
IIS Express (2) is good enough for about 95% of things you need to do during development, it's as good an implementation of "proper" IIS7+ as you'll likely need.
That said, for things you can't properly emulate on your workstation, such as Azure, periodic deployment to your Azure environment is always a good idea, just to be sure you don't fall into the trap of "Well it worked on my machine".
Never use the built-in webserver.exe, it's a toy and is severely limited in functionality.

SharePoint 2010 Web Front End Application Server dll deployment

We have a SharePoint farm configured with one SQL server, an Application server and one Web Front End. All assemblies run from the GAC on the WFE, except one. This one dll has to be forced (using gacutil) into the GAC on the App server in order to see changes in our SharePoint application.
My question is, what determines that this dll must run on the App server and not with the rest on the WFE? I assume because of this, I cannot debug in Visual Studio from the WFE. Do I have to install Visual Studio on the App server as well?
When setting up a timer job, it's possible to use the constructor to specify a specific server. That's likely how things got set up for this solution and associated .dll file. More info on that here:
http://www.martinhatch.com/2009/08/sharepoint-timer-jobs-and-multiple.html
As for adding Visual Studio to servers on your farm, if this is your production farm I do not recommend doing this. If you really need to debug in production (you really, really should have a development box set up for this), do it via remote debugging.

Resources