.net-standard

Is there a way to publish a .NET Standard Library without producing a .nupkg in Visual Studio 2019?

元气小坏坏 提交于 2019-12-24 20:05:32
问题 My understanding is that when you publish a .NET Standard Library, the expected behavior is to produce a .nupkg . I have internal .Net Standard libraries that I maintain for use on in-house projects. A typical workflow would be to publish the libraries and then copy the published files to consuming projects. Is this not the way I should be doing things? I'm a bit confused by the lack of options when publishing a .NET Standard Library -- being that there is a .nupkg without a choice to publish

C# IFormFile as ZipFile

可紊 提交于 2019-12-24 18:31:13
问题 I have a REST API endpoint which receives zip file on .Net Core 1.1. I'm getting IFormFile from request like this var zipFile = HttpContext.Request.Form.Files.FirstOrDefault(); And then I need to pass it to service method from .Net Standard 1.5, where IFormFile is not supported. So the question is: how can I convert IFormFile to ZipFile or to some other type which is supported in Standard 1.5, or maybe there is some more proper way to operate with zip files? Thanks! 回答1: IFormFile is just a

XslCompiledTransform.Load(type) : Could not load file or assembly 'System.Data.SqlXml

雨燕双飞 提交于 2019-12-24 08:55:45
问题 I am trying to load compiled XSL (using XSLTC.exe) in my .net core 2.0 solution but getting below error. System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.' Assembly asm = Assembly.LoadFrom(@"..."); Type t = asm.GetType("..."); myXslTransform.Load(t); The documentation says that, it should load file generated from XSLTC.exe but not working. Is

Nuget Pkg Dlls Missing from Build Folder in .Net Standard DLL Project. dlls are Not Copy Local? Fix in Visual Studio 2019?

偶尔善良 提交于 2019-12-24 06:17:09
问题 I have Visual Studio 2019 Community Edition Steps to reproduce: I load up VS and start a brand new C# .Net Standard Library project. I go to Nuget Pkg Manager and install ANY nuget package. I add a single line to Class1.cs to use a Type from the package. For instance, if I install WatsonTCP nuget package, I change Class1.cs to look like this: using System; using WatsonTcp; namespace NugetTest { public class Class1 { public Class1() { WatsonTcpClient client = new WatsonTcpClient("", 0); } } }

What's the equivalent of NamespaceManager.GetQueue.MessageCount in the new NET Standard Microsoft.Azure.ServiceBus?

旧街凉风 提交于 2019-12-24 02:45:21
问题 What's the equivalent of NamespaceManager in the new NET Standard Microsoft.Azure.ServiceBus? I've used WindowsAzure.ServiceBus to do things like count messages in a queue ... var namespaceManager = NamespaceManager.CreateFromConnectionString(SbConnectionString); var count = namespaceManager.GetQueue(queueName).MessageCount; Moving over to the new Microsoft.Azure.ServiceBus .NET Standard library, but whilst it's got classes like QueueClient and TopicClient, it's not got any NamespaceManager

.NET Standard over PCL Xamarin.Forms.Core project

百般思念 提交于 2019-12-24 02:23:14
问题 I'm reading that .NET Standard is now preferred over PCL class libraries to share code. My question is should I use a .NET Standard library over a PCL for the core of a Xamarin Forms solution? Currently, it will target iOS and Android, but we are looking to Tizen for TV in the future. 回答1: .NET Standard will be the future, so if you can you should get on board now. But be aware. If you're planning on using NuGet packages you could run into the situation that a package (or library from another

An error from Azure DevOps Build: Could not locate the assembly “System.ComponentModel.Annotations”

拟墨画扇 提交于 2019-12-23 18:34:01
问题 I have a netstandard 2.0 project with a reference to System.ComponentModel.Annotations . It builds fine on my local computer, but when I try to build it using Azure DevOps pipeline, I get the following error: ...warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.ComponentModel.Annotations". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/home/vsts/work/1/s/src/MyProj/MyProj

PCL vs .NET Standard library for SQLite in UWP

一曲冷凌霜 提交于 2019-12-23 12:53:53
问题 I have following problem. I use Portable library in my UWP application (Portable library is shared with Xamarin app). This portable library references SQLite. In this Portable library I also use Prism and Unity. For that reason I still can't upgrade them to .NET Standard. SQLite library I use is SQLite-net-pcl version 1.4.18. In my UWP app I add same nugget package. The problem is that this nugget package also support .net standard, as result, when I build my UWP library, I got different

running xunit tests included in a .NET Standard 1.6 library

ぐ巨炮叔叔 提交于 2019-12-23 09:17:33
问题 I just created a netstandard library in Visual Studio 2017 and added references to xunit and xunit.runner.visualstudio , but the VS Test Explorer and Resharper 2017 EAP 3 are not recognizing any tests. I've seen: Unit testing a .NET Standard 1.6 library but project.json is gone and csproj is back in place. What do I have to do, to be able to run the unit tests included in a netstandard library? Library.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard1.6<

How to “Add Service Reference” in .NET Standard project

Deadly 提交于 2019-12-23 08:57:11
问题 I would like to do "Add Service Reference" in .NET Standard project.(Visual Studio 2017) I installed "System.ServiceModel.Http" and "System.ServiceModel.Security" on NuGet in order to make WCF access possible. However, there is no "Add Service Reference" menu item in the .NET Standard project. How do I add a service reference? It exists in the .NET Framework project but it does not exist in the .NET Standard project, so it is in trouble. 回答1: I landed here hoping to solve a slightly different