.NET CORE under Ubuntu 16.04 - Logging permissions - asp.net

Is there any special CHMOD or any permission necessary to make an ASP NET MVC under .NET Core 2.0 log? On my windows dev machine the log is generated normally but not on my production machine.
I have an Web App running on a Ubuntu 16.04 DigitalOcean Droplet. Two days after every deploy it starts to throw a NullObjectException that I'm not able to trace properly and stops whenever I restart kestrel, even allowing the developer exception page to be shown (it is not verbose enough cuz I can't see where in my code the last call is made - it only shows native framework calls.

Related

.NET Core 3.1 Windows Service Fails Immediately with 1053 Timeout Error

I have a .NET Core 3.1 console app I have deployed to server and setup as a windows service. I can open cmd window as admin and navigate to the exe and it runs the exe with no errors or issues.
However when I try to start the Windows Service it immediately fails with an error:
Windows could not start the service on the local computer. Error 1053: The Service did not respond to the start or control request in a timely fashion.
We have ServicesPipeTimeout set to 180000
and rebooted server but it still fails immediately. Shouldn't it take time before the timeout error comes up?
I have also ensured we have the Release version of the code as I found posting saying Debug versions of code will cause this issue.
The folder permissions are as follows:
Since the console app runs fine from the command prompt there should not be an issue with the code/framework on the system?
Is there anything else to check?

Can't Deploy Simplest ASP.NET Core Web App to Azure VM

I'm trying to deploy the simplest ASP.NET Core 2.1 Web App (Razor or MVC) I can imagine from Visual Studio 2017 15.8.2
and still failing.
I followed the instructions in
https://github.com/aspnet/Tooling/blob/AspNetVMs/docs/create-asp-net-vm-with-webdeploy.md
step by step
finished creating VM
checked the web management service is up and running
installed Web Deploy 3.6 as described above tutorial
installed Windows features required - ASP.NET 4.6
Port 80 (http) and 8172 (WebDeploy) is open
checked the inbound rules in Azure portal
and Windows Firewall in Remote Desktop
But WebDeploy still fails.
I used the credentials when I log on to the VM using RDP
It says
ERROR_COULD_NOT_CONNECT_TO_REMOTESVC
but I checked the web management service is running
Also, when trying to configure deploy profile, 'Validate Connection' fails without any error message.
What am I missing?
When installing Web Deploy 3.6, choose custom and select all checkboxes.
'Typical' setup does't work.
End up with "500 - Internal server error", but hey,
at least file uploading works, and that's a huge step for MSFT, huh?
EDIT: When Web Deploy 3.6 was installed with 'typcial', the web management service was not running and set 'manual' so I turned it on and set the startup type 'automatic' in [services] but the problem continued. So I changed the Web Deploy setup to custom/select all and succeeded uploading.

Kestrel seems to start but doesn't work when run as a different user

I have a small .net core WebAPI service running on kestrel. This is deployed automatically on multiple machines using TFS deployments. After deployment the automation tool runs this kestrel server on each deployed machine.
I can verify that:
the application starts on each machine (dotnet process is present in Task Manager)
the application listens on the correct port (because trying to run it manually on that port throws the error that port is in use)
BUT:
for the automatically started application I cannot access the webapi service in browser (http://localhost:8081) -- says 404
if I close the dotnet process started automatically and run it manually it works ok (WebApi accessible in browser)
Why doesn't it work correctly when started automatically? The only difference between processes seems to be the user under they are executed.
How could I troubleshoot this problem?

Run a ASP.NET application with mono

I will run an asp.net application on a linux system with mono.
The application run on the iis without problems.
I published the application with VS to the IIS.
I put the same content to my linux machine.
The file structure looks like this for the IIS:
How can I start this application on a linux machine with mono?
It depends what you are wanting to do. You could use Mono XSP4, which is a web server distributed with mono (primary use is for debug and therefore has limitations but it will run your site).
You can find installation instructions on the mono project web site (http://www.monodevelop.com/download/linux/). The package on ubuntu is called mono-xsp4 but you will need to add the mono project repos.
Once installed running it is simple:
$ cd /path/to/your/aspnet/project/root
$ xsp4
This will fire it up and run it on the default port with an option to kill it from the command line by hitting enter.
A few options to help:
$ xsp4 --nonstop --port=443 --https --cert=/my/cert.crt --pkfile=/my/key --pkpwd=mykeypwd
Non stop means the server will run without ability to stop using enter. Port is self-explanatory. The rest of the options are about running with HTTPS should you want to do that.
Hope this helps. Happy coding.

Unable to start debugging on the web server. The COM+ registry database detected a system error

I'm trying to debug an ASP.NET webapp that's configured to "Use Local IIS Web Server" on WinXP. When I start the debugger, the compile succeeds, and then the following error is displayed in a dialog:
Unable to start debugging on the web
server. The COM+ registry database
detected a system error
The webapp never launches in my browser. How can I get rid of this message and debug this webapp?
I tried the usual stuff, and my exact scenario ended up being described a post in the MSDN forums. Its answer worked for me, despite my environment (VS2008, .NET 3.5) being more modern:
Here are the steps I followed (basically a summary of the link above -- "ASPNET" being significant because that's the user running the IIS instance on my development box):
Close VS
Shutdown IIS
Add ASPNET to the local Administrators group
Start IIS
Start VS and successfully debug ASP.NET webapp
Close VS
Shutdown IIS
Remove ASPNET from the local Administrators group
Start IIS
Start VS and continue debugging ASP.NET webapp without error
My development workstation's security settings/situation is regularly managed by our security folks here, so something must have upset my ASP.NET/IIS/etc environment.
I am using the Visual Studio 2002 and I had the same problem, with tha same Error Message. To solve it, I did only the first 5 steps of the solution recommended before.
I am starting in VS 2002 because I use it in my work. I have the basic concepts, but I never develop in this program language, so I am a begginer.
The most important point in this solution I believe it is understand that ASPNET is a user in the development machine, as Administrator, as "Name.LastName" or any other user that access the machine. When I search for ASPNET to add in the Administrators Group and found it, made a lot more sense because I don't know exactly how the .NET architecture works.
So, if you have the same problem, I here confirm this solution solved my problem, even when I reboot my machine:
Close VS
Shutdown IIS
Add ASPNET user of the Machine to the local Administrators group
Start IIS
Start VS and successfully debug ASP.NET webapp
Thanks for the solution!!

Resources