Visual Studio 2017 Published web application returns 500 error - asp.net-core

I have tried creating a test default net core web application which runs fine with IIS Express on my local machine. When I publish it to the server (Win 2012 R2), it returns a 500 error when I hit the website. Nothing is logged in the Event Log or IIS logs. I've installed the ASP.NET Core Module and restarted the server and still get the error. From what I've read, it's supposed to deploy a testproject.dll and web.config points to that but mine is generating an executable instead and web.config is pointing to that. Everything is in the root of the website as well so I'm not sure what else I can do. I didn't change any code in the test project, just using the default demo app to make sure I can get it running on a server.
Please help!

After a lot of testing, I finally figured out that there was a few error with IIS bindings, and permissions. Now everything is working.

Related

What is still missing in my attempt to host a blazor-server app?

I've been hitting my head against this wall for days now and to my knowledge I've followed every direction I've found. But I'm still getting a 500 Error when I browse to the URL.
What I've got to work with is a Windows Server 2012 R2 with IIS 8.5. I'm not married to IIS but I'd prefer not to dip into YET another tech just to get this running.
What I've done:
Old-style blazor-server app (with Program / Startup pair) without authentication. Dependencies:
SharpZipLib
LiteDB
published it using dotnet publish -o bin/publish --self-contained -r win7-x64
copied that folder to the server
On the server:
installed urlrewrite2
installed everything under Windows Features Word Wide Web Services and Web Management Tools
restarted
created a new site in IIS
set the application pool to unmanaged
set the physical path to the folder I copied from my dev system
What I haven't done:
Anything regarding Visual Studio as I'm currently forced to contend with Visual Studio Code and none of that applies/is possible here.
Provisional Workaround
running dotnet my.dll --urls http://*:1234 does work to expose the app to the network
the command needed to be run inside the application folder otherwise the app would fail to load the connection string.
I've also had to provision a production database and modify my appsettings.json accordingly
This is workable for now but not having the app "auto start" with the server is unsatisfactory.

Classic ASP AspXml createobject fails after windows updates (20212R2 - IIS8)

Today our HTTP server had been updated with KB5001382, KB5001393 and KB5001403.
It's a windows server 2012R2 with IIS8 installed
But after those updates I started getting an error on one of my classic asp pages.
set xml0 = Server.CreateObject("AspXml.AspXml")
set xml = xml0.HttpGet(XML_File)
xml.FirstChild2() (error on this line)
Error message:
Microsoft VBScript runtime error '800a01a8'
Object required: 'xml'
I tested the XML_file and it loads fine local and on te server (browser).
My hosting provider says its something about case sensitivity but I can't imagine what they mean...
Please make sure IIS and permissions to registry/files/folders related to the DLL involved.
Searched the registry for the Object name. In this case "AspXml.AspXml"
For all registry entries, you should take ownership of the parent registry folders, so please give read access to IIS user account.
Make sure the files/folders had read/execute permission for the IIS user account(s).
Registered the DLL at the command line for good measure.
Rebooted because restarting IIS didn't seem to do it.

VB.NET web application project docker deployment 403 Error(VS 2019)

I am trying to deploy vb.net web application project (.NET Framework) using Docker option of Visual Studio 2019 and have been running into "403 - Forbidden: Access is denied." error.
However, I am able to run the project by using IIS option.
I am new to both VB.Net and Docker. Please let me know if more information is required to answer this question.
IIS Logs ("How do I access Windows eventlog of a Docker container") attached as image here:IIS Logs
I am putting this answer here for any beginner who may struggle with this:
On running from Visual Studio 2019, using "Docker" option, I was getting an IP on the browser with an error "403-Forbidden". However, when I appended the webform.aspx to it, the error resolved.
So Instead of checking output at 172.24.152.32, I was supposed to view the output at 172.24.152.32/webform.aspx or localhost:52345/webform.aspx.
You just need to put a default document into the container. A simple index.html or default.html should do.

unable to configure iis express for vs 2017

Ever since the last windows update, I have been having problems configuring connecting to a local hostname. But my workaround was to connect to localhost:60856. Now all of a sudden, I can't connect at all with the following error:
the following error occurred when trying to configure IIS Express for Project MantleMapperDotNet.WebCore. The Web Server 'localhost:60856' could not be found
I have scoured the internet for this but to no avail. Following are the things I've tried:
1. deleted .vs folder in vs project
2. deleted IISExpress folder in documents
3. re-installed iisexpress
4. running vs2017 as admin (which i always do).
5. running netsh-http to see if there's a binding already
6. restarting windows
can somebody please tell me what exactly is going on and how i can resolve this issue?

How can I publish an MVC 4 application on visual studio?

When I try to publish it I get the following error message:
Error 1 Web deployment task failed. (Could not connect to the remote computer ("..*.*"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)
I dont understand why is it referring me to a remote computer, I've specified the destination URL as my own IP address. And I have web management service checked on windows features.
How do I solve this particular error?
Try to publish to the file system, if this works move the files into you wwwroot, normally c:\inetpub\www.
then go to start and run inetmgr to open iis configuration manager, if you see your folder there right click and convert to application, accept settings then right click / manage / browse and you should see your site or an IIS error that should be easy to debug.
I never use the deploy to IIS feature from VS as it's pants.
Good luck!