© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
9 replies
Statharas

❔ Can't create Singleton terminal for dll output debugging

I need to create a CLI to output some debugging information from a DLL, but I am having some issues and I can't tell what's wrong, because on my current setup, I am unable to debug normally. (VSC on MacOS, building a .net standard 2.0 dll for an x86, 4.8.1 application running on VM Windows)

I was expecting this to work, but it doesn't

cs 
using System;
using System.Diagnostics;
using System.IO;

namespace Paradigm
{
    public class DebugConsole
    {
        private static DebugConsole instance = null;
        private static readonly object lockObject = new object();
        ProcessStartInfo psi;
        StreamWriter sw;
        StreamReader sr;
        private DebugConsole()
        {
            psi = new ProcessStartInfo("cmd.exe")
            {
                RedirectStandardError = true,
                RedirectStandardInput = true,
                RedirectStandardOutput = true,
                UseShellExecute = false
            };
            Process p = Process.Start(psi);

            sw = p.StandardInput;
            sr = p.StandardOutput;

        }

        public static DebugConsole Instance
        {
            get
            {
                lock (lockObject)
                {
                
cs 
using System;
using System.Diagnostics;
using System.IO;

namespace Paradigm
{
    public class DebugConsole
    {
        private static DebugConsole instance = null;
        private static readonly object lockObject = new object();
        ProcessStartInfo psi;
        StreamWriter sw;
        StreamReader sr;
        private DebugConsole()
        {
            psi = new ProcessStartInfo("cmd.exe")
            {
                RedirectStandardError = true,
                RedirectStandardInput = true,
                RedirectStandardOutput = true,
                UseShellExecute = false
            };
            Process p = Process.Start(psi);

            sw = p.StandardInput;
            sr = p.StandardOutput;

        }

        public static DebugConsole Instance
        {
            get
            {
                lock (lockObject)
                {
                


returning from lunch in ~30 minutes
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Help with terminal output
C#CC# / help
4y ago
❔ Can't find dll reference assemblies
C#CC# / help
3y ago
✅ No output in terminal using C# Dev Kit for VSCode
C#CC# / help
3y ago
Can not create Docker Image in Terminal using DockerFile
C#CC# / help
3y ago