coreclr

ServicePointManager.DefaultConnectionLimit in .net core?

妖精的绣舞 提交于 2019-11-30 15:18:43
问题 I am porting a web api 2 service to .net core and I found this line in my old web api service. ServicePointManager.DefaultConnectionLimit = int.MaxValue; This line of code increases the connection limit. I don't know if it's for the computer or the framework or just the application. And after reading this answer on stackoverflow, I also realise that setting it to int.max may not be the best idea. However I would still like to have control over it in my new .net core service. How do I modify

How to inject WCF service client in ASP.Net core?

本小妞迷上赌 提交于 2019-11-30 12:16:25
问题 I have WCF service that I need to access from ASP.NET Core. I have installed WCF Connected Preview and created proxy successfully. It created interface & client something like below [System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "0.3.0.0")] [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ServiceReference1.IDocumentIntegration")] public interface IDocumentIntegration { [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org

Where is PostAsJsonAsync method in ASP.NET Core?

那年仲夏 提交于 2019-11-30 10:51:53
I was looking for PostAsJsonAsync extension method in ASP.NET core. Based on article here its available in Microsoft.AspNet.WebApi.Client assembly. However i though Microsoft has changed all the assembly names from Microsoft.AspNet to Microsoft.AspNetCore to be more specific with .Net Core framework. But i could not find Microsoft.AspNetCore.WebApi.Client Where is PostAsJsonAsync extension method in ASP.NET core? I dont deserve any credit for this. Have a look @danroth27 answer in the following link. https://github.com/aspnet/Docs/blob/master/aspnetcore/mvc/controllers/testing/sample

How to configure multiple ASPNETCORE_ENVIRONMENT on same machine?

被刻印的时光 ゝ 提交于 2019-11-30 03:25:41
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 the same machine? You have a couple of options. Run each app as a different user, and set the

How to validate XML in .NET Core 1.1.2

十年热恋 提交于 2019-11-29 17:31:42
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.Schema; schemaSettings.ValidationEventHandler += new ValidationEventHandler(ValidationEventHandler);

Where is PostAsJsonAsync method in ASP.NET Core?

纵然是瞬间 提交于 2019-11-29 16:39:48
问题 I was looking for PostAsJsonAsync extension method in ASP.NET core. Based on article here its available in Microsoft.AspNet.WebApi.Client assembly. However i though Microsoft has changed all the assembly names from Microsoft.AspNet to Microsoft.AspNetCore to be more specific with .Net Core framework. But i could not find Microsoft.AspNetCore.WebApi.Client Where is PostAsJsonAsync extension method in ASP.NET core? 回答1: I dont deserve any credit for this. Have a look @danroth27 answer in the

Do we need interfaces for dependency injection?

↘锁芯ラ 提交于 2019-11-29 12:27:10
问题 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 framework. For example public interface IStorage { Task Download(string file); } public class Storage { public Task Download(string file) { } } public interface IOcr { Task Process(); } public class Ocr:IOcr { public Task Process() { } } Basically

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

爷,独闯天下 提交于 2019-11-29 02:53:34
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 whole project (including setups, NuGet packages, zip files with binaries etc.) with one single click. Here's an example from a previous project . In the end, I want to do something similar with my .NET Core test project. But right now I'm failing at the first step: I'm unable to build it outside Visual Studio, so that the result works on another

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

对着背影说爱祢 提交于 2019-11-28 22:45:47
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", "appsettings.development.json", "appsettings.staging.json", "appsettings.production.json", "web.config" ] }, I have 3 corresponding startup classes that uses appropriate appsettings based on environment var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: false, reloadOnChange: true); However when I publish

C++/CLI Support in .Net Core

倖福魔咒の 提交于 2019-11-28 21:15:09
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 of native.dll , a Wrapper lib(wrapper.dll) is written in C++\CLI using :clr\oldsyntax . This wrapper has all code of Interoperability and Marshalling . Application(Console App v4.0) directly uses wrapper.dll to use functionality provided by native.dll . Now this project needs to run in .Net Core . This means we will have an .Net Core application that