.net-core-3.0

Dependency Injection in .NET Core 3.0 for WPF

梦想的初衷 提交于 2021-02-20 05:45:22
问题 I’m quite familiar with ASP.NET Core and the support for dependency injection out of the box. Controllers can require dependencies by adding a parameter in their constructor. How can dependencies be achieved in WPF UserControls? I tried adding a parameter to the constructor, but that didn’t work. I love the IOC concept and would prefer to bring this forward to WPF. 回答1: I have recently come across this requirement to my project and I solved it this way. For Dependency Injection in .NET Core 3

Dependency Injection in .NET Core 3.0 for WPF

怎甘沉沦 提交于 2021-02-20 05:45:10
问题 I’m quite familiar with ASP.NET Core and the support for dependency injection out of the box. Controllers can require dependencies by adding a parameter in their constructor. How can dependencies be achieved in WPF UserControls? I tried adding a parameter to the constructor, but that didn’t work. I love the IOC concept and would prefer to bring this forward to WPF. 回答1: I have recently come across this requirement to my project and I solved it this way. For Dependency Injection in .NET Core 3

.Net Core 3 Worker Integration Tests

你说的曾经没有我的故事 提交于 2021-02-16 20:14:11
问题 For integration testing Asp.Net Core application we have WebApplicationFactory. But how to test Worker ( HostedService ) that is not web application? I don't want to copy the whole DI configuration in SUT like in this question. Is it possible to use original configuration and override some of dependencies like we do for web application in WebApplicationFactory.WithWebHostBuilder? 回答1: I wasn't able to find any solution for Worker services integration testing hence I made adoption of

New Azure DevOps pipeline using ASP.NET yaml template failing

会有一股神秘感。 提交于 2021-02-11 12:55:23
问题 I have a GitHub repository with a .NET Core 3.0 website solution in it. In Azure DevOps, I went through the wizard to create a new pipeline linked to that repository using the ASP.NET Core template on the Configure step of the wizard. This is what my YAML looks like: # ASP.NET Core # Build and test ASP.NET Core projects targeting .NET Core. # Add steps that run tests, create a NuGet package, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core trigger: -

How to setup serilog SEQ for .NET Core 3.0 Worker Service

限于喜欢 提交于 2021-02-10 05:12:52
问题 Logging is working but it is not posting to my local seq, I tried adding serilog and also useSerilog but it does not logging into my local service: related question .csproj <ItemGroup> <PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.7" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="3.0.0" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.0.1" /> <PackageReference Include="Serilog" Version="2.8.0" /> <PackageReference Include=

How to setup serilog SEQ for .NET Core 3.0 Worker Service

不羁的心 提交于 2021-02-10 05:11:36
问题 Logging is working but it is not posting to my local seq, I tried adding serilog and also useSerilog but it does not logging into my local service: related question .csproj <ItemGroup> <PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.7" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="3.0.0" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.0.1" /> <PackageReference Include="Serilog" Version="2.8.0" /> <PackageReference Include=

How to setup serilog SEQ for .NET Core 3.0 Worker Service

隐身守侯 提交于 2021-02-10 05:10:47
问题 Logging is working but it is not posting to my local seq, I tried adding serilog and also useSerilog but it does not logging into my local service: related question .csproj <ItemGroup> <PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.7" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="3.0.0" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.0.1" /> <PackageReference Include="Serilog" Version="2.8.0" /> <PackageReference Include=

ASP.NET CORE 3.0 - HTTP Error 502.5 - Process Failure

社会主义新天地 提交于 2021-01-29 13:24:22
问题 After spending the past 3 days trying to resolve that problem, so I ask for your help. I already went to many related questions from stackoverflow, except that they are different .Net Core version. I recently upgraded my website from ASP.NET CORE 2.2 to ASP.NET CORE 3.0 but now I keep receiving HTTP Error 502.5 - Process Failure on the website. You can see the page at http://www.esnapup.com. Here is how the Startup.cs looks like: public Startup(IConfiguration configuration) { Configuration =

Azure Functions .NetCore 3.0 Request.Query throwing “Entry point not found” error

徘徊边缘 提交于 2021-01-29 12:12:34
问题 I have an Azure Functions project which builds and runs locally. One of my methods tries to access the HttpRequest.Query class to get parameters in the querystring which as of recently has started throwing errors including System.Private.CorLib: "Entry point not found" or System.Private.CoreLib: Exception while executing function: Configurations_Get. BC.Functions: Method not found: 'Microsoft.Extensions.Primitives.StringValues Microsoft.AspNetCore.Http.IQueryCollection.get_Item(System.String)

ICollectionView with .net core 3.0

北慕城南 提交于 2021-01-29 08:40:21
问题 I'm migrating my project from classic .net to .net core 3.0. I use in my viewmodel ICollectionView interface and it is not recognized in .net core 3.0 framework. I added several nuget packages to attempt to make it work, but with no luck. Microsoft claims System.ComponentModel defines icollectionview (https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.icollectionview?view=netcore-3.0), but it is not found. I also tried to include windowsbase, but it's not found either. Is my