Questions tagged [coreclr]

CoreCLR is new .NET Core runtime. It is an execution engine for .NET apps, performing functions such as IL byte code loading, compilation to machine code and garbage collection.

Source repo: https://github.com/dotnet/coreclr

301 questions
342
votes
31 answers

How to register multiple implementations of the same interface in Asp.Net Core?

I have services that are derived from the same interface. public interface IService { } public class ServiceA : IService { } public class ServiceB : IService { } public class ServiceC : IService { } Typically, other IoC containers like Unity allow…
LP13
  • 20,711
  • 38
  • 136
  • 286
121
votes
17 answers

Is it possible to make desktop GUI application in .NET Core?

I have been developing Windows Forms programs for few years. I am now looking into .NET Core (including ASP.NET Core MVC). I am searching for the new GUI desktop technology. In Visual Studio 2015 update 3 I can't see any option to make a GUI app in…
EKanadily
  • 3,049
  • 3
  • 28
  • 29
84
votes
2 answers

Why is code behavior different in release & debug mode?

Consider the following code: private static void Main(string[] args) { var ar = new double[] { 100 }; FillTo(ref ar, 5); Console.WriteLine(string.Join(",", ar.Select(a => a.ToString()).ToArray())); } public static void…
Ashkan Nourzadeh
  • 1,732
  • 14
  • 29
67
votes
12 answers

How to publish environment specific appsettings in .Net core app?

I have 3 environment specific appsettings files in my .Net core application in project.json I have setup publishOptions like this. ( based on suggestion here) "publishOptions": { "include": [ "wwwroot", …
LP13
  • 20,711
  • 38
  • 136
  • 286
57
votes
14 answers

Where is the PostAsJsonAsync method in ASP.NET Core?

I was looking for the PostAsJsonAsync() extension method in ASP.NET Core. Based on this article, it's available in the Microsoft.AspNet.WebApi.Client assembly. I had thought Microsoft had changed all of the assembly names from Microsoft.AspNet to…
LP13
  • 20,711
  • 38
  • 136
  • 286
53
votes
8 answers

How to write to a file in .NET Core?

I want to use the Bluetooth LE functions in .NET Core (specifically, BluetoothLEAdvertisementWatcher) to write a scanner which logs information to a file. This is to run as a desktop application and preferably as a command line app. Constructors…
gauss256
  • 2,314
  • 3
  • 19
  • 22
44
votes
6 answers

How to set aspnetcore_environment in publish file?

I have ASP.NET Core application (Web Api). The documentation has explained working with multiple environments, however it failed to explain how to set aspnetcore_environment when publishing the web site. So lets say if i have 3 environments…
LP13
  • 20,711
  • 38
  • 136
  • 286
39
votes
4 answers

Do we need interfaces for dependency injection?

I have an ASP.NET Core application. The application has few helper classes that does some work. Each class has different signature method. I see lot of .net core examples online that create interface for each class and then register types with DI…
LP13
  • 20,711
  • 38
  • 136
  • 286
35
votes
1 answer

What's the difference between .NET CoreCLR, CoreRT, Roslyn and LLILC

Recently I started reading about .NET reorganization details (mostly through .NET Core github pages). It seams that they created sibling projects to support more platforms. While reading I have the impression that CoreCLR and CoreRT is a new…
Robert Zaremba
  • 6,780
  • 6
  • 40
  • 71
30
votes
4 answers

C++/CLI Support in .Net Core

Our project structure is like, native.dll :- This contains pure native code written in c\c++. This native.dll exposes some functions using *def file. Wrapper Library(wrapper.dll compiled with .Net framework v4.0) :- In order to use functionality…
User1234
  • 1,341
  • 3
  • 17
  • 30
29
votes
1 answer

.Net Framework and .Net Core in same solution

I have an application targeting .NET Framework, and now I need to develop a library in .NET Core. I plan to put both projects in the same solution and add the .NET Core library as a reference in the .NET Framework project. Can this be done? If the…
vKint
  • 291
  • 1
  • 3
  • 4
28
votes
3 answers

Maybe a C# compiler bug in Visual Studio 2015

I think this is a compiler bug. The following console application compiles und executes flawlessly when compiled with VS 2015: namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var…
Peter Perot
  • 921
  • 1
  • 8
  • 15
28
votes
2 answers

Building a .NET Core app via command line, so that it works on a machine without .NET Core installed

My end goal is to create a cross-platform (non-web) console application, so I'm exploring .NET Core right now. In my previous .NET projects, I did all the development inside Visual Studio, but I also created a batch/MSBuild file so I could build the…
Christian Specht
  • 33,837
  • 14
  • 123
  • 176
26
votes
2 answers

Handling exception in asp.net core?

I have asp.net core application. The implementation of configure method redirects the user to "Error" page when there is an exception ( in non Development environment) However it only works if the exception occurs inside controller. If exception…
LP13
  • 20,711
  • 38
  • 136
  • 286
25
votes
4 answers

Correct way to return HttpResponseMessage as IActionResult in .Net Core 2.2

In .Net Core 2.2. I am creating a API Controller that routes the request to another Http endpoint based on payload. [Route("api/v1")] public class RoutesController : Controller { [HttpPost] [Route("routes")] public async…
LP13
  • 20,711
  • 38
  • 136
  • 286
1
2 3
20 21