Process.Start does not redirect message to the parent context hosted by docker? The Next CEO of Stack OverflowHow to get a Docker container's IP address from the host?How does one remove an image in Docker?Where are Docker images stored on the host machine?Copying files from Docker container to hostCopying files from host to Docker containerHow to copy Docker images from one host to another without using a repositoryHow to navigate to docker volumes folders on the host machineVSTS build fails when making a simple containerdocker dotnet error while copying csproj fileDocker Copy Command fails

Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?

forest, changing `s sep` such that it is at each second end node larger?

How do I get the green key off the shelf in the Dobby level of Lego Harry Potter 2?

If I blow insulation everywhere in my attic except the door trap, will heat escape through it?

Unreliable Magic - Is it worth it?

How do I go from 300 unfinished/half written blog posts, to published posts?

MAZDA 3 2006 (UK) - poor acceleration then takes off at 3250 revs

How long to clear the 'suck zone' of a turbofan after start is initiated?

How to make a variable always equal to the result of some calculations?

How to use tikz in fbox?

How to start emacs in "nothing" mode (`fundamental-mode`)

Describing a person. What needs to be mentioned?

Only print output after finding pattern

How do I construct this japanese bowl?

Return the Closest Prime Number

How should I support this large drywall patch?

Why do remote companies require working in the US?

How do I solve this limit?

What is the difference between "behavior" and "behaviour"?

Why here is plural "We went to the movies last night."

What is the point of a new vote on May's deal when the indicative votes suggest she will not win?

Why is there a PLL in CPU?

Trouble understanding the speech of overseas colleagues

Why didn't Khan get resurrected in the Genesis Explosion?



Process.Start does not redirect message to the parent context hosted by docker?



The Next CEO of Stack OverflowHow to get a Docker container's IP address from the host?How does one remove an image in Docker?Where are Docker images stored on the host machine?Copying files from Docker container to hostCopying files from host to Docker containerHow to copy Docker images from one host to another without using a repositoryHow to navigate to docker volumes folders on the host machineVSTS build fails when making a simple containerdocker dotnet error while copying csproj fileDocker Copy Command fails










2















This issues has taken me one day, really I just thought it's simple at first.



I have a host machine (Windows 10) with Docker desktop for Windows installed.
From the host machine, I would like to use docker run to start a container which contains some simple code to run.



Here is the code (which is built in the container), this is a .NET core Console app (suppose its built name is console.dll):



static void Main(string[] args)

Console.WriteLine("Running...");
_execTest();
Console.WriteLine("Finished!");
Console.ReadLine();

static void _execTest()

var sharedFilePath = Path.Combine(Environment.CurrentDirectory, "Temp", "test.exe");
var si = new ProcessStartInfo(sharedFilePath);

si.RedirectStandardOutput = false;
si.RedirectStandardError = false;
si.RedirectStandardInput = false;

Console.WriteLine("Starting ..." + sharedFilePath);
var p = Process.Start(si);
p.WaitForExit();



The main code is just to start another program named test.exe. This program is put in the shared folder Temp (which is established at the time calling docker run by mounting the folders between the host machine and the container).



Here is the code for the test.exe (which is just a .NET console app):



static void Main(string[] args)

Console.WriteLine("Something went wrong!");
Console.Write("Welldone!");



So I expect that all the messages written in test.exe using Console should be directed back to the parent context (which should use one same STDOUT).



I've tested the code by running the code for container directly using dotnet console.dll and I can see the messages (from test.exe) printed expectedly.



However after deploying the console.dll to an image (console) and try the following command to run the container:



docker run --rm -v D:SourceFolder:C:appTemp console


Then the messages (from test.exe) are not printed. Only the messages written directly in the parent context are printed (Running..., Starting... and Finished!).



You can see that the command above uses -v to mount the folder C:appTemp in container to the source folder D:SourceFolder in the host machine.
And the test.exe is put in D:SourceFolder.
I'm sure that the container's code can access this file via the shared folder.



This is so weird and hard to diagnose.
Without sharing messages back and forth between the container and the host, running docker like this is just useless.



I hope someone here could give me some some suggestion so that I can try and sort this out. Thanks!



UPDATE:
If I use cmd.exe (which is already existed in the docker image) with argument of /?, then I can see the output of it. So looks like this is some problem of executing an EXE shared via folder.



