.net-core

I'm getting the error “Microsoft.AspNetCore.Hosting.Abstractions, Version=3.1.0.0” in .NET Core 3.1 app

痞子三分冷 提交于 2021-02-11 14:46:19
问题 The latest version of "Microsoft.AspNetCore.Hosting.Abstractions" is 2.2.0, so I'm not sure where it's getting 3.1.0.0. I've gone through all of my .csproj files, and all of them are referencing 2.2.0. I'm not sure where else to look. I have 3 different applications (solutions) that share projects, and this is happening on all of them at different times. One of them works if I publish it from VS, but I'd like to try to get them deployed using Azure DevOps release pipeline. 回答1: The Nuget

Azure batch task dependencies: copy files from previous

无人久伴 提交于 2021-02-11 14:41:36
问题 I have a Azure Batch scenario where I have a chain of Tasks which are run after each other. Dependencies are set correctly so they run nicely after each other. However I need to copy all files from the previous Task's folder to the new Task's folder before execution. I do not know in advance how many and what files there will be so I just want to copy everything. I could not find a way to accomplish this with the Batch client library (https://docs.microsoft.com/en-us/dotnet/api/overview/azure

MySQL with EntityFramework Core - Composite Foreign Key

China☆狼群 提交于 2021-02-11 14:19:30
问题 I have two tables Project and ProjectMedia . they are defined as follow: CREATE TABLE `project` ( `ID` int(11) NOT NULL, `LANG` char(2) NOT NULL, `NAME` varchar(64) CHARACTER SET utf8 DEFAULT NULL, `DESCS` varchar(2048) CHARACTER SET utf8 DEFAULT NULL, `SHORT_DESC` varchar(512) CHARACTER SET utf8 DEFAULT NULL, PRIMARY KEY (`ID`,`LANG`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ID and LANG are a composite primary key in the Project table. ProjectMedia table definition: CREATE TABLE `project

How to acquire a token with Azure AD and MSAL in ASP.NET

两盒软妹~` 提交于 2021-02-11 14:18:29
问题 I'm trying to authenticate a token using Azure AD. In a console application , I have no problem with this thanks to IConfidentialClientApplication: static void Main(string[] args) { Console.WriteLine("Making the call..."); RunAsync().GetAwaiter().GetResult(); } private static async Task RunAsync() { AuthConfig config = AuthConfig.ReadJsonFromFile("appsettings.json"); IConfidentialClientApplication app; app = ConfidentialClientApplicationBuilder.Create(config.ClientId) .WithClientSecret(config

HTTP Error 500.30 - ANCM In-Process Start Failure On a localhost .net core 3.1.1 API C#

为君一笑 提交于 2021-02-11 14:16:15
问题 Windows Error Log: failed to load coreclr. Exception message: CLR worker thread exited prematurely Details: Application 'EnterpriseReportsAPI' with physical root '...\Repos\InternalReportsAPI\EnterpriseReportsAPI' failed to load coreclr. Exception message: CLR worker thread exited prematurely Process Id: 10688. File Version: 13.1.19350.1. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: e276c8174b8bfdeb70efceafa81c75f8badbc8db Every thing works more or less fine until I try to

How to use JsonObject of Pomelo.EntityFramework

风流意气都作罢 提交于 2021-02-11 14:15:11
问题 I want to store list of string into mysql table as json. I saw there is support for this in pomelo entityframework. I followed this https://libraries.io/github/tuanbs/Pomelo.EntityFrameworkCore.MySql Here is my entity public class Project { public int Id {get;set;} public string Title {get;set;} public JsonObject<List<string>> Tags {get;set;} } But when _context.Database.EnsureDeleted(); is called it gives below error Navigation property 'Tags' on entity type 'Project' is not virtual.

DrawingCore exception in azure function c# .net

半世苍凉 提交于 2021-02-11 13:55:39
问题 Unhandled Exception: System.MemberAccessException : Object is busy and cannot state allow this operation [GDI+ status: ObjectBusy] at System.DrawingCore.GDIPlus.CheckStatus(Status status) at System.DrawingCore.Image.Dispose(Boolean disposing) at System.DrawingCore.Image.Finalize() This error occurs once in a while for following code. I am using sautinsoft library and imageFormat is of System.DrawingCore.Imaging. using (Stream fs = pdfFile.OpenReadStream()) { await Task.Run(() => _pdfFocus

DrawingCore exception in azure function c# .net

泄露秘密 提交于 2021-02-11 13:51:18
问题 Unhandled Exception: System.MemberAccessException : Object is busy and cannot state allow this operation [GDI+ status: ObjectBusy] at System.DrawingCore.GDIPlus.CheckStatus(Status status) at System.DrawingCore.Image.Dispose(Boolean disposing) at System.DrawingCore.Image.Finalize() This error occurs once in a while for following code. I am using sautinsoft library and imageFormat is of System.DrawingCore.Imaging. using (Stream fs = pdfFile.OpenReadStream()) { await Task.Run(() => _pdfFocus

ps not fount when attaching .Net Core WebApi to Docker container

萝らか妹 提交于 2021-02-11 13:50:48
问题 I am trying to debug my .Net Core webApi project using Docker. However, I am struggling to make it work. I was following this link, to attached my .Net Core app on Docker using VS Code. This is my Dockerfile FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env #install debugger for NET Core RUN apt update && \ apt install -y procps && \ curl -sSL https://aka.ms/getvsdbgsh | /bin/sh /dev/stdin -v latest -l /vsdbg WORKDIR /app # Copy csproj and restore as distinct layers COPY *.csproj ./ RUN

Deserialize complex polymorphic types with System.Text.Json

老子叫甜甜 提交于 2021-02-11 13:39:15
问题 The dotnet example in the documentation: https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-converters-how-to#support-polymorphic-deserialization shows manually parsing each property of a polymorphic type. However: my polymorphic objects are complex deep hierarchies, I can't hand code every field so I need to invoke the JsonSerializer . the clue for the type is specified in sibling fields. Given there is no guarantee about json element order, a Utf8JsonReader may