.net-standard-2.0

Azure Functions DocumentClient could not load type from assembly exception

二次信任 提交于 2019-12-10 16:37:33
问题 I have an Azure Function v2 that calls into an utility library, which in turn instantiates a DocumentClient . When running my function locally, it throws an exception on this line: _client = new DocumentClient(new Uri(cosmosDbEndpoint), cosmosDbAuthKey, Storage.SerializerSettings, connectionPolicy); System.Private.CoreLib: Exception while executing function: ComponentDesignInserter-Http-UploadFiles. Microsoft.Azure.Documents.Client: Could not load type 'System.Diagnostics.Eventing

Missing Method Exception When Referencing .Net Standard Project From .Net 4.6.1 Unit Test

荒凉一梦 提交于 2019-12-10 02:44:55
问题 I am getting the following exception when running a .Net 4.6.1 unit test that uses System.IO.Compression.ZipFile.Open , if the unit test project references a .Net Standard 2.0 assembly: System.MissingMethodException: Method not found: 'System.IO.Compression.ZipArchive System.IO.Compression.ZipFile.Open(System.String, System.IO.Compression.ZipArchiveMode)'. at UnitTestProject.UnitTest1.TestMethod1() The unit test project was created using the VS 2017 Unit Test project (not the .NET Core one)

C# Extract public key from RSA PEM private key

≯℡__Kan透↙ 提交于 2019-12-09 03:34:16
问题 I have a private key in PEM format. How can I extract the public key from it. I need to be able to do this in code, pragmatically, without executing a process (using openssl). Sample unused private key: -----BEGIN RSA PRIVATE KEY----- MIIJKQIBAAKCAgEA7drrGdj9TY6MZCm3kuCsXKVD2v5kUS38MCtA5PjGp72/A1IO izG51WjyvCkULjBBQzOr366TcO5HtMzmVlipDzIFJdeQN2Z1gY5oVqA04zGlEAf4 vcgM0ygJLEbtcAYMZz/5Y5RgPqAnv3J3TiB82mbXURVg2PvHp7c+0Rl8vZmC4RIq +DDkxXfccOFh8eaY4VYfIZPHsZZeX6ih+6JbuReCKU7zVPUMspefOyaMNj+NFeVN

Could not load file or assembly System.Data.SqlClient, Version=4.2.0.2 when I use System.Data.SqlClient Version 4.4.3

会有一股神秘感。 提交于 2019-12-08 14:56:17
问题 I use System.Data.SqlClient Version 4.4.3 for all .NET Standard 2.0 class libraries in my ASP.NET Core 2.0 project. Why do I get Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) when the project is published with VSTS to Azure App Service? And of course it perfectly works on my machine! All this worked

Microsoft.AspNet.Identity and Microsoft.AspNet.Identity.EntityFramework in .NET Standard 2.0

ⅰ亾dé卋堺 提交于 2019-12-07 21:12:45
问题 Background: The project we are wokring on consists of several solutions that share two libraries . Everything is written in .NET Framework 4.6.1 today. A goal for the project has been to adopt .NET Core for new projects and being able to run web applications in Docker . With the new release of .NET Standard 2.1 and the fact that .NET Framework 4.8 will remain on .NET Standard 2.0 rather than implement .NET Standard 2.1 it felt like the right time to start. Immo Landwerth from Microsoft says

Is IAsyncEnumerable supported in C# 8.0?

核能气质少年 提交于 2019-12-07 11:43:20
问题 Its really hard to find any information on IAsyncEnumerable , other than a few mentions in the 'What's New c# 8.0' articles. Trying to use it in Visual Studio 2019 with netstandard 2.0 and C# 8 enabled, it does recognize the class but i get a ton of errors on build: 回答1: C# 8 supports these features. However, this wont work with .Net standard 2.0 IAsyncEnumerable Interface Applies to .NET Core 3.0 Preview 3 .NET Standard 2.1 Preview You will have to get either one of the previews. You can

.NET Core, .NET Standard and Transitive Dependencies across Solutions

怎甘沉沦 提交于 2019-12-07 11:08:49
问题 My question is similar to this one, although it doesn't really address my issue. I am working on some new AWS Lambda functions, and I would like to keep their implementation in separate class libraries for reuse. I'm testing this concept using two solutions: A solution with a single .NET Standard class library project. This class library has a reference to HTML Agility Pack. A solution with a single .NET Core 2.0 console application project. Class library: using System; using HtmlAgilityPack;

Microsoft.AspNet.Identity and Microsoft.AspNet.Identity.EntityFramework in .NET Standard 2.0

 ̄綄美尐妖づ 提交于 2019-12-06 12:25:35
Background: The project we are wokring on consists of several solutions that share two libraries . Everything is written in .NET Framework 4.6.1 today. A goal for the project has been to adopt .NET Core for new projects and being able to run web applications in Docker . With the new release of .NET Standard 2.1 and the fact that .NET Framework 4.8 will remain on .NET Standard 2.0 rather than implement .NET Standard 2.1 it felt like the right time to start. Immo Landwerth from Microsoft says this: But what is also true is that the rate of innovation in .NET Framework has to slow down in order

Cant add IdentityServer4 to ASP.NET Framework 4.7.2 API OWIN

三世轮回 提交于 2019-12-06 07:11:50
I'm trying to setup Identity Server 4 Auth server in ASP.NET Framework 4.7.2 WEB API, but I can't get it working. I'm not able to add appBuilder.UseIdentityServer() in the Startup class. My understanding is that the IdentityServer4 is compiled as DotNet Standard 2.0 and the ASP.NET Framework 4.7.2 is compatible with DotNet Standard 2.0, so IDS4 should be able to be used inside 4.7.2 project. Correct me if I'm wrong please. Is it possible to use IdentityServer4 like that? What am I doing wrong here? This is my startup class: public class Startup { public void ConfigureServices

.net standard 2.0 and System.Security.Cryptography.ProtectedData.Protect

怎甘沉沦 提交于 2019-12-06 04:29:03
问题 Looking at System.Security.Cryptography.ProtectedData.Protect @ https://docs.microsoft.com/en-gb/dotnet/api/ as we looking to port a library from 4.7 to .net standard 2.0 library where .net core 2.0 will use it. So I did a search and it only available in full framework and .net core My question is why is it not available in .Net Stanard 2.0? I would have taught if it can be used in for example 4.7 and .net core 2.0 then it would be part of .Net Standard 2.0 回答1: This API is not available "in"