nuget

如何在 ASP.Net Core 使用 分布式缓存

你说的曾经没有我的故事 提交于 2021-01-30 01:38:48
ASP.Net Core 提供了多种类型的缓存,除了 内存缓存 和 响应缓存 之外,还提供了对 分布式缓存 的支持。在之前的一篇文章中,我讨论了 ASP.Net Core 的内存缓存。在本文中,我们将讨论如何在 ASP.Net Core 中使用分布式缓存,本篇就拿 Redis 和 SQL Server 作为演示。 什么是分布式缓存 分布式缓存 可用于提高应用程序的性能和可伸缩性,通常 分布式缓存 被多个应用服务器共享,在分布式缓存中,缓存的数据不会落在某些个别的web服务器内存中,这些缓存数据采用集中化存储,这样多个应用服务器都可以直接使用,这样做的好处在于,如果任何一个服务器宕机或者停止响应,其他的服务器仍然能够检索缓存的数据。分布式缓存的另一个优点是,缓存的数据在服务器重启后仍然存在,当你的应用集群扩展时,并不会对缓存服务器造成任何影响。 要想在 ASP.NET Core 中使用分布式缓存,需要用到 IDistributedCache 接口,在下一节中,我们将会一起讨论 IDistributedCache 和 IMemoryCache 接口的区别。 IDistributedCache 接口 在.Net Core 中用于分布式缓存的 IDistributedCache 接口要比 单机版的 IMemoryCache 接口更复杂,先来看一下 IMemoryCache 接口定义。

Installing SQLite NuGet Package installs the package but the reference is not available. VS2019 Community

浪尽此生 提交于 2021-01-29 20:26:19
问题 I"m writing a c# application using SQLite and I need the the SQLite Reference. Using NuGet I locate the package and the output window shows a successful install. Looking at the packages config file in the solution explorer it shows the version installed. <?xml version="1.0" encoding="utf-8"?> <packages> <package id="SQLite" version="3.13.0" targetFramework="net472" /> </packages> However under the project References in the Solution explorer SQLite is not there. I have watched tutorials online

How to cleanly automate authentication for Azure Devops feeds?

梦想的初衷 提交于 2021-01-29 18:29:38
问题 Presumably there are lots of companies who are facing the same struggle we are. For any microservice, before running a dotnet restore we need to first ensure we've successfully configured our ADO package feeds with an active token. To achieve this we have a script which downloads and runs the CredentialProvider.VSS.exe (as suggested by Microsoft), using the output to build credentials which then register the feeds on the user's computer. This needs to happen daily as the tokens generated will

Importing content-only package to DotNet Core 3.1 project in Visual Studio 16.6

守給你的承諾、 提交于 2021-01-29 18:02:38
问题 I have defined and created a content-only package to share JSON schemas between different projects. I packaged it using nuget.exe , and could successfully add it to .Net Framework 4.6 library project. But when I tried to add it to the DotNet Core 3.1 library project (NUnit tests) the following error occurred: NU1212 Invalid project-package combination for <package name>. DotnetToolReference project style can only contain references of the DotnetTool type Nuget support documentation (package

'' is not a valid version string." exception in nuget for VS2019

丶灬走出姿态 提交于 2021-01-29 16:36:08
问题 I have installed VS 2019 today removing all other versions of VS (over come space crunch). Am trying to use nuget package manager but keep getting below exception. Nothing loads. I tried to install packages from console and ended up with same error as below. Any help would be appreciated. PM> Install-Package Microsoft.Azure.Devices -Version 1.21.0 Install-Package : '' is not a valid version string. At line:1 char:1 + Install-Package Microsoft.Azure.Devices -Version 1.21.0 + ~~~~~~~~~~~~~~~~~~

Doing a local NuGet package installation but getting the error - Unable to get repository signature information

元气小坏坏 提交于 2021-01-29 16:16:20
问题 I'm trying to do an offline NuGet package installation by following the answer by Samuel Jack here: Text 1. Add the files to a folder called LocalPackages next to solution 2. Create a file called NuGet.config next to solution file The .nupkg files are stored locally and installed using NuGet Package Manager but I'm getting this error - "Unable to get repository signature information for source https://api.nuget.org/v3-index/repository-signatures/5.0.0/index.json. Response status code does not

How to create Nuget package with nested dependencies

蓝咒 提交于 2021-01-29 15:43:41
问题 I'm working on a .NET Core solution. For one of the projects within the solution, I need to build a Nuget package. Project A has a reference to another project B in the solution, set up as a project reference. Project B has a dependency on a Nuget package C. Now, when I create a Nuget package for A, it includes A.dll and B.dll but not C.dll Can someone help me figure this out? How can I include all 3 .dlls? Thanks, Andy 回答1: See https://github.com/NuGet/Home/issues/3891 for the feature

Should nugets installed for library project also be installed to the application project?

做~自己de王妃 提交于 2021-01-29 09:30:38
问题 If I have a library project MyLib which requires Nuget XYZ , and I create application MyApp which has a dependency on MyLib , am I required to add the nuget dependencies explicitly to MyApp or is VS supposed to figure this out? I couldn't find a definitive answer to this basic question, and my tests are showing inconclusive results - I see some DLLs get copied to the /bin folder and others semingly don't. In my project references, the Nuget assemblies are not listed and I'm not sure if they

Why is TinyIoC not picked up in my Xamarin.Android project when added using nuget?

拥有回忆 提交于 2021-01-29 08:35:56
问题 So I installed TinyIoC v1.3.0 using nuget in my Xamarin.Android project, its in the references, but I cannot type using TinyIoC; without a compile error. I would like to understand why this is? PS. I know I can use the TinyIoC.cs file directly, but I thought it would be more convenient to update if I added using nuget. I get this error: 回答1: I think the issue is related to the nuget package TinyIoC 1.3.0 itself. The nuget package does not contain the lib folder with the related dll so that

Is there a better way of downloading nuget packages required for .NET work for an offline enviroment?

守給你的承諾、 提交于 2021-01-29 08:21:07
问题 Currently facing a problem where I have an offline enviroment with Visual Studio on it. Web Application development works fine with my offline Visual Studio installer, absolutely no problems there. But when it comes to MSTest and other things, I seem to be running into issues with missing nuget packages. As far as I can make out there's no installers that provide these packages (things like Microsoft.VisualStudio etc) and the best way seems to be to let a machine with internet connectivity