asp.net-core-mvc

Uploading large files to Controller in chunks using HttpClient, IFormFile always empty

帅比萌擦擦* 提交于 2020-07-09 05:26:44
问题 I am trying to create a .Net Standard "Client" class for uploading (sometimes very large) files to a Controller. I want to do this by breaking the file into chunks and uploading them one at a time. The intent is for other applications to use this instead of communicating directly to the Web Api. I already have the Controller working. I've verified that it works using a Kendo-ui control which supports chunk-saving. The issue I am having is that the IEnumerable<IFormFile> files parameter for my

Uploading large files to Controller in chunks using HttpClient, IFormFile always empty

柔情痞子 提交于 2020-07-09 05:26:12
问题 I am trying to create a .Net Standard "Client" class for uploading (sometimes very large) files to a Controller. I want to do this by breaking the file into chunks and uploading them one at a time. The intent is for other applications to use this instead of communicating directly to the Web Api. I already have the Controller working. I've verified that it works using a Kendo-ui control which supports chunk-saving. The issue I am having is that the IEnumerable<IFormFile> files parameter for my

What is the difference between the nuget packages hangfire.aspnetcore and hangfire and hangfire.core?

血红的双手。 提交于 2020-07-08 10:59:28
问题 What is the difference between the nuget packages HangFire.AspNetCore and HangFire and HangFire.core? It seems I am able to use hangfire with a ASP .NET MVC Core project with only the HangFire 1.6.21 package alone. See below packages used in my project: What is then the package HangFire.AspNetCore for? I am working with Visual Studio Code on Ubuntu, and I added the packages using : dotnet add package Hangfire dotnet add package Hangfire.AspNetCore 回答1: It's the usual naming convention for

Primary key not found when scaffolding controller in MVC core

不问归期 提交于 2020-07-07 11:17:09
问题 When trying to scaffold a controller I get the following error: "There was an error running the selected code generator: 'The entity type 'Company.Models.Office' requires a primary key to be defined at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.b_6-0()" I am new to MVC Core but my understanding is that a primary key is defined by default as ID or classnameID. I have also tried adding the [Key] attribute and renaming the primary key to OfficeID. I have went through a similar

Primary key not found when scaffolding controller in MVC core

风格不统一 提交于 2020-07-07 11:16:27
问题 When trying to scaffold a controller I get the following error: "There was an error running the selected code generator: 'The entity type 'Company.Models.Office' requires a primary key to be defined at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.b_6-0()" I am new to MVC Core but my understanding is that a primary key is defined by default as ID or classnameID. I have also tried adding the [Key] attribute and renaming the primary key to OfficeID. I have went through a similar

ASP NET CORE - ANGULAR NO 'Access-Control-Allow-Origin' header is present on the requested resource

雨燕双飞 提交于 2020-07-06 13:01:54
问题 This question may be asked many times but the solutions available online are not working for me. In our project we have as Asp.Net Page with the WebMethod that that handles database, or if I put it this way we have a WebApi as:- http://server/Pages/ApplicationData.aspx/GetApplicationLookups Now we have an AspNet Core Angular web application which calls that this API postgetGetApplicationLookups(url: string) { var headers = new Headers(); headers.set('Accept', 'application/json; charset=utf-8'

Is it possible to reference .net framework 4.7.2 class library from an ASP.NET Core MVC project?

佐手、 提交于 2020-07-05 09:09:30
问题 I have an ASP.NET MVC 5 project which works well and it also references a .NET Framework 4.7.2 Class library which produces some CrystalReports. CrystalReports does not support .NET Core, so the class library will stay with full .NET Framework. Now, if I upgrade the ASP.NET MVC 5 to ASP.NET Core 2 (or 3), will I be able to reference the class library and possibly generate those CrystalReports? 回答1: .NET Core doesn't support inclusion of .NET Framework libraries. Period. However, .NET Core

Is it possible to reference .net framework 4.7.2 class library from an ASP.NET Core MVC project?

倖福魔咒の 提交于 2020-07-05 09:06:13
问题 I have an ASP.NET MVC 5 project which works well and it also references a .NET Framework 4.7.2 Class library which produces some CrystalReports. CrystalReports does not support .NET Core, so the class library will stay with full .NET Framework. Now, if I upgrade the ASP.NET MVC 5 to ASP.NET Core 2 (or 3), will I be able to reference the class library and possibly generate those CrystalReports? 回答1: .NET Core doesn't support inclusion of .NET Framework libraries. Period. However, .NET Core

ASP.net core auth cookie not being set in Google Chrome when running in dev

核能气质少年 提交于 2020-07-05 05:37:09
问题 I have three applications in my solution, all built in asp.net core 1 MVC 6. App 1 is an MVC app used for authenticating a user. App 2 is an Angular SPA app and is the main app in the solution. App 3 is an MVC web api application. In app 3, I have the usual asp.net core SignInManager and UserManager code (the same code as you get by default when you start a new MVC 6 template - only different is, it exists in my web api here). And the login/logout/register etc is exposed via web api methods

.net core , how to handle route with extra leading slash

我们两清 提交于 2020-07-03 15:16:18
问题 I need to handle an incoming request which is of the form: //ohif/study/1.1/series Note the exta slash at the front My controller signature is: [Route("ohif/study/{studyUid}/series")] [HttpGet] public IActionResult GetStudy(string studyUid) If I modify the incoming request to /ohif/study/1.1/series it works fine however when I use //ohif/study/1.1/series, the route is not hit Additionally I also tried: [Route("/ohif/study/{studyUid}/series")] and [Route("//ohif/study/{studyUid}/series")] Both