Process.Start("chrome.exe","url") not working on Dotnet worker service after service hosted on windows - windows

I have Dotnet core Worker Service application in the version 6.0.
I am trying to open a website using System.Diagnostics.Process. it is working fine when I am in debugging mode on visual studio, when I hosted service using below Command on windows.
SC create serviceName binpath="abc.exe"
Services working fine after hosting but Process.Start("","") not throwing any exception also not open any browser. there is no log on windows & event viewer.
any help on this will be appreciate.
Enable allow service to interact with desktop.
using processinfo to set UseShellExecute.

Related

Implementing Windows Service app in Azure

I'm a very beginner in Windows Apps. I created a Windows Service app to send mail automatically at a specific time daily. Its taking some configuration values from app.config file. Also there is a web reference too in the service application. Then I installed the app using
InstallUtil /i %myapppath%\windowsservicevb.exe
It worked fine. But with less knowledge in this Windows service application I've no idea how to install that in Azure. Do I just need the exe file or I need to copy the app.config file also into the same directory in Azure?
You need to migrate your windows service on to a worker role in azure if you are going for azure PaaS. example here - http://blogs.msdn.com/b/mwasham/archive/2011/03/30/migrating-a-windows-service-to-windows-azure.aspx
Although if you are on an azure - IaaS VM then it is going to be the same as in the case of a windows machine locally.

Stop ASP.Net Development Server spinning up when using Azure Emulator

I am using The Azure Emulator for test deployment of an ASP.NET Web API application. When I run this I notice that the asp.net dev emulator also runs. As this does not seem to be needed, is there a way to stop it from spinning up?
There are couple of things to understand with Windows Azure ASP.NET Web role application:
When you have your Web Role set as "Startup Application" or you run ASP.NET web Role application only, you you will see the ASP.NET site runs at http:\localhost:XX this is because you are running your web application directly in IIS without any relationship with Azure Compute Emulator.
When you have your Windows Azure project set as "Startup Application" or you launch your Windows Azure application directly, in that case your ASP.NET web application will run within Windows Azure Compute Emulator. In this scenario the Compute Emulator will start if not running and if running then the ASP.NET web application will still run with IIS however due to virtual load balancer scenario you will see the ASP.NET web application is running at http://127.0.0.x:XX.
So depend on how you launch your project within your solution you will see different execution. When compute Emulator is running you can open its UI to understand how your different instances are running.
Finally based on your above requirement it seems you just want to test your application in IIS only so if you just set your ASP.NET web role to "startup project" you will not see compute emulator activity.

How to attach to and debug an ASP.NET MVC application running in Windows Azure Emulator?

I am writing an MVC 3 application to run in Windows Azure. On my local machine I use the Windows Azure emulator.
If I press F5 in my solution ("Start debugging") I'm able to put breakpoints and step through the code of my application.
Do you know if it's possible to attach to the application if it's already running (if it's been started with CTRL + F5, "Start without debugging")? If yes, how?
In ASP.NET running in IIS I just have to attach to the w3wp.exe process. How to do the same for the Windows Azure emulator?
If you are running the application in IIS (have a Sites section in your config file) then you will do it the same way with the emulator. Azure creates an Application Pool for the deployment so you will just need to attach to that w3wp.exe process.

debugging windows service: breakpoint will not currently be hit

I have attached the process for my windows service which is running/started on my machine. In vs.net 2010 I have a few breakbpoints set in my service, but each of them says?:
'break point will not currently be hit'
what is the easiest way to get the debugging for windows services happening?
This is the correct way to debug the windows service but you should be sure that the files of the windows service are updated. I mean that whenever you build the windows service project you should stop the service, replace the windows service exe and the related dlls and then restart the windows service.

How do you add a windows service to an existing application installer?

We've created a windows service to detect the insertion of a particular usb device.
That service is then supposed to launch an application we have written.
We initially made a setup project for our application and a separate one for the windows service.
Now, we are trying to get the service and the application installed in the same setup project.
We tried putting the output of our service into the setup project but without any luck.
We have the a projectinstaller class in the service, so why can't we simply add the project output of the Windows service (including the installer class) to our application's setup project?
There is MSDN article explains it, Create the installers for your service. Microsoft support also have an article, How to create a setup project for a Windows Service application in Visual C#
My primary language is Delphi. In Delphi, when a program is created as Service Application,
installing the program as a Windows Service can be done by running my_service_app_name.exe /INSTALL. I guess, the execution mechanism should be roughly same with service applications created by other compilers.
Thus, adding a windows service to an existing application installer can be done by just running the service application as mentioned, but you should refer to the documentation in case you are not using Delphi.

Resources