coreclr

How to set aspnetcore_environment in publish file?

痴心易碎 提交于 2019-12-18 11:42:03
问题 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 Development , Staging and Production In classic ASP.NET Web Application i used to create 3 build configurations. Development , Staging and Production ( Like shown in picture below). and then 3 .pubxml files, one for each configuration. Do i need to use the

How to validate XML in .NET Core 1.1.2

与世无争的帅哥 提交于 2019-12-18 09:46:43
问题 How can i validate XML against XSD schema in .NET Core 1.1.2? i found this ms docs but i cannot use it with .NET core 1.1.2 using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.Xml.Schema; namespace MyNameSpace { public static class XmlValidation { public static void Validate(string schema, string xml) { XmlReaderSettings schemaSettings = new XmlReaderSettings(); schemaSettings.Schemas.Add(schema); schemaSettings.ValidationType = ValidationType

nuget packages for arm architecture for asp.net-5

旧城冷巷雨未停 提交于 2019-12-13 01:17:25
问题 Just like for any other architecture there should be package fro asp.net-5 coreclr like dnx-coreclr-linux-arm for arm arch. There are already packages for other architectures: https://www.nuget.org/packages?q=dnx-coreclr I know that in beta7 there was some effort done to enable arm compilation: https://github.com/aspnet/dnx/pull/2039 Does anyone knows if there any plans for releasing them via nuget? This would enable dev for raspberry pi or home mini pc's like qnap 2xx series. 回答1: ARM

.NET Core Tools: MSB3644 when importing a project

安稳与你 提交于 2019-12-12 10:10:46
问题 I made a docker container based on microsoft/dotnet:1.0-sdk . Following the guide, I executed dotnet new console and got a file dotnet.csproj . dotnet restore and dotnet run worked. Now I wanted to add my real code, which depends on YamlDotNet. So I edited the project file like this: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp1.1</TargetFramework> <EnableDefaultCompileItems>false</EnableDefaultCompileItems> </PropertyGroup>

Using .NET Core on Desktop Application

痞子三分冷 提交于 2019-12-12 07:59:46
问题 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

Environment.Version equivalent in core clr

久未见 提交于 2019-12-10 19:22:54
问题 The following code is valid for the dnx451 framework but not the dnxcore50 string ver = Environment.Version This method does not exist: Is there an equivalent property in the dnxcore50 framework? Update as per Victors answer you can use PlatformServices.Default.Runtime eg: Console.WriteLine("env: {0} {1}", PlatformServices.Default.Runtime.RuntimeType, PlatformServices.Default.Runtime.RuntimeVersion); output: (on dnx451) env: Clr 1.0.0-rc1-16231 output: (on dnxcore50) env: CoreClr 1.0.0-rc1

How to return large Json in Asp.Net Core

混江龙づ霸主 提交于 2019-12-10 17:21:24
问题 In classic asp.net in order to return large json data i enable it web.config <system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="2147483644"/> </webServices> </scripting> </system.web.extensions> and then also set the max length in action method public ActionResult GetData() { var data = _service.GetData(); var json = Json(data); json.MaxJsonLength = Int32.MaxValue; return json; } what is equivalent in ASP.NET core? In asp.net core I don't see JsonResult has

.net core installation on Windows 10 iot (Raspberry PI3 - ARM)

时间秒杀一切 提交于 2019-12-10 13:35:33
问题 I test .net core on different OSs and I'd like to know if it's possible to install dotnet/cli (.net Core) on Windows 10 iot over my Raspberry PI3. My objective would be ro run simple GPIO tests. What I do so far : I went on the .NET core site and do not find anything about Windows 10 iot target. I found a nice blog post titled How to run .NET Core Application on Pi2 - Win10 IoT Core? but it use DNVM which seems to be obsolete, and I don't read anything about Windows 10 iot target in the sites

(http) Web request provider in coreclr/dnxCore?

三世轮回 提交于 2019-12-10 13:16:15
问题 Is there a provider available for doing web requests/basic GET downloads in coreclr ? ( .net core ) Both System.Net.Webclient and HttpWebRequest/HttpWebResponse aren't available, I realize it's aimed at serving content, not consuming, but basic string downloading seems like something that really should have been included? Am I forgetting something, or is it just straight up not possible? I can default to full dnx, but would really rather not and lose cross platform compatibility. 回答1: You

How to check if a type is abstract in .NET Core?

此生再无相见时 提交于 2019-12-10 12:41:04
问题 This code works fine in .NET (4.6 and prior) var types = typeof(SomeType).GetTypeInfo().Assembly.GetTypes() from type in types where !type.IsAbstract but in .NET Core (DNX Core 5.0) it is producing a compile error: Error CS1061 'Type' does not contain a definition for 'IsAbstract' and no extension method 'IsAbstract' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?) So how can I check if a type is abstract in DNX Core 5.0