sdk icon indicating copy to clipboard operation
sdk copied to clipboard

.net core 2.0 console app running on windows but failing on linux (RHEL7)

Open ms0713 opened this issue 9 years ago • 2 comments

Steps to reproduce

My .net core 2.0 console application runs properly in Windows OS. But I m having problem running it on RHEL7.

In my .sln file, I have 6-7 projects (.Net Stansard Library 2.0). Some projects depends on some other. But my solution file does not contain any word like postProject.

When I run following command, it gives no error and command prompt comes back without doing anything. Also it gives no error or nothing. $ dotnet AppName.dll 1 1 is command line argument.

My application uses SQL connection, Reflection, Third Party dlls( developed in c++), socket connection etc.

I also tried running a demo application with command line arguments, SQL connection. It works fine in RHEL7. My application dll has version like 1.2.3.4. While Publishing my code, it gives target runtime as Portable. But another sample with target runtime as Portable wotks fine in RHEL7.

What could be the problem? If you have any idea regarding this please share.

Expected behavior

It should successfully run on linux environment (RHEL7).

Actual behavior

While running from command promt it returns back to command prompt without giving any error.

Environment data

  1. Linux (RHEL 7).
  2. Code build through Visual Studio 2017 and published.
  3. One of the project reference third party dll, which is written in c++.
  4. It uses SQL connection, command line arguments, GC(Garbage Collector) related things, Socket connection, etc.
  5. It runs successfully on Windows Server 2012 R2 Standard edition.
  6. Demo application containing SQL, command line arguments works fiine on Linux.

Could it be a GC(Garbage Collector) related problem?

ms0713 avatar Nov 21 '17 05:11 ms0713

Try setting COREHOST_TRACE (export COREHOST_TRACE=1) and then running again. do you get extra output? You mention that a simple app does work. I would generally simplify your repro case until the app starts working to get an idea what the problem is.

danmoseley avatar Nov 21 '17 05:11 danmoseley

Also, sharing a repro would be super helpful as well. @danmosemsft's suggestion is also very good. Other than that, I would start taking things out of the application, publishing and running until I could get it working. You could also try debugging it using VS Code.

livarcocc avatar Nov 21 '17 17:11 livarcocc