ASP.NET Core, Devart, Windows Service - windows-services

Hy everbody,
I created a ASP.NET Core Web App which i run as a Windows Service.
That is working fine until i started to use Devart as DB-Provider for my Oracle-Database.
As soon as is include the Nuget-Package Devart.Data.Oracle.EFCore in my Project i get the following Error when i try to start my Windows Service:
[SC] StartService FAILED 1053:
The service did not respond to the start or control request in a timely fashion.
I can start the Service again when i remove the Package Devart.Data.Oracle.EFCore.
The Nuget-Package Devart.Data is also included but there is no Problem.
I can start the Service with the Package Devart.Data inculded without any Issue.
Unfortunately i need both Packages.
Maybe someone can give me a hint where i can find what the Problem with the Package Devart.Data.Oracle.EFCore is?
Thank you very much.
I tried a view suggestions from there: https://appuals.com/how-to-fix-error-1053-the-service-did-not-respond-to-the-start-or-control-request-in-a-timely-fashion/#:~:text=Users%20experience%20the%20error%20message,respond%20in%20the%20time%20window.

Related

application works locally but not on azure

i have created an application, it works perfectly fine on my system but when i deploy it on azure app service. it doesn't work. it is showing such error.
An error occurred while starting the application.
.NET Core 4.6.27817.03 X86 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.2.0-rtm-35687 | Microsoft Windows 10.0.14393 | Need help?
i have tried to check the azure app service platform, but it is fine.
Also i have tried to check the publish settings on the visual studio.
Under the 'Entity framework Migrations' dropdown in publish settings i see this error:
Could not execute because the specified command or file was not found.
Possible reasons for this include:
You misspelled a built-in dotnet command.
You intended to execute a NET Core program, but dotnet-ef does not exist.
You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
Also i have checked everything, it looks fine.
I have tried to create a fresh new .net core 2.2 project and tried to deploy it but that also shows the same issues.
i want it to be deployed on azure and in working condition.
Whoever can, kindly Help.
Please look at the below answer for troubleshooting issue around dot net core 2.2
ASP.NET Core 2.2 App Service hosted on Azure returning 500 without an exception being thrown
This will give you the actual reason of the error which you can use it to resolve.
Additionally , you can enable DetailedErrorsKey in the Program.cs so you can figure it out what's happening.
For startup related exception , you can take look at this link.
The Database Error Page **middleware** captures database-related exceptions that can be resolved by using Entity Framework migrations. When these exceptions occur, an HTML response with details of possible actions to resolve the issue is generated. This page should be enabled only in the Development environment. Enable the page by adding code to Startup.Configure:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-2.2#database-error-page
Hope it helps.

Visual Studio 2017 - Giving remote users access to website in IIS Express

