.net-standard

Netstandard1.x Nuget packages cannot be installed for netstandard1.x projects

北慕城南 提交于 2019-12-05 10:21:45
问题 After doing a fresh Windows 10 installation along with latest Visual Studio 2015, netcore, and nuget tooling - I can no longer install Nuget packages to any .netstandard projects. Here's some example output: Restoring packages for 'ClassLibrary1'. Restoring packages for c:\users\zone1\documents\visual studio 2015\Projects\ClassLibrary1\ClassLibrary1\project.json... Package System.ComponentModel.EventBasedAsync 4.0.11 is not compatible with netstandard1.3 (.NETStandard,Version=v1.3). Package

Add build number to package version with `dotnet pack` in VSTS Build process

大兔子大兔子 提交于 2019-12-05 10:14:46
With a .NET Framework library you could specify a version with a wildcard and NUGET pack command would append the build date and version automatically when running a NUGET Build Task in VSTS. [assembly: AssemblyVersion("1.0.*")] NUGET PACK would generate a NUPKG file with a version like 1.0.6604.1234 appending the date number and a build ID. NET Standard issues In .NET Core and .NET standard the new .csproj format does not support this wildcard format. We can't package with Nuget.exe (reason: this issue ) but we can use dotnet pack except I need to auto-increment the build numbers. The dotnet

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

。_饼干妹妹 提交于 2019-12-05 02:23:14
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) and references were added to System.IO.Compression.FileSystem and my standard class library: using

CPU usage in .net core (at least on Windows)

强颜欢笑 提交于 2019-12-05 01:27:11
So PerformanceCounter is gone in dotnet core. I understand it was because it was not Linux-compatible. This comment here: ( What is the story of Performance Counters for .NET Core? ) seems to suggest that if I was willing to run it only on Windows I could "make use of Windows-specific features", but I don't know how I could integrate that in dotnet core. The reason I am willing to do this workaround is to keep the dotnet core codebase so I don't have to migrate once there is a cross-platform solution for PerformanceCounter . So to summarize my question: how can I run the CPU usage in dotnet

VS 2017 RC : I Can not update NETStandard.Library in Nuget

血红的双手。 提交于 2019-12-05 00:51:42
From the last (or maybe the two last) update, I can't update the package NETStandartLibrary in Nuget. I just create a new standard library project. See this message : In project's properties, the version is different : And in the .csproj : <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard1.4</TargetFramework> </PropertyGroup> </Project> In Nuget, I add the dependency 'Microsoft.EntityFrameworkCore', then I got the warning : Warning Detected package downgrade: NETStandard.Library from 1.6.1 to 1.6.0 AgainTest (>= 1.0.0) -> Microsoft.EntityFrameworkCore (>= 1.1.0) ->

How can I change a .NET standard library to a .NET framework library?

自古美人都是妖i 提交于 2019-12-04 23:52:47
I'm writing a class library for a simple parser in C#. When I first created it, I used .NET standard 2.0, but now I need to migrate it to .NET 4.6 both to conform to the other projects in my solution and in order to use NUnit. I tried to follow the instructions in the Microsoft documentation , but when I try to select another framework in the properties, I can only find other .NET standard versions. How can I migrate it? Will I need to manually edit the .csproj file? Open up the project file (.csproj) and change the TargetFramework to net462 <PropertyGroup> <TargetFramework>net462<

Type does not contain a definition for 'GetProperties'

别说谁变了你拦得住时间么 提交于 2019-12-04 22:59:11
I am migrating a library project to a .net standard and I am getting the following compilation error when I try to use the System.Reflection API to call Type:GetProperties() : Type does not contain a definition for 'GetProperties' Here it is my project.json : { "version": "1.0.0-*", "buildOptions": { "debugType": "portable" }, "dependencies": {}, "frameworks": { "netstandard1.6": { "dependencies": { "NETStandard.Library": "1.6.0" } } } } What am I missing? As of writing this, GetProperties() is now: typeof(Object).GetTypeInfo().DeclaredProperties; Update : with .NET COre 2.0 release the System

How to use WCF services in .netstandard with Xamarin.Forms project?

只谈情不闲聊 提交于 2019-12-04 22:43:34
问题 I've created a Xamarin.Forms project with .netstandard 2.0 as PCL project. I'm trying to consume WCF services in that project. I've added the connected service for WCF service. When I'm trying to call any method provided in the service, it gives the error as below: System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Error in deserializing body of request message for operation

Reference a .NET Standard 1.6 library from a .net 4.6.2 library

一个人想着一个人 提交于 2019-12-04 21:44:38
问题 I have a home grown nuget package that targets netstandard1.6 published to a private feed. When I try to install it into a package that targets .NET Framework 4.6.2, nuget tells me: You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. The dependency list for the package looks like: I'm

How to tell if a class is supported by .Net Standard Library?

我与影子孤独终老i 提交于 2019-12-04 18:27:38
My current specific situation is that I want to use DataContractSerializer Class in a library supporting .NETStandard1.3. I am unable to reference it in the library. The document gives me an impression that it is a part of .Net Standard Library. Could you anyone offer a tip on how to determine if a class is supported by .Net Standard Library? Your one-stop shop for all .NET-based APIs .NET API Browser select .Net Standard select version Enter your search: DataContractSerializer You find DataContractSerializer in .Net Standard 2.0 only The first version supporting that is .NET Standard 2.0. You