.net-4.6.1

The type or namespace 'Http' doesn't exist in the namespace 'System.Web' in Web API

独自空忆成欢 提交于 2021-02-10 04:41:49
问题 I'm trying to create a Web API following this link . I have exactly added the way it is shown in this article. But after adding the controller, it is giving me this error for System.Web.Http and ApiController . Error message on System.Web.Http : The type or namespace Http doesn't exist in the namespace 'System.Web' Error message on ApiController: The type or namespace ApiController could not be found. Additional Information : I'm using Visual Studio 2015 Professional. Framework : .NET

MultipartFormDataContent.Add StringContent is adding carraige return/linefeed to the name

走远了吗. 提交于 2021-01-27 14:26:34
问题 formData.Add(sJobId,"job_id"); is sending "job_id\r\n" to the server Here is my C# method: public static async Task UploadAsync(string url, int job_id, string filename, string filePath) { try { // Submit the form using HttpClient and // create form data as Multipart (enctype="multipart/form-data") using (var fileStream = new StreamContent(System.IO.File.Open(filePath, FileMode.Open, FileAccess.Read))) using (var formData = new MultipartFormDataContent()) { StringContent sJobId = new

How to fix No connection could be made because the target machine actively refused it 127.0.0.1:64527

坚强是说给别人听的谎言 提交于 2020-12-05 07:19:33
问题 I have an MVC application which depends on a web API application, I hosted the two on a shared hosting environment. API on the subdomain and MVC on the main domain the API is api.mydomain.com and the MVC is mydomain.com, the API works fine anytime I try it on postman or browser but the MVC cannot connect to it with the following error. No connection could be made because the target machine actively refused it 127.0.0.1:64527 Description: An unhandled exception occurred during the execution of

Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0 [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2020-07-16 10:38:50
问题 This question already has answers here : Project build failed while using .net class library in .net core console application (2 answers) .NET Core 2.1 can't reference a .NET Framework 4.7.2 Class library (1 answer) Closed 7 days ago . I have a .net core 3.1 console application which is using a .net framework 4.6.1 class library. I am getting the below exception when running the console application. I have added the System.Configuration.ConfigurationManager version 4.4.0 to both the projects.