Been looking through and trying all guides i found on this topic but no luck. I am running and MVC project with HTTPS and want to access the debug site with some remote mobile devices to test out the website. I followed a guide that almost work and i think I am pretty close to getting it to work. Here are the steps I have done:
Turn off Firewall
Open projectfolder of website go to \vs\config\ and open applicationhost.config
Find your site and line that contains your mapped port like this:
-edit it to get this result:
Tried to run Visual Studio as Admin at this point, Got regular error 400: Bad Request - Invalid Hostname when trying to access site from other computer
Opened CMD as Admin and ran the following command:
netsh http add urlacl url=http://*:44363/ user=everyone
- URL reservation successfully added
-Tried to start Visual studio as admin and non admin. Gets the following error message
"Unable to launch the IIS Express Web Server.
Failed to reister URL "https://localhost:44363" for site "x" Application. Error description: Cannot create file when that file already exists"
-I then have to run cmd again and remove the url with the command:
netsh http delete urlacl url=http://*:44363/
How do i get this to work with Visual Studio 2017 ? I cant be many steps from getting it to work. I have read many guides but none of them works
Amazing how such a simple common need can be so painful to fulfill out of the box in 2017!
Anyway https://github.com/icflorescu/iisexpress-proxy worked nicely for me.
Install it with node:
npm install -g iisexpress-proxy
Then its just something like:
iisexpress-proxy 51123 to 3000
Under 2 mins to get running.
Let me share my experience with Visual Studio and IIS Express that should help you. I am not using HTTPS and my project type is Web site with WCF but you should be able to accomplish your goal.
Here are prerequisites:
IIS Express installed
Visual Studio installed
Added url reservation for public port (netsh http add url=http://*:50001/ User=Everyone) from elevated command prompt.
Added firewall inbound rule for 50001 TCP port (Control Panel-->Windows Firewall-->Advances Settings-->Inbound Rules-->New Rule...)
Now let us setup a project in VS. I am using one of predefined templates with C#. Compile it and try to run it from VS. At that moment VS is starting developer instance of IISExpress that helps your site to run.
You should be able to see IIS Express icon in Notification area. With right click you will see that your site is running and a port (we will call it VSPORT) that is assigned by VS. This port must be different than reserved port (50001).
If you managed to accomplish this without problems then you have almost everything ready for running your site without VS.
Go to your project folder
Go to .vs folder
Go to config folder
Open applicationhost.config
Locate sites/your_site section
Copy everything between your_site and /your_site
Now we need to add this info in "global" IIS Express config.
Go to IIS Express folder (something like c:\Users\USERNAME\Documents\IISExpress)
Go to config folder
Open applicationhost.config
Locate sites section.
Paste information about your site.
Change binding from
binding protocol="http" bindingInformation="*:VSPORT:localhost"
to
binding protocol="http" bindingInformation=":50001:"
Save changes
With this change you may start IISExpress.exe directly and you can continue to use VS to work on you project at the same time.
If you want to access it from other computers do it as http://YOURIP:50001/.
Do have in mind that you need to ensure that your javascript code is NOT using address and port number directly.
You can solve the problem by downloading the 'conveyor' library from extensions and update in Visual Studio.
You can access it from other devices.
Open Visual Studio
Tools > Extensions and Updates
Online > Visual Studio Marketplace
Search 'Conveyor'
Download and install this extension
When you launch the API, you can access it from other devices. This plugin creates a link from your own ip address.
Example:
https://youripadress:5000/api/values

How to make BundleTransformer work on Windows Server Core

Ever since we found dotLess stopped working for us our ASP.NET MVC project has been using BundleTransformer for our LESS bundling and minification. We are trying to migrate our CI build agents to use Windows Server Core (headless) and away from Windows Server Standard. When we did this we started receiving Internal Server Errors when trying to hit our pages. This seems to be blowing up inside of BundleTransformer.
We initially were using BundleTransformer with http://www.nuget.org/packages/JavaScriptEngineSwitcher.Msie
From reading this post I thought maybe it was that we were missing the dependency on Internet Explorer.
http://bundletransformer.codeplex.com/discussions/454495
I tried to use the v8 engine switcher and started getting server errors on my Windows Standard setup.
http://www.nuget.org/packages/JavaScriptEngineSwitcher.V8
Has anyone successfully managed to get BundleTransformer working on a Windows Server Core environment? Anything would help. Thank you.
You have installed the Visual C++ Redistributable for Visual Studio 2012 before you install the JavaScriptEngineSwitcher.V8 package?
Give an example of the error message.

How to deploy a Delphi Soap Client (.EXE) on a Windows XP/Windows 2003?

I built a Delphi-7 Windows Application which uses some web services. The application is built in such a way that it does not require run-time DLLs. When I deployed it on a Windows 2003 server it fails while calling the web service. It results in error "Access violation at address 00c05269. Write of address 00c05269". I believe the reasons is that it needs some package to be installed. Can anybody help me to figure that out?
TIA
Just a guess: If the client was built with D7, that runtime will AV on machines with DEP enabled. See the following link for more information:
groups.google.com/group/borland.public.delphi.webservices.soap/msg/b19f3c2681de50f4
You can disable DEP for just that client (or system-wide) on the Win 2003 machine to see if that's the issue:
technet.microsoft.com/en-us/library/cc738483(WS.10).aspx
And if it is, you can download a SOAP runtime fix from here:
http://cc.embarcadero.com/Item/24535
Cheers,
Bruneau
Some troubleshooting suggestions.
Can you browse to the web service from a web browser? If not, you have a connectivity problem.
If this works, I would build a bare bones client that consumes the web service and calls a couple of methods but doesn't read from or write to any external files.

Confusion about installing windows service using command prompts

I have designed a simple windows service in .NET 2.0.
I am trying to deploy it on my local machine. I have switched to design view, and setup ServiceInstaller and ServiceProcessInstaller objects. There is a Project Installer. I have also wrapped the Windows Service into a .NET setup project and install it, leaving an .exe in the specified directory.
I have fired up cmd and entered the path to installutil. This works fine, but then I typeinstallutil and the full path to the service, in Visual Studio command prompt, and this does not work (I've also tried installutil /i and all sorts of things out of desperation). The permissions are local system (extensive).
Any ideas what I am doing wrong? For those here who have installed Windows Services, what was your methodology to install the service?
Thanks
We actually create an installer built into our application. It's a console app that has a command line to install/uninstall the server as well as run as a service or in console mode.
See this article on a Self Installing Service for some details. I like this method as it provides flexibility.
DESCRIPTION:
SC is a command line program used for communicating with the
NT Service Controller and services.
USAGE:
sc [command] [service name] ...
The option has the form "\\ServerName"
Further help on commands can be obtained by typing: "sc [command]"
Commands:
query-----------Queries the status for a service, or
enumerates the status for types of services.
queryex---------Queries the extended status for a service, or
enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistant).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.
The following commands don't require a service name:
sc
boot------------(ok | bad) Indicates whether the last boot should
be saved as the last-known-good boot configuration
Lock------------Locks the Service Database
QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
sc start MyService
Here's another reference specific to .NET services.
http://bytes.com/forum/thread739857.html
I'm calling installutil in my setup package and it works for me just fine.
That'd be great if you posted an error message that you're getting when running installutil.

Resources