Newest '.net-core' Questions - Stack Overflow

Questions tagged [.net-core]

.NET Core is an open-source, modular implementation of the .NET Framework. It can be used in a wide variety of applications and verticals, ranging from servers and data centers to apps and devices. .NET Core is supported by Microsoft on Windows, Linux and macOS.

0
votes
0answers
7 views

Get EF Context ValueConverterSelector

I'm trying to generate a SQL MERGE statement from Entity Framework Core entity. To do so I need to convert all entity properties into SQL strings e.g: bool => 1 or 0 string => 'string' int ...
0
votes
0answers
5 views

Need a mock server for my custom HttpClient rest template to test with

I have a custom authentication rest template my library returns which is HttpClient. I need a library that will let me bind my rest template to the mock server so I can test my template. I had high ...
0
votes
0answers
12 views

How can I automatically register services in .net core dependency injection?

My team is looking at converting our solution to .net core and we are trying to decide whether we should stick with StructureMap as our DI tool or use Microsoft's one that is provided with .net core. ...
0
votes
1answer
42 views

MVC WebApi advanced custom routing

I'm struggling with this for some time now. I've searched all over the internet, didn't find any solution. I'd like to create a webapi project with somewhat custom routing. Using VS 2019, project is ...
1
vote
1answer
21 views

How to log the response code of all web requests in .NET Core

