How to host an ASP.NET MVC project in IIS? - asp.net

I have an ASP.NET MVC solution with multiple project under it, it works fine locally after uploading the site on the server I get the System.Reflection.ReflectionTypeLoadException error
I am also trying to run the solution on IIS and the error I am getting is Not Found
The requested URL / was not found on this server.
I have also copied all the DLL to the output folder, what could be the issue is the problem most likely from a missing DLL, is it from the remote hosting security level or am I missing something else in the project please advise.
After calling the hostgator (where the site is hosted) and addressing the issue, I was told that custom DLL is not allowed in our hosting as you may see I have taken screenshots of the DLLs I wonder what are the customs DLL in my project as hostgator technician put it

I assume you're running v3 of ASP.NET MVC. In which case, have you set the Application Pool .NET Framework version in IIS to C# 4.0? Indeed, is ASP.NET MVC and .NET Framework 4.0 installed on your server?
Does your application rely on any external libraries which were not included in the deployed application?
Are you able to debug your application at all? Ie the Application_Start. It's possible that something is going awry during that which is causing this.
Basically, more information would help!

Related

ASP.NET Core Runtime 3.1.9

Morning All
I am hosting my website on IIS , the website was built using the react template. But I have ran into a problem. When using localhost my webapp worked a charm, i could interact with the database and life was good. But now ive moved it over to IIS Im no longer able to pull data in from the database or interact with the db.
I think the problem may be the fact that IIS is running on a different server to my local machine. I have the ASP Core runtime installed on my local machine but not on the server where IIS is situated.
Can someone just confirm to me that I do require ASP Core runtime to be installed on the IIS server also?
Im not able to test things out until tomorrow otherwise I would find out for my self. Apologies, im basically a beginner with IIS and ASP
Thanks
If you are facing troubles with the database connection and not with your API endpoints could be network/proxy/firewall stuff. But if you're not able to deploy your API to IIS maybe could be that you're missing the Net Core bundle. For more information check the link below:
https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.9-windows-hosting-bundle-installer
Yes, you are required to have the ASP.NET Core runtime installed if you plan on running asp.net-core applications on it.

Steps to deploy .NetCore 2.1 application to web server. missing steps

I have built a web app in VS2019 that is a .netcore 2.1 application. It builds and runs fine locally in debug and release mode.
I have bought space from a hosting site on there server and have a registered a domain, they stated that they can run .netcore apps.
I have deployed the web app to the servers file server, I have used Visual studios publish functionality and used filezilla, my site is in its httpdocs folder which is where there sample html index file was before I deleted them, now in this It has the webroot folder and the dll's here.
When I look up the website online it shows a 500 error.
I have never set up this type of thing before, am I missing steps, Is there something that I have missed.
Just to note, I have looked up other similar questions regarding this but havent helped.
Assuming you are trying to host this inside IIS, you need the followings to be installed on the server. You can download the same from here.. Please make sure you choose the correct hosting bundle for your application.
Once that is installed, make sure to open IIS and create an apppool. Make sure you select No Managed code.
Then you can add the web site, and assign the above apppool to the website.
Hope this helps. Happy coding <3

IIS-based Web Service

I have created an ASP.NET Web Application in Visual Studio Community 2019. I am trying to deploy a web service in IIS but I keep getting the 404 Not Found error. The application pool in the IIS manager looks like this
I create a connection
and then publish the application but I get this error
The .NET Framework is 4.7.2
What did I do wrong?
As per your screen shot application is hosted with virtual directory Webapp.
URL Should be http://Localhost/webapp/webservice1.asmx
First change url to http://Localhost/webapp/webservice1.asmx. Then check Mapping to an ASMX service using routing in ASP.NET MVC for solving the mapping problem.
I suggest publishing the site to the folder. Then create a new site in IIS Manager and show its physical path to that folder. Give your site some path like localhost:3600. Then when you open that path in the browser and search http://localhost:3600/WebService1.asmx, it will definitely work(at least it worked for me)

XML Parsing Error: no root element found in iis

I am very new to web services. I have wrote a web service application. When I run it from visual studio, everything works fine and my local website comes up. But after I deployed it in IIS, I can't browse it from iis and i get the following error! I am confused about this error for a day! Can some one help me?
XML Parsing Error: no root element found
Location: http://localhost:99/WebService.asmx
Line Number 1, Column 1:
I faced a similar issue when I deployed a project on my local new computer. By default, ASP.NET is installed but disabled in Windows.I had to enable it before my project run. See Install IIS and ASP.NET Modules for details.
Make sure that all the required modules are enabled.
I had same issue, but had ASP.NET modules installed. Apparently had to change .NET Framework Version from v2.0 to v4.0 and site was showing as it should. You need to go to IIS, Application Pools, double click the one that has older version of .NET and set the relevant one. Maybe this will be helpful for someone else.

How to host ASP.NET Web API 2 project on IIS 10

I am trying to host an ASP.NET Web API 2 project on IIS 10, and I keep getting a page saying Service Endpoint not found.
The project I am using for testing is the sample ProductsApp project here Getting Started with ASP.NET Web API 2. If I run the project in debug, then the page shows up as expected while it is being hosted through VS2012 IIS express at localhost:54170
I am then publishing that project to file using VS2012.
After publishing to file, then I made a new site on IIS 10 at localhost:8080 and point the physical path to the folder that I published the ProductsApp project to.
At this point if I go to browse the site it comes up with a page that all it says is Service Endpoint not found.
I've changed my DefaultAppPool Identity to LocalSystem, so I don't think it's a permissions issue.
How do I get the site to show up like it does when I'm debugging from VS2012, but from IIS 10?
I wasted so much time yesterday trying to figure this out, but this morning with a little fiddling I found my answer which I'm surprised I wasn't able to find anywhere else I looked.
To fix my problem this is all I had to do.
Instead of hosting the ASP.NET content as its own site I just needed to add an application to my default web site with the physical path pointing to the folder that was published from VS2012.
This is obviously my first time using ASP.NET, so I didn't have any of the ASP.NET features installed in IIS. I went to Turn Windows features on or off -> Internet Information Services -> World Wide Web Services -> Application Development Features, then selected all of the ASP folders (ASP, ASP.NET 3.5, ASP.NET 4.6). Edit: Looking back at this, all that was required was turning on the feature ASP.NET 4.6. At the time I didn't know what I was looking for, so I tried to nuke the problem by installing everything with "ASP" in the name.
The DefaultAppPool Identity didn't need to change to LocalSystem, so I changed it back to ApplicationPoolIdentity.
Now I have the ASP.NET site up and running on my localhost.

Resources