Deploy .NET Core app to Linux giving me Site Cannot be Reached - linux

Created a default .NET Core Web Application with Angular (literally created through Visual Studio 2019 and then published through Visual Studio 2019 with the Linux x64 profile). I copied the entire publish directory to a directory on my linux machine and ran the application. The application starts and says browse to http://localhost:5000. Well this linux machine only has shell access. So from my Windows machine (which can access other web applications on this machine from a different port) I open up the website (assume name of linux server is called 'linuxsvr') http://linuxsvr:5000 in Chrome Browser and I get this site cannot be reached.
I deployed using Self Contained Deployment so I'm not reliant on .NET Core being on the Linux machine. I'm apparently missing something. What is the correct way to deploy to a Linux Machine (specifically Ubuntu Server 14.04) with Self Contained Deployment?

Related

ASP.NET Core 2.0 app targeting .NET 4.6.1 fails to host on IIS

The problem
IIS ASP.NET Core module is unable to start an ASP.NET Core 2.0 app.
Browser: HTTP Error 502.5 - Process Failure
Windows Event Log: Application ‘MACHINE/WEBROOT/APPHOST/AppSite’ with physical root ‘C:\inetpub\apps\AppFolder\’ failed to start process with commandline ‘C:\inetpub\apps\AppFolder\App.exe’, ErrorCode = ‘0x80004005: 1’.
ASP.NET Core Module Log: Log file is created but is empty.
The setup
App: ASP.NET Core 2.0 targeting .NET Framework 4.6.1.
Server: Windows Server 2012 R2 Standard 6.2.9200 with IIS 8.5.9600.
The story
We've created a blank MVC Web application using the default project templates provided in Visual Studio 2017.
The app is deployed following the official specification: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/.
The confusion arises mainly from these two points:
Running the app through command-line on Kestrel works.
Running a different app but targeting .NET Core 2.0 and publishing as framework-dependant works flawlessly on IIS.
But between these two apps: the codebase is the same, the IIS website and application pool is the same and we even emptied out the app directory and used the same one.
Due to these points the only difference seems to be the net461 app's executable file.
We do not have full control over the Windows Server where we're trying to deploy but we do have administrator accounts. The current assumption is that the issue lies within permissions - maybe AD group policies, antivirus blocking the file but we're still awaiting response from the client's sysadmins. Meanwhile we haven't been able to replicate the error code ‘0x80004005: 1’ while trying to setup these restrictions on our development machines.
Here's an incomplete list of ideas and points about the issue we've tried while problem solving:
The initial app (targeting net461) works flawlessly on IIS when
deployed to other servers (Windows 10 Enterprise, Windows Server 2012
R2 Datacenter).
Reinstalling different versions of ASP.NET Core/.NET Core: Runtime & Hosting Bundle.
Setting NTFS permissions to the dotnet folder.
Changing IIS application pool identity to an administrator account.
Restarting the server.
Going over local group and security policies.
Going over the antivirus settings and logs.
Trying to deploy on a brand new server (same OS, same bloat).
All ideas/comments are greatly appreciated. The more obscure the better.
EDIT:
Since this got flagged as a possible duplicate of ASP.NET Core 0x80004005 I need to specify why that is not a duplicate.
That referenced project is an older version of ASP.NET Core (last use
of project.json was in 2016)
That referenced project targets .NET Core and not .NET 4.6.1. It is mentioned here as well that targeting .NET Core works on IIS in regard to this issue.
Selected answer points out that they fixed it by:
Turns out that this was result of needing to install some windows
updates and this problem:
api-ms-win-crt-runtime-l1-1-0.dll is missing when opening Microsoft
Office file
Rather than install the version discussed in the above issue I whet
into Programs and Features and ran a repair on Microsoft Visual C++
2015 Redistributable.
but the installation of Microsoft Visual C++ 2015 Redistributable is one of the steps in the official setup guide and it is mentioned here as well that the official guide has been followed during the setup process.
We have gone over that post and tried to repair and reinstall the Microsoft Visual C++ 2015 Redistributable runtime components and this did not fix the issue.
If anyone stumbles upon this post in the future:
The problem was indeed in the server's antivirus. It wasn't directly blocking the app's executable but its call to a class library in the system folder. This termination did not raise any of the usual alarms.
The application "C:\inetpub\apps\AppFolder\App.exe" attempted to load the library "bcrypt.dll" by calling the function "LoadLibraryExW". The operation was blocked and the application terminated.
After switching the MVC blank app to a completely blank Hello-World app it ran successfully.