In my .NET Core 2.2 Web Api project, I want to log any returned status code. I created a standard Web Api project and modified a method to do exactly this. public void Configure(IApplicationBuilder ...
0
votes
0answers
10 views

How to test Test AuthorizationHandler properly

I searched the web and I couldn't find one that will solve my problem. I created a custom policy based authorization in .NET core //Group.cs public class Group { public string GroupType { get; ...
0
votes
0answers
6 views

React & .net-core: Failed to load resource: net::ERR_CONNECTION_REFUSED

for some strange reason I can not sign in to my simple application which is written in react & web api. In my console I'm getting following error: Failed to load resource: net::...
0
votes
0answers
7 views

Upload set of images to net core server from Xamarin.Forms app

What's the best way to upload a set of images to a net core API? For example, I'm trying to upload an object with details for a profile (name, other details, images). Normally, I would simply send ...
0
votes
0answers
13 views

VS Code: No process running with Id error when attaching to ASP.NET Core process in Docker container

Currently I'm running ASP.NET Core directly on my Linux workstation. But I want to directly develop with Docker, including remote debugging. Following different articles, it seems that vsdbg is ...
0
votes
0answers
19 views

Response to preflight request doesn't pass access control check No 'Access-Control-Allow-Origin' header is present on the requested resource

I have .NET Core WebAPI being hosted on IIS that I have enabled CORS in the startup.cs. When making a request to the API from my Angular app, the request fails and i get this error "Access to ...
1
vote
1answer
67 views

Receive (not send) e-mail from users on C#

I created a form that a user can fill his name and email. When the user clicks Send I want to receive an email from his email. I've only succeed sending emails from my personal email putting my ...
0
votes
0answers
12 views

Azure function app deploy and release pipeline error

I pushed my .net core function application using visual studio and now setting up release pipeline. I can publish and execute the application just fine and it works great on the Azure portal. However ...
0
votes
0answers
9 views

Bundling and Minification without using tools in ASP.NET MVC Core 2.2 web application

Do we have any way to implement Bundling and Minification without using any tools like Grunt, Gulp, WebOptimizer etc. in ASP.NET MVC Core 2.2 web application similar to ASP.NET MVC?
1
vote
1answer
51 views

Proper DI or service locator anti-pattern?

I'm developing an SDK and am using DI (I think incorrectly) for my classes & their dependencies. I believe I've mixed DI and a service locator. My problems are: Knowing where to build my DI ...
1
vote
0answers
15 views

How to ignore casing when using JTokenEqualityComparer?

How to ignore casing when using JTokenEqualityComparer? JTokenEqualityComparer comp = new JTokenEqualityComparer(); // arrange var obj1 = new JObject(); obj1.Add("...
0
votes
0answers
7 views

WebEssentials.AspNetCore.PWA Point to Custom Manifest

I have a .Net Core 2.2 application that I am adding Progressive Web App to. I am using WebEssentials.AspNetCore.PWA middleware to implement this. My project is multi tenancy and for this reason I ...
1
vote
1answer
21 views

application doens't read config file when executed in debug vs ctrlf5

I have a .net core application , that at some point in the project refers to another .netStandard DLL which reads from app.config file using: var x=ConfigurationManager.AppSettings["...
0
votes
0answers
8 views

Keep certain warning as a warning in MSBuild [duplicate]

In my project, I'm setting WarningsAsErrors to true. However, occasionally a certain warning code, in my case its CS0618 when using a component the ObsoleteAttribute, I'd like to suppress but still ...
0
votes
1answer
15 views

How to query for index access count using MongoDB .NET Driver?

I'm looking to retrieve index usage information from MongoDB via the .NET driver. For the curious it is to prove in an integration test that an index is being used as intended, specifically the number ...
-5
votes
0answers
28 views

Can't continue after exception was thrown [on hold]

Can't move 'statement arrow' while debugging .net core 2.1 web api application. "Unable to set the next statement" arrow appears when trying to move 'arrow' from catch block, also if i change ...
0
votes
0answers
27 views

Create Polly Retry Policy for Synchronous web api call c#

I have implemented the below Polly Policies for the HttpClient. IHostBuilder hostBuilder = new HostBuilder().ConfigureServices((hostContext, services) => { ...
0
votes
0answers
6 views

Is there a way to scaffold tests for .NET Core?

I'm looking for functionality similar to the "Create Unit Tests" feature of Visual Studio, for the .NET Framework (full/classic). I'm aware of "dotnet new mstest" or similar, but for an existing ...
-4
votes
1answer
39 views

How to submit http form using C# in DOTNET CORE

I had created an HTML form using c# string builder using reference: /a/37757601/7961948 and in dotnet, we could submit this form using Response.Write(formPostText); But ...
0
votes
1answer
17 views

How to execute postgres function using dapper

I get an error when I try to call a postgre function using dapper. Where did i do wrong? I'll be glad if you can help me. Error Message: availability_list(facilityId => integer, startDate => ...
0
votes
0answers
13 views

Unit test if Cors is added to the ServiceCollection

I am trying to unit test if the ServiceCollection contains Cors. public static class ServiceExtensions { public static void ConfigureCors(this IServiceCollection services) { services....
2
votes
1answer
24 views

Create HttpMessageHandler on .NET Core with possibility to make requests to myself

I have a nightly job on .NET Core 2.1 app to make request to https://server/api/values This request should be done from server to server itself (kind of TestServer behaviour), without actual network ...
-1
votes
0answers
20 views

How to debug Angular and .netcore with WebStorm?

I used to debug Angular+.Net-Core application with Visual Studio. Now I get a WebStorm, I can run Angular CLI from there. However how can I combine it with .net-Core together?
0
votes
0answers
40 views

Net Core - Why exception middleware is so slow?

First of all, sorry about my english. Well, I'm developing a .Net Core Rest Api (I've developed before in asp.net mvc but in net core is the first time ever) and I just faced an strange thing. The ...
0
votes
2answers
16 views

Update function not working with Angular and WEB api

I am making a CRUD example with dotnet cor and angular I have made a function in the backend like this: CarController.cs [Route("UpdateCar")] [HttpPut] public IActionResult Put([...
-1
votes
0answers
15 views

Download excel files from share point site to local system using C# in .net core [on hold]

unable to Download excel files from sharepoint site to local system using C# ClientContext ctx = new ClientContext("https://cm365.sharepoint.com/sites/intranet/cs/"); ctx.Credentials = new ...
1
vote
0answers
15 views

Can't add a .bin.gz file as embedded resource

If I include a .bin.gz file in a DLL as an embedded resource, it doesn't show up in the Assembly.GetManifestResourceNames() list, and cannot be loaded with Assembly.GetManifestResourceStream(). If I ...
2
votes
1answer
38 views

Environment variables not visible in configuration provider

I'm trying to set up database connection string for my Azure Devops Entity Framework database migration task. My idea is not to publish config with database connections on git but to use environment ...
0
votes
1answer
28 views

Best practice on organizing EF configuration classes in Visual Studio

I'm starting with a new project and am using EF core with fluent API. Currently I have some few configuration classes for a simple data model. Over time it will grow, there will be more and more. ...
1
vote
0answers
17 views

Signal R Handshake failed with Azure Service Fabric

We have a Flutter Dart Client application that has to be integrated with Service Fabric Microservice. Client-side code is not able to establish a connection with Signal R and on further debugging ...
0
votes
0answers
9 views

How to fix crash in Localization db in ASP.Net Core 2.0 Web Application

I am working on project .netcore 2, and already integrated with custom localization to read from DB. i faced problem in localization that will be crashed, in some cases, not reproduced every time, ...
0
votes
1answer
22 views

How to set compiler options in VS Code and/or .NET Core?

I'm trying to set the -checked compiler option for a C# library project written over .NET Core, using VS Code as the IDE. How can I do this?
0
votes
0answers
7 views

What's the best way to use SASS and Autoprefixer in Visual Studio?

Visual Studio is full of choices these days. I really love the idea of using SASS to automate my CSS and help keep a consistent look, and I hate how cluttered everything looks with vendor prefixes ...
0
votes
2answers
52 views

Issues with DbContext getting disposed after multiple calls to service

I am working on an API and am having problems with making multiple calls to a service and it's different methods, I have each method creating and using new DBContext (or at least that's the intention),...
1
vote
0answers
32 views

FTP Downloading slow

I am downloading a file from FTP using this code: FtpWebRequest request = (FtpWebRequest)WebRequest.Create(downloadPath); request.UsePassive = false; request.Method = WebRequestMethods.Ftp....
0
votes
0answers
13 views

How to update AWS Lambda alias to specific version with dotnet aws cli tools

I'm attempting to deploy and update a lambda function with specific versioning and aliasing using the dotnet cli tools layed out here: https://github.com/aws/aws-extensions-for-dotnet-cli#aws-lambda-...
3
votes
0answers
39 views

Net Core Automatically Review Unoptimized Entity Framework Queries

We have a team of application developers creating Entity framework queries. Most of the time, Entity Framework Core prepare good queries; however sometimes they become unoptimized and long. Is there ...
0
votes
1answer
19 views

Setup Identity Server For Some Controllers And Not Others In .NET Core Web API

Suppose I had a new .NET Core 2.2 Web API Project with two controllers: [ApiController] public class AController : ControllerBase { } [ApiController] public class BController : ControllerBase { } ...
0
votes
0answers
14 views

EfCore 2.2 Owned Types picking Entity base properties

I have a ValueObject called Money with this signature: public class Money : ValueObject { public decimal Amount { get; private set; } public Currency Currency { get; private set; } ...
3
votes
1answer
45 views

dotnet core limit memory usage

I'm trying to run dotnet core project in Kubernetes and I am wondering if there a way to limit memory usage from dotnet core project itself the same way we can set a limit for jvm projects. I see ...
0
votes
2answers
35 views

Data binding results in [object Object]

I am trying to bind the records of rows to my view. This is my code on the backend: [Route("GetCarCount")] [HttpGet] public async Task<long> Count() { ...
0
votes
0answers
24 views

Inno setup getting error - invalid class string progid “IISNamespace” [duplicate]

I have installed IIS but getting error invalid class string progid "IISNamespace" try IIS := CreateOleObject('IISNamespace'); except RaiseException('Please install Microsoft IIS first.'#...
0
votes
1answer
31 views

.Net Core 2.2, Ioc container - set property after the construction of the object

How can I set the property of a service that is registered in ServiceCollection after it is constructed. I cannot pass the value to the constructor as it would result in circular dependency. Wanted ...
0
votes
0answers
23 views

How to log HostInstanceId using TelemetryClient to Azure Application Insights from Azure Function?

I need to log a unique identifier for the machine that my Azure function is running on. The traces automatically generated show HostInstanceId under Custom Properties in Application Insights, as seen ...
1
vote
1answer
28 views

Autofac cannot resolve my Registered generic service

I've registered my generic interface in Autofac, but as I resolve it exception is thrown. Autofac.Core.Registration.ComponentNotRegisteredException: The requested service 'MyCLI.Command....
-1
votes
1answer
32 views

How to call some methods parallelized and get information from this methods?

I am developing an API, in this API I have a service with a method and this method has to call three methods in different repositories. Each of this methods have a Https request, the call has a ...