i'm making a Visual basic Console App to inject a DLL to an exe process if the process is running
the question here is how to make console application checks if the desired process is running
The Process class provides methods that allow you to get lists of running processes. For instance:
If Process.GetProcessesByName("notepad").Length <> 0 Then
' Notepad is running
End If
Related
I am developing a simple console application with .NET Core 2.
Its purpose is to clean up a Database once per day.
This means the application does never stop after once started.
This application is part of Solution where also a .NET Core Rest API lives, to access the same database so its also part of the same Gitlab repository.
Now i want to publish and start the console app via the existing Continuous Integration pipelines of the repo. (CI pipeline is working perfectly for the REST Api project)
Building, testing and publishing works perfectly, the only problem is running the console application.
I tried a few attempts by now, the outcome is always, that the pipeline gets stuck after the application startet. I guess it is like that because it waits till the app finishes, what never happens.
I tried by now:
starting the app directly in the gitlab_ci.yml
gitlab_ci.yml:
-cd C:\publishFolder
-DB_Cleaner.exe
-> The application is executed directly in the Runner console
gitlab_ci.yml:
-cd C:\publishFolder
-start cmd.exe /k DB_Cleaner.exe
-> The runner is stuck till it got canceled by timeout
Running a bash or powershell script to run the application
gitlab_ci.yml:
-cd C:\ScriptFolder
-runDBCleaner.cmd
runDBCleaner.cmd:
-cd C:\publishFolder
-start cmd.exe /k DB_Cleaner.exe
-> The runner is stuck till it got canceled by timeout
Runner is running on a Win-64 virtual machine.
Is there a way to start the application to run Independent from the gitlab-CI-Runner?
See This Forum. It is working for me using this script:
- 'powershell.exe D:\app\CiTest.exe'
The CiTest.exe is a .Net 4.8 console app.
I'm attempting to automate the build of a source controlled MS Access application (it's only the front-end, the back-end is SQL Server). The Access client is published to the users via a simple C# console app via ClickOnce... It's in that console project that I'm also building the MS Access application via a custom msbuild tasks from this CodePlex library: https://buildmsaccessdb.codeplex.com/ (which is also mentinoed in another StackOverflow post on the subject). On my machine, it all works fine. The Access source code is compiled into an ACCDB, which is then converted into an ACCDE which is what gets included in the published app.
However, when I make it an automated build in TFS, it always stalls at the step where it converts the ACCDB to an ACCDE. I've tried a variety of ways for executing the "Make ACCDE" (SysCmd 603) command. I've tried it in powershell scripts, in VBA, etc... but it always seems to stall. Is that because the automated build process is not an interactive process and maybe the the SysCmd 603 needs to be ran interactively? If I stop the build and take a look at the ACCDB, everything is good. It compiles and can be manually compiled into an ACCDE... so it's not that the ACCDB isn't compilable.
I'd like to test it as an interactive TFS service but I don't control the service account it's running under.
Any tips on suggestions are welcome and thanks in advance! We have this whole automated build and release process up and nearly working except for this one piece!
I don't know much about the MSBuild task library, but from a quick look at the source it looks like it opens Access to run the tasks and interacts with a dialog box at one point. If that's the case you'll definitely need to run the build in interactive mode.
The fact that your build is hanging and not erroring out would also indicate this is the case.
Even though you don't control the service account, I would presume there's someone else in your organisation that does. I'd suggest you work with them and to try the build in interactive mode and ensure it works. If needed you could always set up a second build machine that runs in interactive mode, with the current build server remaining in "run as a service" mode.
I am using JSmooth to generate EXE for my Java application. If I run the executable as administrator, the Java process runs within the same process as the executable. Otherwise it spawns a new javaw process. I would like for the java process to always run in the same process as the executable.
How can I make the executable to not spawn new process for javaw?
Not sure if you found the answer to this as I begun using JSmooth but if you look under "Skeleton" and select "Windowed Wrapper", you will see the option to "Launch java app in the exe process" checkbox. I believe this is what you're looking for.
How can I run a separate process (the executable will be in the main bundle) on iOS? NSTask seems to be missing...
BTW I don't care if this will be rejected by Apple, as it will never be submitted.
There is no way to run a seperate process other than launching a process that can run in background from xcode or the home screen.
If you want process 1 to kick off process 2 then you're out of luck.
However, if you want process 1 to run in background and then process 2 to be launched later and communicate with process 1 (via memory-mapped files or network) then you can do that as xcode will allow you to run more than one application on the simulator at a time.
Alternatively, you can emulate a process via a thread but that depends on what you want to do.
If I F5 a Windows 8 JavaScript app and look at the processes pane in VS11, I see that it's WWAHOST.exe that I'm attached to. Is it possible to attach to this after the fact using Debug | Attach to Process? I don't see it in the process list even when I show processes from all users. I see the same thing whether I run locally or in the Simulator. Thanks.
There are effectively two ways to do this. Delay starting the app and attaching the app. You will need to install the remote debugger from Microsoft. As of this writing, it is located on http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=28973
Detailed steps plus explanations are here.
Summary:
Install VS remote tools
On start menu, launch "Debuggable Package Manager" (powershell will start)
using powershell: get-appxpackage (to locate your package)
using powershell: enable-appxdebug PackageFullName
Launch application
Attach to the correct wwahost.exe for your application.
Debugging Topics Located here.