All Questions
796
questions
86
votes
4
answers
77k
views
Can WPF applications be run in Linux or Mac with .Net Core 3?
Microsoft announced .NET Core 3 comes with WPF and Windows Forms. So can I create a desktop application for Linux or Mac using .NET Core 3?
63
votes
1
answer
10k
views
Dotnet Core Docker Container Leaks RAM on Linux and causes OOM
I am running Dotnet Core 2.2 in a Linux container in Docker.
I've tried many different configuration/environment options - but I keep coming back to the same problem of running out of memory ('docker ...
61
votes
9
answers
62k
views
Cross-platform file name handling in .NET Core
How to handle file name in System.IO classes in a cross-platform manner to make it work on Windows and Linux?
For example, I write this code that works perfectly on Windows, however it doesn't create ...
57
votes
5
answers
137k
views
How to compile .NET Core app for Linux on a Windows machine
I'm developing a .NET Core app on a Windows 10 machine (with Visual Studio 2015 update 3 + Microsoft .NET Core 1.0.1 VS 2015 Tooling Preview 2) which should published on an Ubuntu 16 machine. To do ...
47
votes
11
answers
71k
views
Unable to start Kestrel. System.IO.IOException: Failed to bind to address http://127.0.0.1:5000: address already in use
I followed the steps from this URL to publish .NET core 2.1 web application code to Linux Centos 7 server.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2....
46
votes
2
answers
30k
views
Killing gracefully a .NET Core daemon running on Linux
I created a .NET Core console application running as a daemon on a Ubuntu 14.04 machine.
I want to stop the service without forcing it, being able to handle a kill event.
How can I achieve this?
37
votes
4
answers
19k
views
What is the story of Performance Counters for .NET Core?
Under Windows, one is able to read .NET performance counters using the following:
Performance Monitor
C# using PerformanceCounter
WMI and querying the .NET related classes
Considering the recent ...
33
votes
1
answer
1k
views
Open .NET Core 2.0 dump in lldb on Linux - which lldb version?
I'm trying to open a .NET Core 2.0 dump on Ubuntu 16.04, following instructions from http://blogs.microsoft.co.il/sasha/2017/02/26/analyzing-a-net-core-core-dump-on-linux/
Dump is created from ...
27
votes
3
answers
14k
views
How to get the current operating system in MSBuild?
I have a .NET Core 1.1 console project created with Visual Studio 2017.
After building the project, I need to run a powershell script so I added the following to the MyProject.csproj file:
<Target ...
27
votes
4
answers
9k
views
How to Dump a .NET Core Application on Linux
I have a .NET application that I have ported to .NET Core. I am testing it on Ubuntu 14.04.
I am trying to figure out how to get a .dmp file or the Linux equivalent when the program crashes. I call ...
26
votes
8
answers
46k
views
How to remove previous versions of .NET Core from Linux (CentOS 7.1)
I would like to install the current version Core 1.0. Currently the RC2 version is installed. The instruction on the official website are:
Before you start, please remove any previous versions of ....
26
votes
1
answer
13k
views
Why FileSystemWatcher doesn't work in Linux container watching Windows volume
Given the program:
using System;
using System.IO;
namespace fsw_bug_poc
{
class Program
{
private static FileSystemWatcher _fileSystemWatcher;
static void Main(string[] args)...
25
votes
2
answers
23k
views
How to create executable console app from .NET Core 2.0 in Linux?
As far as I know in the https://www.microsoft.com/net/learn/get-started/macos, we only able to run it:
$ dotnet run
I have a requirement to create a console app that we execute from a terminal as ...
24
votes
2
answers
9k
views
Build NuGet package on Linux that targets .NET Framework
I want to create a NuGet package that can simultaneously and explicitly target both .NET Framework 4.6.2 and .Net Standard 1.5. Here's an abbreviated .csproj file from VS 2017:
<Project Sdk="...
24
votes
1
answer
87k
views
Where to get msbuild for Linux [duplicate]
I want to build a .net core project on Windows and Linux.
For Windows I use MSBuild, simply downloaded the Build Tools für Visual Studio 2017 from visualstudio.com.
But where do I get MSBuild for ...
24
votes
2
answers
7k
views
.Net Core Process.Start on Linux
I am facing the following issue when running my .Net Core application on Linux.
Here is the exception:
System.ComponentModel.Win32Exception (0x80004005): Permission denied
at Interop.Sys....
23
votes
1
answer
10k
views
.Net Core Machine Key alternative for webfarm
I have been using dotnet core to create an application that runs in a Kubernetes cluster on Linux hosts. As I was testing it noticed getting exceptions when validating the CSRF tokens, that makes ...
23
votes
2
answers
3k
views
How to run F# interactive (fsi.exe) in dotnet core? Is it supported yet?
I cannot run find/run fsi.exe either in windows or linux on dotnetcore. It is nowhere to be found. Maybe it is not supported yet?
21
votes
6
answers
12k
views
How to write a linux daemon with .Net Core
I could just write a long-running CLI app and run it, but I'm assuming it wouldn't comply to all the expectations one would have of a standards-compliant linux daemon (responding to SIGTERM, Started ...
21
votes
2
answers
37k
views
Stop a running dotnet core website running on kestrel
When deploying a new version of an existing .net core website. How do I first safely stop the old running kestrel app?
Here is an exmaple of what I would like to write (Pseudo deployment script):
...
20
votes
2
answers
11k
views
Get .NET Core DLL version on Linux
I have a .NET Core app which sets metadata properties during build, using standard options in the .csproj:
<Project>
<PropertyGroup>
<Product>MyCoolProduct</Product>
...
19
votes
3
answers
14k
views
Is Microsoft SQL Server Express available for production in Linux?
I'm trying to publish my ASP.NET Core app to Linux for production. My question is, is Microsoft SQL Server Express available for production in Linux? Or do I have to use the paid version?
19
votes
2
answers
2k
views
.NET Core: Finally block not called on unhandled exception on Linux
I have created the following C# program:
namespace dispose_test
{
class Program
{
static void Main(string[] args)
{
using (var disp = new MyDisposable())
...
18
votes
2
answers
3k
views
Is there F# Interactive for Linux on .NET Core, without using Mono?
I'm able to build and run F# projects with .NET Core, but unable to use or see F# Interactive with it. Is it on the roadmap somewhere?
I'm using Linux Mint 18.3
17
votes
3
answers
9k
views
.net-core: Equivalent of ILDASM / ILASM
Is there the equivalent of ILDASM / ILASM for the .net-core?
Specifically, I'm looking for something that runs on Linux (Hence why the .net-core).
16
votes
8
answers
16k
views
How to install dotnet SDK on Ubuntu 16.04 LTS
I have been following the instructions provided here:
https://learn.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x
However, I keep getting the error when I try to run"
sudo apt-...
16
votes
3
answers
21k
views
dotnet-install.sh not adding dotnet command on Ubuntu
I am not a Linux user so this might be a easy fix but I have tried the following:
first I install it using the command curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin for which I get ...
16
votes
2
answers
25k
views
Is there any .NET Core compatible library for reading excel spreadsheet file? [closed]
I need to parse xlsx file on Linux from .NET Core Console application. However, I couldn't find any library for parsing Microsoft Office files that is supported by .NET Core 5 framework.
15
votes
6
answers
22k
views
Kestrel error: address already in use (dotnet core)
Summary: it works as dotnet run, but it doesn't work as dotnet myappname.dll.
My linux skills are limited, but I am trying to go by the book so I don't mix things up (following this tutorial from ...
14
votes
2
answers
21k
views
debug a dotnet core program in terminal
I’ve recently setup omnisharp with nvim and wanted to try to develope a dotnet core application without the help of VS/rider/vs code.
Now i tried to google around but couldn’t find any real way to ...
14
votes
1
answer
7k
views
Control lifetime of .NET Core console application hosted in docker
Disclaimer - this is almost the same question as docker container exits immediately even with Console.ReadLine() in a .net core console application - but I don't think accepted answer on this question ...
14
votes
2
answers
6k
views
Capture shutdown command for graceful close in .NET Core
I'm porting to .NET core and the existing app has hooked the win32 call SetConsoleCtrlHandler to capture application close so that it can cleanly close off open database files and other orderly ...
13
votes
4
answers
25k
views
LDAP with dotnet core under Linux
I am developing an application based on .net core (2.2.103) which must connect to an LDAP server. On my development machine running Windows, I used the System.DirectoryServices namespace to do so.
...
12
votes
4
answers
27k
views
How can I run a dotnet application in the background using sudo on Linux? [duplicate]
I am experiencing some weird problems that I'm not sure how to solve. I am using CodeDeploy to deploy my applications to an AWS EC2 instance, and in there I need to specify a script to execute the ...
12
votes
2
answers
1k
views
Call matlab shared library from dotnet core on linux
I am trying to call a shared library created with MathWorks MATLAB Compiler SDK from C# (.NET Core) running on a Linux container.
I have a matlab .m file that I've compiled into a .dll using the ...
11
votes
2
answers
10k
views
Publish ASP.NET Core from Visual Studio to Linux
Can I edit a ASP.NET Core application in Visual Studio and deploy to Linux server (e.g., Ubuntu)?
10
votes
2
answers
3k
views
How do I handle ValidateAntiForgeryToken across linux servers
I have deployed an asp.net core app on some load balanced linux servers. I getting an error when POSTing a form to a route due to a failing ValidateAntiForgeryToken attribute (if a POST does not go ...
10
votes
2
answers
1k
views
Can't read certificate when running in Linux Docker container - works on Windows
I'm trying to read information from an SSL certificate (in this case I've saved a copy of StackOverflow's via Chrome) but for some reason the moment I build it and run it from within a Linux Docker ...
10
votes
2
answers
2k
views
DotNetCore: cross platform version of GetInvalidFileNameChars?
I'm building a .Net Core 2.0 console application that will run on both Windows and Ubuntu systems. I have a string that needs to be converted into a safe file name. Currently I'm using the following ...
10
votes
2
answers
6k
views
Copy file from linux to windows share with C# (.NET core)
I'm using .NET core for an application running on a Linux machine (a docker container, to be exact)
How can I copy a binary file from there to a windows network share (including username & ...
10
votes
1
answer
1k
views
.Net Core DebugDiag Equivalent
For .Net 4.6.x, I have heavily relied upon DebugDiag 2
Anytime Production applications had high CPU issues, deadlocks, etc, I would use that tool to capture dumps of w3svc and it prints out a nice ...
9
votes
3
answers
5k
views
How to build multi-target solution on .NET Core on Mac or linux?
I have solution with multi-targeted csproj files:
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.6</TargetFrameworks>
</PropertyGroup>
or
<PropertyGroup>
&...
9
votes
1
answer
14k
views
Is there a Linux equivalent of DllImport in .NET Core?
I am working on a .NET Core project. This should run on Linux without problems. However, I need to call a library that has been created with C++. Traditionally, C# developers do this with DllImport&...
9
votes
2
answers
7k
views
Is Visual Basic supported by .NET Core on Linux?
I have searched all Microsoft documentation and I can't find anything that explicitly states whether Visual Basic is supported by .NET Core on Linux. So, does .NET Core on Linux support Visual Basic ...
9
votes
0
answers
960
views
F# project with typeprovider using dotnet-core in linux, FSharp.Data.DesignTime.dll error
I am trying to create a dotnet-core F# project with FSharp.Data (the standard typeprovider library) as dependency under linux.
I've created a project using the command dotnet new -l F# and added ...
8
votes
2
answers
19k
views
How can I log messages from an ASP.NET Core application to a specific file on Linux?
I installed an ASP.NET Core application as a Linux daemon. By default .NET writes logs into /var/log/message but I would like the application to write its logs in a specific file and store it ...
8
votes
1
answer
3k
views
How do you create a Linux daemon from a .NET Core console application?
I'm used to creating Windows services using Topshelf. With .NET Core and the prospect of going cross-platform, this raises a number of interesting scenarios:
Given that Topshelf does not yet support ....
8
votes
3
answers
3k
views
dotnet-dump fails with "Writing dump failed (HRESULT: 0x80004005)" in Ubuntu
Despite I run dotnet-dump under root, and process is run under root (see service description below), it seems I lack some permissions.
I tried also other directories in home, in var and in tmp: all ...
8
votes
0
answers
8k
views
.NET Core on Docker: Access to the path is denied
I have a .Net core web application, which is hosted on a CentOS machine.
Everything works fine, except when I call a function which needs a specific file on the server (it combines several images and ...
7
votes
3
answers
13k
views
Create a client websocket based console app
At the moment I am using REST to consume data from external services/servers using my console app, but it's not very real time.
Can anyone provide a very basic working example of how I can connect a ....