How to get the application names hosted in IIS? - c#-4.0

I have an application which is used to configure the applications under "Default Web Site" in IIS. Now i want to check whether all the applications are hosted in IIS successfully or not using C# code. Can anyone please guide me to get the application hosted name from IIS?
I have tried but no luck.
Thanks in advance!!!
Regards,
Karthi.

new System.DirectoryServices.DirectoryEntry("IIS://localhost/w3svc").Children

Since you are on IIS 7 and above, you can use Microsoft.Web.Administration,
http://www.iis.net/learn/develop/extending-the-management-ui/overview-of-mwa-and-mwm-for-iis
Besides, keep in mind the facts you should know,
https://blog.lextudio.com/2015/05/whats-microsoft-web-administration-and-the-horrible-facts-you-should-know/

Related

Deploying ASP.NET Core 6.0 MVC app to Server doesn't work

I am new to web development, I am learning it on the way as I develop my application.
I have an ASP.NET Core 6 MVC app that basically does this:
Starts with a Login
After login you can view the data
You can manipulate data on the view page
You can view some logs, and acknowledge them
So, my app works just fine when I run it from VS 2022.
I would like to deploy the app, so it can be used within the company. It all works on an internal network.
I have two options for deployment and to host the app from:
Windows Server 2019 (IIS)
Synology NAS
It really doesn't matter for me, but I have been through more than a dozen of tutorials/videos, but could not get it work either way.
I have tried different publishing methods.
I have .NET Core Hosting 7.0.2 and Web Deployment installed on the Windows server.
Basically my published file structure doesn't look like in some of the tutorials.
The furthest I've got is that I can load the page on the Windows Server 2019 machine, it shows the login page, but after I press "Login" it says ".../LoginController" Page not found.
So, after this chaos, can anyone give me some guidance where should I look for the solution? I thought it would be a good idea to use MVC, but now I think it would be much easier with a simple ASP Web app...
Eventually, after I got to the Login page (as I mentioned), I figured out the problem there. I am using cookies, which were set to "secure" in the program, but I was usint http instead of https. As a test, I have set the cookies' "Secure" property to "false", after that it worked.
At least I know where to go next.

How to integrate iis in wix v4?

I want to make an installer, but IISExtension isn't available for wix4 (IIS v10). Where could I find that iis tag?
I think you have the wrong iis link. Please check this Migration page.
Fix: Rename http://schemas.microsoft.com/wix/IIsExtension to http://wixtoolset.org/schemas/v4/wxs/iis

How to file upload mvc5 on cpanel server?

I've created a project in visual studio on MVC5. As you guys can see in pictures bellow index.cshtml is in Views/Home/index.cshtml! So how can I upload it on cpanel server. As you guys know on server we need an index.html file to link! I don't know how to handle that, let me know if further details or project code is required... Please helpenter image description here
it will not work on cPanel hosting because its a Linux platform that will not support for your programming type. so take another hosting of a windows server if you want manged hosting than go with windows plesk hosting providers.

MVC 4 Web Api Route 404 issue

I have a plain-vanilla MVC 4 Web Api project created using VS2012.
The (/api/Values) works out-of-the-box on the localhost but NOT when deployed on IIS (packages created using the standard "Publish..." from the project menu).
After been through lot of articles and reading suggestion for similar issue I found the Route tester which visualized how IIS was interpreting the request.
As the screenshot revels, the IIS is interpreting ~/api/values as ~/api/values.aspx
Any input on why this is happening and suggestion on how to resolve it is highly appreciated.
Thanks a lot for the help.

Can I set IP restrictions using the Wix IIS extension?

Is it possible to set-up IP address restrictions for an IIS site through a Wix installer? I don't see it mentioned in the IIS extension documentation. I want the site to be available to only one specific IP address.
Thanks!
No, not today. It'd be great if you contributed the code to handle that case to the WiX community though.

Resources