Edit ASP.NET Core website in Docker container on Windows and run on Ubuntu VPN

I want to create a ASP.NET Core 2.0 website in a docker container and host it on a Linux VPS docker system. I tried creating an ASP.NET Core 2.0 project in Visual Studio, and then publishing it to docker hub. Everything works great, until I want to run that docker image on my Linux environment. I then get an error saying that this image is created for windows or something equivalent. I know I need to create the asp.net project in the Linux environment, then start coding (obviously), but I want to do the coding in for example Visual Studio on my PC, not via PICO or some other ssh-connected editor.
Summarized:
- I wish to run ASP.NET Core 2.0 website on Linux Docker VPS environment.
- I (think I) need to create the project in the Linux environment (I run Windows locally).
- Wish to edit the code in the docker container locally on my Windows environment.
Anyone know how I can achieve this?
Before creating ASP.NET Core 2 website on your windows operating system, right click on the Docker icon in system tray and then click Switch to Linux containers. Once switched to Linux containers, create ASP.NET Core website that you can host on Linux.

Unable to see "Management Service" in IIS 10 (Windows 10)

I have windows 10 (pro) and IIS 10 installed on Server A. I was trying to publish a Web API from Visual Studio 2015 on Machine B to Server A, but I get the following error.
web deployment task failed. (Could not connect to the remote computer ("172.26.50.17") . On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.
I understood from googling that the web server need to have Management Service installed and running. I have installed web platform installed and I can see that the "Web depoy 3.6 without bundled SQL support(latest)" component installed.
But I still do not see management service icon under "management" section on IIS. Could anyone please help me understand this?
I solved it by installing the Web Platform Installer (Web PI).
Then you can add a lot of tools using this Web PI. One of those tools is Management Service which can be enabled via Web PI.
If you do that and still cannot see the Management Service, try closing and opening the IIS Manager again.
UPDATE:
For Windows 10 and later, see the #RBT comment below.

Can my Azure Mobile Service run locally?

I am new to Azure. I am following this tutorial in setting up my .Net server for azure and ios client.
http://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-ios-get-started/
I am testing my ios client on simulator. Can I run my .NET server on my location machine with put publish it to azure? If yes, how can I figure my client to talks to this location machine?
And in the tutorial, it creates a Database Table. If I run it locally, do I need to setup my location DB server?
Not on a mac (which you need for iOS development). With the .NET backend you can run the service locally on a Windows machine, but it will be running off of localhost.
For iOS development, you have two choices. If you use the JavaScript / node.js backend, where all of your development can be done in the Mac (you can configure the service via Git locally or directly in the portal). If you use the .NET backend (the link you mentioned), then you need the Mac for the client-side development, and a PC (or Windows running in the Mac on an emulator such as parallels) to develop the server (you need Visual Studio for that).
And regarding your question about the table, when you run it locally, it will use Entity Framework Code First (by default), so you don't need to create the table in your (local) database - it will create it automatically for you.

assistance with getting web deploy from visual studio set up

I am working on getting web deploy set up on IIS 7.5. I have followed the steps exactly in this article:
http://www.iis.net/learn/publish/using-web-deploy/configure-the-web-deployment-handler
I have tested importing and exporting applications on the server and all work perfectly. Now I would like to set up remote access to ms deploy so I can install web applications by publishing in visual studio 2012 with publish profiles.
Here is where I am confused, what is the url I include in this for the service url (ie. msdeploy.axd)? Where I can find it on the servers iis (server is located on different machine than visual studio)? I have read about access is over port 8172, how can I check that this is open for communication?
Thanks for any help
First up, the installation instructions you want are Installing and Configuring Web Deploy in the "Install" section of the site. The instructions you linked are from 2008.
Once you've installed MSDeploy v3 as per the newer instructions, the MSDeployServiceURL value will be https://webserver:8172/msdeploy.axd. You'll also probably need to set <AllowUntrustedCertificate>true</AllowUntrustedCertificate> if you don't have a cert on the server.
The user in question will need to be an administrator unless you have setup non-administrator deployments (instructions in the same link).

Resources