coreclr

Running F# in CoreCLR

£可爱£侵袭症+ 提交于 2019-12-05 03:59:15
I compiled CoreCLR and CoreFX as described here . Basically that works and I can compile and run C# code targeting CoreCLR. The next step was to try compiling and running F# code. So I added FSharp.Core 3.1.2.1 to the project and compiled a sample application using the following command: fsc ^ --noframework ^ --targetprofile:netcore ^ /r:packages\System.Runtime.4.0.20-beta-22703\lib\contract\System.Runtime.dll ^ /r:packages\System.Reflection.4.0.10-beta-22703\lib\contract\System.Reflection.dll ^ /r:packages\System.Collections.4.0.10-beta-22703\lib\contract\System.Collections.dll ^ /r:packages

Static field is initialized later when the class has a static constructor

泪湿孤枕 提交于 2019-12-05 02:18:00
问题 By running this simple code: class Program { class MyClassWithStatic { public static int Number = SomeService.GetData(); static MyClassWithStatic() { Console.WriteLine("static ctor runs"); } } class SomeService { public static int GetData() { Console.WriteLine("GetDataRuns"); return 42; } } static void Main(string[] args) { InitService(); var value = MyClassWithStatic.Number; Console.WriteLine(value); } private static void InitService() { Console.WriteLine("InitServiceRuns"); } } The output

Typeconverter does not work in asp.net core

坚强是说给别人听的谎言 提交于 2019-12-04 02:59:46
问题 I have Amount stored in the database as decimal . I want to show that value on UI with thousand separator. I can add [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)] attribute on amount property and that would display number with thousand separator however when i POST the value back to server, the MVC model binding would not work because of commas. I have created a custom type converter that converts from decimal to string and then string to decimal public class

How to configure multiple ASPNETCORE_ENVIRONMENT on same machine?

给你一囗甜甜゛ 提交于 2019-12-03 19:05:05
问题 I have ASP.NET core web application. I have configured the web application on our web server and set the ASPNETCORE_ENVIRONMENT variable to Development . I set this variable at machine level like shown in the picture below. Now on the same machine i want to configured one more instance of same web application as Staging environment. What are my options here to set ASPNETCORE_ENVIRONMENT at application level instead of machine level? so i can host multiple instances of the same application on

Using .NET Core on Desktop Application

半城伤御伤魂 提交于 2019-12-03 13:48:53
I am starting the development of a server using C# and I would like to use .NET Core as it is said multi-platform and that I might be interested on running it on Linux. I installed the CoreCLR with DNX as it is said here: http://dotnet.readthedocs.org/en/latest/getting-started/installing-core-windows.html However I would like to target the .NET Core directly from Visual Studio, I don't have any option to do so. I'm coding a classic desktop console application, not an ASP.NET one, but some examples on the GitHub of the .NET Foundation are based on console application so I guess it's not a

No native code debugging in CoreCLR console application projects in VS2015?

北城余情 提交于 2019-12-02 10:09:40
问题 I really want to jump all over CoreCLR. The new project structure, the merging of nuget into the build system, the automatic refreshing of solutions when the file system reports changes, and the targeting of multiple platforms are just some of the reasons I want to move on from the old csproj/.net 4.x stuff. One of my primary use cases is exploring multiplatform game engine design with C#, but there's some interop involved for specific platforms (hidden away in SharpDX in my case) - debug

No native code debugging in CoreCLR console application projects in VS2015?

狂风中的少年 提交于 2019-12-02 07:25:38
I really want to jump all over CoreCLR. The new project structure, the merging of nuget into the build system, the automatic refreshing of solutions when the file system reports changes, and the targeting of multiple platforms are just some of the reasons I want to move on from the old csproj/.net 4.x stuff. One of my primary use cases is exploring multiplatform game engine design with C#, but there's some interop involved for specific platforms (hidden away in SharpDX in my case) - debug messages that come from the unmanaged side of DirectX bubble up from native code into managed code if you

C# .NET Core How to debug System.IO.FileNotFoundException in System.Private.CoreLib.dll?

守給你的承諾、 提交于 2019-12-01 21:01:53
When I run .NET Core Web API Application on VS 2017, In Output's Debug panel, keep showing me Exception throw: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll However, application runs well without stoping or malfunctioning. I know Exception always means somthing needs to be cared. So, how can I search what File is Not Found when run CoreCLR? ------------- more ------------------- 'dotnet.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\2.0.0\System.Private.Xml.Linq.dll'. Symbols loaded. 'dotnet.exe' (CoreCLR: clrhost): Loaded 'C:

Get current MethodBase in ASP.NET vNext

蹲街弑〆低调 提交于 2019-12-01 20:33:23
I'm porting an open source library from the regular .NET 4 Client Profile to DNX Core 5.0. There are quite a few library changes, with properties or methods being moved around or altogether removed. I have looked at this answer but it doesn't work in my case because the method was removed. One of the issue I have a piece of code where MethodBase.GetCurrentMethod() is called. This method no longer exists in the API. The only methods left that are similar are: public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle); public static MethodBase GetMethodFromHandle

Typeconverter does not work in asp.net core

妖精的绣舞 提交于 2019-12-01 15:53:44
I have Amount stored in the database as decimal . I want to show that value on UI with thousand separator. I can add [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)] attribute on amount property and that would display number with thousand separator however when i POST the value back to server, the MVC model binding would not work because of commas. I have created a custom type converter that converts from decimal to string and then string to decimal public class NumberConverter : TypeConverter { public override bool CanConvertFrom( ITypeDescriptorContext context, Type