.net-core-3.0

Parsing a JSON file with .NET core 3.0/System.text.Json

守給你的承諾、 提交于 2019-12-03 12:30:15
问题 I'm trying to read and parse a large JSON file that cannot fit in memory with the new JSON reader System.Text.Json in .NET Core 3.0. The example code from Microsoft takes a ReadOnlySpan<byte> as input public static void Utf8JsonReaderLoop(ReadOnlySpan<byte> dataUtf8) { var json = new Utf8JsonReader(dataUtf8, isFinalBlock: true, state: default); while (json.Read()) { JsonTokenType tokenType = json.TokenType; ReadOnlySpan<byte> valueSpan = json.ValueSpan; switch (tokenType) { case JsonTokenType

Visual Studio Designer or Some Other Designer for .NET Core 3.0

↘锁芯ラ 提交于 2019-12-03 08:55:50
I have recently heard that the alpha version of .NET Core (.NET Core 3.0) supports Windows Forms and WPF. But the Visual Studio Designer (and Visual Studio) doesn't support the .NET Core version of Windows Forms and WPF. Is there any way to make the Visual Studio Designer(and Visual Studio) work with .NET Core 3.0 or Is there any other designer or IDE that I can use to work with .NET Core 3? The main reason I am asking this is because it is so hard (for me and others) to use Code-editors (like VS Code and Atom). I hope that this is a good question. Update Along with GA release of .NET Core 3.0

Azure functions stopped working after Core 3.0 update

六眼飞鱼酱① 提交于 2019-12-01 13:38:39
The code is working in Core 3.0 preview7 version, but after updating to 3.0 Azure functions started giving an error. The error comes if I try to access builder service object. Also not able to debug the issue. Also tried updating Microsoft.Extensions.DependencyInjection 3.0 but still the same error. public class Startup : FunctionsStartup { public override void Configure(IFunctionsHostBuilder builder) { var descriptor = builder.Services.FirstOrDefault(d => d.ServiceType == typeof(IConfiguration)); // error after adding this var currentDirectory = $"{Environment.GetEnvironmentVariable("HOME")}\

dotnet ef not found in .NET Core 3

扶醉桌前 提交于 2019-11-30 12:37:16
问题 I'm following the docs in order to create an initial migration. When I execute dotnet , I get the help section, meaning that the PATH works properly. Then I try to execute the command below from the docs in console window: dotnet ef migrations add InitialCreate I get the following error: Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET Core program, but dotnet

ASP.NET Core 3.0 not showing on Visual Studio 2019

拜拜、爱过 提交于 2019-11-29 02:51:46
I want to test the new Blazor server-side framework (aka Razor Components). I installed Visual Studio 2019 RC, and then the .Net Core 3.0 preview 2, following this official tutorial . After the install, I only see the ASP.NET Core 2.0 and the 2.1 on the "Create a new ASP.NET Core Web Application" page. The 3.0 is not showing up. I started to mess around, trying to install other packages from this page , uninstalled and reinstalled Visual Studio 2019, updated to the .NET Core Preview 3, installed several times the x64 and x86 packages in different orders, copy/paste the .Net Core binaries to

JsonConverter equivalent in using System.Text.Json

一个人想着一个人 提交于 2019-11-29 01:26:18
问题 I'm starting to migrate some code I have from Newtonsoft.Json to System.Text.Json in a .net Core 3.0 app. I migrated the properties from [JsonProperty("id")] to [JsonPropertyName("id")] but I have some properties decorated with the JsonConverter attribute as: [JsonConverter(typeof(DateTimeConverter))] [JsonPropertyName("birth_date")] DateTime BirthDate{ get; set; } But I cannot find the equivalent of this Newtonsoft converter in System.Text.Json Does someone know how can this be achieved in

Use Visual Studio 2017 with .Net Core SDK 3.0

妖精的绣舞 提交于 2019-11-27 15:35:09
问题 How Can I open .Net Core 3.0 project in Visual Studio 2017? I have downloaded the .NET Core 3.0 SDK from dotnet.microsoft.com and created new project with dotnet new command in a folder. Building C# project shows error: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. I checked it but it doesn't work in my case: Visual Studio 2017 with .Net Core SDK 2.0 Visual Studio 2017 with