However I've tried copying the shared file to the some local folder of the container first and run that file instead but still the same issue. So looks like it may be the problem of the test.exe file itself? so ridiculous.



UPDATE: thanks to @jazzdelightsme for his helpful suggestion about checking the ExitCode, so actually the environment in the container has something missing that cannot start the test.exe correctly. I've tried compiling the test.exe targeting the lowest .NET Framework version 2.0 but still that same error. Here is Dockerfile's content which should provide some info about the container's environment:



FROM microsoft/dotnet:2.1-runtime-nanoserver-1709 AS base
WORKDIR /app

FROM microsoft/dotnet:2.1-sdk-nanoserver-1709 AS build
WORKDIR /src
COPY ConsoleApp/ConsoleApp.csproj ConsoleApp/
RUN dotnet restore ConsoleApp/ConsoleApp.csproj
COPY . .
WORKDIR /src/ConsoleApp
RUN dotnet build ConsoleApp.csproj -c Release -o /app

FROM build AS publish
RUN dotnet publish ConsoleApp.csproj -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ConsoleApp.dll"]









share|improve this question



















  • 1





    What is the exit code of the test.exe process (p.ExitCode, I think)? That might give you a clue. Perhaps a missing dependency, so it doesn't run at all... I would try running a container interactively (-it) and debug that way (for instance, you could launch under ntsd if you needed).

    – jazzdelightsme
    Mar 20 at 15:59











  • @jazzdelightsme well, when executing directly (with messages printed) the ExitCode is 0 but when it not printed, the ExitCode is -1073741515. Looks like that's the problem, I've also tried the option -it but it had no help. I don't know about ntsd, if possible please give me more info. Thank you for your helpful suggestion.

    – Hopeless
    Mar 20 at 21:56











  • That error code is STATUS_DLL_NOT_FOUND. Ntsd is a command-line debugger; and actually you should use cdb, not ntsd (the only difference is that ntsd will launch a new console window, but you don't want that). Info about how to get it here. You can "xcopy" them into the container. Command line should be something like C:debuggerscdb.exe -xe "ld ntdll" test.exe. When it breaks in, run !gflag +sls to turn on loader snaps, then run g to execute. Examine spew to find missing DLL.

    – jazzdelightsme
    Mar 21 at 15:50











  • Oh, if test.exe is a .NET Framework app (as opposed to .NET Core), then I bet that's the problem. I don't think nanoserver has the full .NET Framework.

    – jazzdelightsme
    Mar 21 at 15:53











  • @jazzdelightsme yes, actually I found out that thanks to your comments. If you add an answer, I'll accept it. Thank you! Now I'm trying to prepare a docker image installed with both .Net core and .NET framework.

    – Hopeless
    Mar 21 at 15:59
















2















This issues has taken me one day, really I just thought it's simple at first.



I have a host machine (Windows 10) with Docker desktop for Windows installed.
From the host machine, I would like to use docker run to start a container which contains some simple code to run.



Here is the code (which is built in the container), this is a .NET core Console app (suppose its built name is console.dll):



static void Main(string[] args)

Console.WriteLine("Running...");
_execTest();
Console.WriteLine("Finished!");
Console.ReadLine();

static void _execTest()

var sharedFilePath = Path.Combine(Environment.CurrentDirectory, "Temp", "test.exe");
var si = new ProcessStartInfo(sharedFilePath);

si.RedirectStandardOutput = false;
si.RedirectStandardError = false;
si.RedirectStandardInput = false;

Console.WriteLine("Starting ..." + sharedFilePath);
var p = Process.Start(si);
p.WaitForExit();



The main code is just to start another program named test.exe. This program is put in the shared folder Temp (which is established at the time calling docker run by mounting the folders between the host machine and the container).



Here is the code for the test.exe (which is just a .NET console app):



static void Main(string[] args)

Console.WriteLine("Something went wrong!");
Console.Write("Welldone!");



So I expect that all the messages written in test.exe using Console should be directed back to the parent context (which should use one same STDOUT).



I've tested the code by running the code for container directly using dotnet console.dll and I can see the messages (from test.exe) printed expectedly.



However after deploying the console.dll to an image (console) and try the following command to run the container:



docker run --rm -v D:SourceFolder:C:appTemp console


Then the messages (from test.exe) are not printed. Only the messages written directly in the parent context are printed (Running..., Starting... and Finished!).



You can see that the command above uses -v to mount the folder C:appTemp in container to the source folder D:SourceFolder in the host machine.
And the test.exe is put in D:SourceFolder.
I'm sure that the container's code can access this file via the shared folder.



This is so weird and hard to diagnose.
Without sharing messages back and forth between the container and the host, running docker like this is just useless.



I hope someone here could give me some some suggestion so that I can try and sort this out. Thanks!



UPDATE:
If I use cmd.exe (which is already existed in the docker image) with argument of /?, then I can see the output of it. So looks like this is some problem of executing an EXE shared via folder.



However I've tried copying the shared file to the some local folder of the container first and run that file instead but still the same issue. So looks like it may be the problem of the test.exe file itself? so ridiculous.



UPDATE: thanks to @jazzdelightsme for his helpful suggestion about checking the ExitCode, so actually the environment in the container has something missing that cannot start the test.exe correctly. I've tried compiling the test.exe targeting the lowest .NET Framework version 2.0 but still that same error. Here is Dockerfile's content which should provide some info about the container's environment:



FROM microsoft/dotnet:2.1-runtime-nanoserver-1709 AS base
WORKDIR /app

FROM microsoft/dotnet:2.1-sdk-nanoserver-1709 AS build
WORKDIR /src
COPY ConsoleApp/ConsoleApp.csproj ConsoleApp/
RUN dotnet restore ConsoleApp/ConsoleApp.csproj
COPY . .
WORKDIR /src/ConsoleApp
RUN dotnet build ConsoleApp.csproj -c Release -o /app

FROM build AS publish
RUN dotnet publish ConsoleApp.csproj -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ConsoleApp.dll"]









share|improve this question



















  • 1





    What is the exit code of the test.exe process (p.ExitCode, I think)? That might give you a clue. Perhaps a missing dependency, so it doesn't run at all... I would try running a container interactively (-it) and debug that way (for instance, you could launch under ntsd if you needed).

    – jazzdelightsme
    Mar 20 at 15:59











  • @jazzdelightsme well, when executing directly (with messages printed) the ExitCode is 0 but when it not printed, the ExitCode is -1073741515. Looks like that's the problem, I've also tried the option -it but it had no help. I don't know about ntsd, if possible please give me more info. Thank you for your helpful suggestion.

    – Hopeless
    Mar 20 at 21:56











  • That error code is STATUS_DLL_NOT_FOUND. Ntsd is a command-line debugger; and actually you should use cdb, not ntsd (the only difference is that ntsd will launch a new console window, but you don't want that). Info about how to get it here. You can "xcopy" them into the container. Command line should be something like C:debuggerscdb.exe -xe "ld ntdll" test.exe. When it breaks in, run !gflag +sls to turn on loader snaps, then run g to execute. Examine spew to find missing DLL.

    – jazzdelightsme
    Mar 21 at 15:50











  • Oh, if test.exe is a .NET Framework app (as opposed to .NET Core), then I bet that's the problem. I don't think nanoserver has the full .NET Framework.

    – jazzdelightsme
    Mar 21 at 15:53











  • @jazzdelightsme yes, actually I found out that thanks to your comments. If you add an answer, I'll accept it. Thank you! Now I'm trying to prepare a docker image installed with both .Net core and .NET framework.

    – Hopeless
    Mar 21 at 15:59














2












2








2








This issues has taken me one day, really I just thought it's simple at first.



I have a host machine (Windows 10) with Docker desktop for Windows installed.
From the host machine, I would like to use docker run to start a container which contains some simple code to run.



Here is the code (which is built in the container), this is a .NET core Console app (suppose its built name is console.dll):



static void Main(string[] args)

Console.WriteLine("Running...");
_execTest();
Console.WriteLine("Finished!");
Console.ReadLine();

static void _execTest()

var sharedFilePath = Path.Combine(Environment.CurrentDirectory, "Temp", "test.exe");
var si = new ProcessStartInfo(sharedFilePath);

si.RedirectStandardOutput = false;
si.RedirectStandardError = false;
si.RedirectStandardInput = false;

Console.WriteLine("Starting ..." + sharedFilePath);
var p = Process.Start(si);
p.WaitForExit();



The main code is just to start another program named test.exe. This program is put in the shared folder Temp (which is established at the time calling docker run by mounting the folders between the host machine and the container).



Here is the code for the test.exe (which is just a .NET console app):



static void Main(string[] args)

Console.WriteLine("Something went wrong!");
Console.Write("Welldone!");



So I expect that all the messages written in test.exe using Console should be directed back to the parent context (which should use one same STDOUT).



I've tested the code by running the code for container directly using dotnet console.dll and I can see the messages (from test.exe) printed expectedly.



However after deploying the console.dll to an image (console) and try the following command to run the container:



docker run --rm -v D:SourceFolder:C:appTemp console


Then the messages (from test.exe) are not printed. Only the messages written directly in the parent context are printed (Running..., Starting... and Finished!).



You can see that the command above uses -v to mount the folder C:appTemp in container to the source folder D:SourceFolder in the host machine.
And the test.exe is put in D:SourceFolder.
I'm sure that the container's code can access this file via the shared folder.



This is so weird and hard to diagnose.
Without sharing messages back and forth between the container and the host, running docker like this is just useless.



I hope someone here could give me some some suggestion so that I can try and sort this out. Thanks!



UPDATE:
If I use cmd.exe (which is already existed in the docker image) with argument of /?, then I can see the output of it. So looks like this is some problem of executing an EXE shared via folder.



However I've tried copying the shared file to the some local folder of the container first and run that file instead but still the same issue. So looks like it may be the problem of the test.exe file itself? so ridiculous.



UPDATE: thanks to @jazzdelightsme for his helpful suggestion about checking the ExitCode, so actually the environment in the container has something missing that cannot start the test.exe correctly. I've tried compiling the test.exe targeting the lowest .NET Framework version 2.0 but still that same error. Here is Dockerfile's content which should provide some info about the container's environment:



FROM microsoft/dotnet:2.1-runtime-nanoserver-1709 AS base
WORKDIR /app

FROM microsoft/dotnet:2.1-sdk-nanoserver-1709 AS build
WORKDIR /src
COPY ConsoleApp/ConsoleApp.csproj ConsoleApp/
RUN dotnet restore ConsoleApp/ConsoleApp.csproj
COPY . .
WORKDIR /src/ConsoleApp
RUN dotnet build ConsoleApp.csproj -c Release -o /app

FROM build AS publish
RUN dotnet publish ConsoleApp.csproj -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ConsoleApp.dll"]









share|improve this question
















This issues has taken me one day, really I just thought it's simple at first.



I have a host machine (Windows 10) with Docker desktop for Windows installed.
From the host machine, I would like to use docker run to start a container which contains some simple code to run.



Here is the code (which is built in the container), this is a .NET core Console app (suppose its built name is console.dll):



static void Main(string[] args)

Console.WriteLine("Running...");
_execTest();
Console.WriteLine("Finished!");
Console.ReadLine();

static void _execTest()

var sharedFilePath = Path.Combine(Environment.CurrentDirectory, "Temp", "test.exe");
var si = new ProcessStartInfo(sharedFilePath);

si.RedirectStandardOutput = false;
si.RedirectStandardError = false;
si.RedirectStandardInput = false;

Console.WriteLine("Starting ..." + sharedFilePath);
var p = Process.Start(si);
p.WaitForExit();



The main code is just to start another program named test.exe. This program is put in the shared folder Temp (which is established at the time calling docker run by mounting the folders between the host machine and the container).



Here is the code for the test.exe (which is just a .NET console app):



static void Main(string[] args)

Console.WriteLine("Something went wrong!");
Console.Write("Welldone!");



So I expect that all the messages written in test.exe using Console should be directed back to the parent context (which should use one same STDOUT).



I've tested the code by running the code for container directly using dotnet console.dll and I can see the messages (from test.exe) printed expectedly.



However after deploying the console.dll to an image (console) and try the following command to run the container:



docker run --rm -v D:SourceFolder:C:appTemp console


Then the messages (from test.exe) are not printed. Only the messages written directly in the parent context are printed (Running..., Starting... and Finished!).



You can see that the command above uses -v to mount the folder C:appTemp in container to the source folder D:SourceFolder in the host machine.
And the test.exe is put in D:SourceFolder.
I'm sure that the container's code can access this file via the shared folder.



This is so weird and hard to diagnose.
Without sharing messages back and forth between the container and the host, running docker like this is just useless.



I hope someone here could give me some some suggestion so that I can try and sort this out. Thanks!



UPDATE:
If I use cmd.exe (which is already existed in the docker image) with argument of /?, then I can see the output of it. So looks like this is some problem of executing an EXE shared via folder.



However I've tried copying the shared file to the some local folder of the container first and run that file instead but still the same issue. So looks like it may be the problem of the test.exe file itself? so ridiculous.



UPDATE: thanks to @jazzdelightsme for his helpful suggestion about checking the ExitCode, so actually the environment in the container has something missing that cannot start the test.exe correctly. I've tried compiling the test.exe targeting the lowest .NET Framework version 2.0 but still that same error. Here is Dockerfile's content which should provide some info about the container's environment:



FROM microsoft/dotnet:2.1-runtime-nanoserver-1709 AS base
WORKDIR /app

FROM microsoft/dotnet:2.1-sdk-nanoserver-1709 AS build
WORKDIR /src
COPY ConsoleApp/ConsoleApp.csproj ConsoleApp/
RUN dotnet restore ConsoleApp/ConsoleApp.csproj
COPY . .
WORKDIR /src/ConsoleApp
RUN dotnet build ConsoleApp.csproj -c Release -o /app

FROM build AS publish
RUN dotnet publish ConsoleApp.csproj -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ConsoleApp.dll"]






c# windows docker stdout docker-container






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 20 at 22:02







Hopeless

















asked Mar 20 at 10:41









HopelessHopeless

1,97221729




1,97221729







  • 1





    What is the exit code of the test.exe process (p.ExitCode, I think)? That might give you a clue. Perhaps a missing dependency, so it doesn't run at all... I would try running a container interactively (-it) and debug that way (for instance, you could launch under ntsd if you needed).

    – jazzdelightsme
    Mar 20 at 15:59











  • @jazzdelightsme well, when executing directly (with messages printed) the ExitCode is 0 but when it not printed, the ExitCode is -1073741515. Looks like that's the problem, I've also tried the option -it but it had no help. I don't know about ntsd, if possible please give me more info. Thank you for your helpful suggestion.

    – Hopeless
    Mar 20 at 21:56











  • That error code is STATUS_DLL_NOT_FOUND. Ntsd is a command-line debugger; and actually you should use cdb, not ntsd (the only difference is that ntsd will launch a new console window, but you don't want that). Info about how to get it here. You can "xcopy" them into the container. Command line should be something like C:debuggerscdb.exe -xe "ld ntdll" test.exe. When it breaks in, run !gflag +sls to turn on loader snaps, then run g to execute. Examine spew to find missing DLL.

    – jazzdelightsme
    Mar 21 at 15:50











  • Oh, if test.exe is a .NET Framework app (as opposed to .NET Core), then I bet that's the problem. I don't think nanoserver has the full .NET Framework.

    – jazzdelightsme
    Mar 21 at 15:53











  • @jazzdelightsme yes, actually I found out that thanks to your comments. If you add an answer, I'll accept it. Thank you! Now I'm trying to prepare a docker image installed with both .Net core and .NET framework.

    – Hopeless
    Mar 21 at 15:59













  • 1





    What is the exit code of the test.exe process (p.ExitCode, I think)? That might give you a clue. Perhaps a missing dependency, so it doesn't run at all... I would try running a container interactively (-it) and debug that way (for instance, you could launch under ntsd if you needed).

    – jazzdelightsme
    Mar 20 at 15:59











  • @jazzdelightsme well, when executing directly (with messages printed) the ExitCode is 0 but when it not printed, the ExitCode is -1073741515. Looks like that's the problem, I've also tried the option -it but it had no help. I don't know about ntsd, if possible please give me more info. Thank you for your helpful suggestion.

    – Hopeless
    Mar 20 at 21:56











  • That error code is STATUS_DLL_NOT_FOUND. Ntsd is a command-line debugger; and actually you should use cdb, not ntsd (the only difference is that ntsd will launch a new console window, but you don't want that). Info about how to get it here. You can "xcopy" them into the container. Command line should be something like C:debuggerscdb.exe -xe "ld ntdll" test.exe. When it breaks in, run !gflag +sls to turn on loader snaps, then run g to execute. Examine spew to find missing DLL.

    – jazzdelightsme
    Mar 21 at 15:50











  • Oh, if test.exe is a .NET Framework app (as opposed to .NET Core), then I bet that's the problem. I don't think nanoserver has the full .NET Framework.

    – jazzdelightsme
    Mar 21 at 15:53











  • @jazzdelightsme yes, actually I found out that thanks to your comments. If you add an answer, I'll accept it. Thank you! Now I'm trying to prepare a docker image installed with both .Net core and .NET framework.

    – Hopeless
    Mar 21 at 15:59








1




1





What is the exit code of the test.exe process (p.ExitCode, I think)? That might give you a clue. Perhaps a missing dependency, so it doesn't run at all... I would try running a container interactively (-it) and debug that way (for instance, you could launch under ntsd if you needed).

– jazzdelightsme
Mar 20 at 15:59





What is the exit code of the test.exe process (p.ExitCode, I think)? That might give you a clue. Perhaps a missing dependency, so it doesn't run at all... I would try running a container interactively (-it) and debug that way (for instance, you could launch under ntsd if you needed).

– jazzdelightsme
Mar 20 at 15:59













@jazzdelightsme well, when executing directly (with messages printed) the ExitCode is 0 but when it not printed, the ExitCode is -1073741515. Looks like that's the problem, I've also tried the option -it but it had no help. I don't know about ntsd, if possible please give me more info. Thank you for your helpful suggestion.

– Hopeless
Mar 20 at 21:56





@jazzdelightsme well, when executing directly (with messages printed) the ExitCode is 0 but when it not printed, the ExitCode is -1073741515. Looks like that's the problem, I've also tried the option -it but it had no help. I don't know about ntsd, if possible please give me more info. Thank you for your helpful suggestion.

– Hopeless
Mar 20 at 21:56













That error code is STATUS_DLL_NOT_FOUND. Ntsd is a command-line debugger; and actually you should use cdb, not ntsd (the only difference is that ntsd will launch a new console window, but you don't want that). Info about how to get it here. You can "xcopy" them into the container. Command line should be something like C:debuggerscdb.exe -xe "ld ntdll" test.exe. When it breaks in, run !gflag +sls to turn on loader snaps, then run g to execute. Examine spew to find missing DLL.

– jazzdelightsme
Mar 21 at 15:50





That error code is STATUS_DLL_NOT_FOUND. Ntsd is a command-line debugger; and actually you should use cdb, not ntsd (the only difference is that ntsd will launch a new console window, but you don't want that). Info about how to get it here. You can "xcopy" them into the container. Command line should be something like C:debuggerscdb.exe -xe "ld ntdll" test.exe. When it breaks in, run !gflag +sls to turn on loader snaps, then run g to execute. Examine spew to find missing DLL.

– jazzdelightsme
Mar 21 at 15:50













Oh, if test.exe is a .NET Framework app (as opposed to .NET Core), then I bet that's the problem. I don't think nanoserver has the full .NET Framework.

– jazzdelightsme
Mar 21 at 15:53





Oh, if test.exe is a .NET Framework app (as opposed to .NET Core), then I bet that's the problem. I don't think nanoserver has the full .NET Framework.

– jazzdelightsme
Mar 21 at 15:53













@jazzdelightsme yes, actually I found out that thanks to your comments. If you add an answer, I'll accept it. Thank you! Now I'm trying to prepare a docker image installed with both .Net core and .NET framework.

– Hopeless
Mar 21 at 15:59






@jazzdelightsme yes, actually I found out that thanks to your comments. If you add an answer, I'll accept it. Thank you! Now I'm trying to prepare a docker image installed with both .Net core and .NET framework.

– Hopeless
Mar 21 at 15:59













1 Answer
1






active

oldest

votes


















1














A general troubleshooting thing to check is the exit code of the process. This will often give a clue what the problem is.



In this case, the exit code was STATUS_DLL_NOT_FOUND. This alone may be enough of a clue if you understand your app's dependencies, because you can just manually examine the container and figure out what is missing.



If you don't know what is missing, a direct way to debug is by using the Windows Debuggers and turning on "Show Loader Snaps". Info about getting Windows Debuggers here. You can xcopy them into the container. You would use a command line like C:Debuggerscdb.exe -xe "ld ntdll" test.exe, which launches test.exe under the debugger, stopping as soon as ntdll.dll is loaded (which is earlier than normal). Once it stops, you run !gflag +sls to turn on loader snaps, then run g to continue execution. Examining the spew should tell you what is missing or failing to load.



In this particular case, STATUS_DLL_NOT_FOUND is likely because test.exe is a .NET Framework app, but the full .NET Framework is not present in the nanoserver image.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55258824%2fprocess-start-does-not-redirect-message-to-the-parent-context-hosted-by-docker%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    A general troubleshooting thing to check is the exit code of the process. This will often give a clue what the problem is.



    In this case, the exit code was STATUS_DLL_NOT_FOUND. This alone may be enough of a clue if you understand your app's dependencies, because you can just manually examine the container and figure out what is missing.



    If you don't know what is missing, a direct way to debug is by using the Windows Debuggers and turning on "Show Loader Snaps". Info about getting Windows Debuggers here. You can xcopy them into the container. You would use a command line like C:Debuggerscdb.exe -xe "ld ntdll" test.exe, which launches test.exe under the debugger, stopping as soon as ntdll.dll is loaded (which is earlier than normal). Once it stops, you run !gflag +sls to turn on loader snaps, then run g to continue execution. Examining the spew should tell you what is missing or failing to load.



    In this particular case, STATUS_DLL_NOT_FOUND is likely because test.exe is a .NET Framework app, but the full .NET Framework is not present in the nanoserver image.






    share|improve this answer



























      1














      A general troubleshooting thing to check is the exit code of the process. This will often give a clue what the problem is.



      In this case, the exit code was STATUS_DLL_NOT_FOUND. This alone may be enough of a clue if you understand your app's dependencies, because you can just manually examine the container and figure out what is missing.



      If you don't know what is missing, a direct way to debug is by using the Windows Debuggers and turning on "Show Loader Snaps". Info about getting Windows Debuggers here. You can xcopy them into the container. You would use a command line like C:Debuggerscdb.exe -xe "ld ntdll" test.exe, which launches test.exe under the debugger, stopping as soon as ntdll.dll is loaded (which is earlier than normal). Once it stops, you run !gflag +sls to turn on loader snaps, then run g to continue execution. Examining the spew should tell you what is missing or failing to load.



      In this particular case, STATUS_DLL_NOT_FOUND is likely because test.exe is a .NET Framework app, but the full .NET Framework is not present in the nanoserver image.






      share|improve this answer

























        1












        1








        1







        A general troubleshooting thing to check is the exit code of the process. This will often give a clue what the problem is.



        In this case, the exit code was STATUS_DLL_NOT_FOUND. This alone may be enough of a clue if you understand your app's dependencies, because you can just manually examine the container and figure out what is missing.



        If you don't know what is missing, a direct way to debug is by using the Windows Debuggers and turning on "Show Loader Snaps". Info about getting Windows Debuggers here. You can xcopy them into the container. You would use a command line like C:Debuggerscdb.exe -xe "ld ntdll" test.exe, which launches test.exe under the debugger, stopping as soon as ntdll.dll is loaded (which is earlier than normal). Once it stops, you run !gflag +sls to turn on loader snaps, then run g to continue execution. Examining the spew should tell you what is missing or failing to load.



        In this particular case, STATUS_DLL_NOT_FOUND is likely because test.exe is a .NET Framework app, but the full .NET Framework is not present in the nanoserver image.






        share|improve this answer













        A general troubleshooting thing to check is the exit code of the process. This will often give a clue what the problem is.



        In this case, the exit code was STATUS_DLL_NOT_FOUND. This alone may be enough of a clue if you understand your app's dependencies, because you can just manually examine the container and figure out what is missing.



        If you don't know what is missing, a direct way to debug is by using the Windows Debuggers and turning on "Show Loader Snaps". Info about getting Windows Debuggers here. You can xcopy them into the container. You would use a command line like C:Debuggerscdb.exe -xe "ld ntdll" test.exe, which launches test.exe under the debugger, stopping as soon as ntdll.dll is loaded (which is earlier than normal). Once it stops, you run !gflag +sls to turn on loader snaps, then run g to continue execution. Examining the spew should tell you what is missing or failing to load.



        In this particular case, STATUS_DLL_NOT_FOUND is likely because test.exe is a .NET Framework app, but the full .NET Framework is not present in the nanoserver image.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 21 at 16:28









        jazzdelightsmejazzdelightsme

        347112




        347112





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55258824%2fprocess-start-does-not-redirect-message-to-the-parent-context-hosted-by-docker%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현