.net-standard

Automatically publish a NuGet package built with VS2017

给你一囗甜甜゛ 提交于 2019-12-03 14:14:50
问题 New in Visual Studio 2017 is the ability to generate a NuGet package on build for some target types (namely, .NET Standard 2.0 which is what I'm using). This works great, and the .nupkg file is generated on successful build. However, I'm not able to figure out how to get the built package automatically published to our local repository. I already tried a post-build event of: nuget push -Source https://my.nuget.server/nuget/ "C:\Source\MyProject\bin\Release\MyProject.1.0.0.nupkg" But this

What is the equivalent of Type.GetGenericArguments() in .NETStandard 1.0 / .NET Core?

北战南征 提交于 2019-12-03 11:41:01
The method System.Type.GetGenericArguments() is 'missing' from .NETStandard 1.0, and I thought that the TypeInfo.GenericTypeArguments was the replacement for GetGenericArguments() , but unfortuntely they behave differently when supplied with an open generic type. Take for instance the following code: Type type = typeof(ICommandHandler<>); type.GetGenericArguments(); // return { TCommand } type.GetTypeInfo().GenericTypeArguments; // returns empty array While the GetGenericArguments() method returns the generic type argument TCommand , the GenericTypeArguments simply returns an empty array for

'Could not load file or assembly 'netstandard, Version=2.0.0.0, …'. Reference assemblies should not be loaded for execution

邮差的信 提交于 2019-12-03 10:18:47
Goal: From a .NET 4.7 console app, using reflection with Assembly.GetType(), I am trying extract the Type of a netstandard 2.0 class from Assembly X. Then I want to create an instance of this Type with Activator.CreateInstance(). What I am trying to do: However, this assembly X has a dependency to netstandard 2.0. To be able to get the Type, netstandard dependency has to be loaded into the AppDomain. That's why when the AppDomain is requesting the netstandard assembly through the AssemblyResolve event, I simply load the dll like this : var netStandardDllPath = @"C:\Users\xxx\.nuget\packages

What are the 43 APIs that are in .Net Standard 2.0 but not in .Net Framework 4.6.1?

∥☆過路亽.° 提交于 2019-12-03 09:36:22
问题 The SO question entitled .NET Standard API Reference, quoting the discussion in https://github.com/dotnet/standard/issues/133, mentions 43 APIs that will be included in the .Net Standard 2.0 but are not supported by .Net Framework 4.6.1. However, I have not been able to find a list of those 43 APIs anywhere on the Internet. The closest I've come in my search is https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.5_diff.md and https://github.com/dotnet/standard/blob

What are .NET Platform Extensions on docs.microsoft.com?

陌路散爱 提交于 2019-12-03 09:33:32
There is a framework-level navigation element at Microsoft Docs called ".NET Platform Extensions" . It contains docs on recently added APIs like System.IO.Pipelines and System.Threading.Channels for example, as well as a whole bunch of other APIs, including the not-so-recent ones. Some APIs from this collection are available as nuget packages (for both .Net Core and .Net Framework), but others are not seemingly available. Also, as of now, there is no nuget package called ".NET Platform Extensions" or anything similar. So, the question is what exactly does this collection of APIs represent?

Reference netstandard 2.0 types in ASP.NET MVC 5 razor views in .NET 4.7.1

匆匆过客 提交于 2019-12-03 06:01:10
问题 .NET 4.7.1 was supposed to solve problems we had in referencing netstandard 2.0 libraries from the full framework. It sort of did, despite some continuing and painful dll conflict warnings and related problems, and the need to manually update to PackageReferences (see this wondeful extension). Nonetheless, one can get it working, though see note 1 below, and if I may say: it is unfortunate to say the least that there has been no VStudio help or much guidance on this and related issues, till

Automatically publish a NuGet package built with VS2017

风格不统一 提交于 2019-12-03 03:22:25
New in Visual Studio 2017 is the ability to generate a NuGet package on build for some target types (namely, .NET Standard 2.0 which is what I'm using). This works great, and the .nupkg file is generated on successful build. However, I'm not able to figure out how to get the built package automatically published to our local repository. I already tried a post-build event of: nuget push -Source https://my.nuget.server/nuget/ "C:\Source\MyProject\bin\Release\MyProject.1.0.0.nupkg" But this presents 2 problems: The name of the package includes the version number and this isn't available as a post

Type 'Object' is defined in an assembly that is not referenced (NET Standard 2.0/.NET Framework 4.6.1)

大兔子大兔子 提交于 2019-12-03 01:04:10
I'm using the .NET Standard 2.0 preview, on which my Class Libraries are based. After having trouble with a few NuGet packages, especially regarding archive extraction, I decided to migrate my .NET Core 2.0 Console projects back to the .NET Framework 4.6.1. The .NET Framework 4.6.1 is supposed to implement the .NET Standard 2.0 specification - according to different sources. Especially the dotnet/standard GitHub Repo . Unfortunately, the migration to the .NET Framework resulted in the following errrors throughout all of .NET Framework Console projects: Error CS0012 The type 'Object' is defined

What are the 43 APIs that are in .Net Standard 2.0 but not in .Net Framework 4.6.1?

久未见 提交于 2019-12-02 22:36:03
The SO question entitled .NET Standard API Reference , quoting the discussion in https://github.com/dotnet/standard/issues/133 , mentions 43 APIs that will be included in the .Net Standard 2.0 but are not supported by .Net Framework 4.6.1. However, I have not been able to find a list of those 43 APIs anywhere on the Internet. The closest I've come in my search is https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.5_diff.md and https://github.com/dotnet/standard/blob/master/docs/versions/netstandard1.6_diff.md , which list the APIs introduced in .Net Standard 1.5 and 1.6.

Reference netstandard 2.0 types in ASP.NET MVC 5 razor views in .NET 4.7.1

这一生的挚爱 提交于 2019-12-02 20:54:55
.NET 4.7.1 was supposed to solve problems we had in referencing netstandard 2.0 libraries from the full framework. It sort of did, despite some continuing and painful dll conflict warnings and related problems, and the need to manually update to PackageReferences ( see this wondeful extension ). Nonetheless, one can get it working, though see note 1 below, and if I may say: it is unfortunate to say the least that there has been no VStudio help or much guidance on this and related issues, till now one has to find such help on back channels on github. This very problem itself ideally would have