nuget

拥抱.NET Core系列:MemoryCache 初识 (转载)

旧街凉风 提交于 2021-01-06 02:36:45
阅读目录 MSCache能做什么? 从IMemoryCache说起 开发者的体验 写在最后 Cache是一个绝大多数项目会用到的一个技术,说起到缓存可能就联想到 Set、Add、Get、Remove、Clear 这几个方法。那么在.NET Core中微软给我们带来了什么样的缓存体验呢?今天我们就来介绍下”Microsoft.Extensions.Caching.Memory”。 由于这个包名称过长,下文使用MSCache来代替 。 回到目录 MSCache能做什么? 绝对过期支持 滑动过期支持(指定一个时间,TimeSpan,指定时间内有被Get缓存时间则顺延,否则过期) 过期回调 自定义过期 MSCache目前最新的正式版是 2.0.0,预览版是2.1.0,会与.NETCore 2.1一起发布。本篇用了2.0.0版本 开源在GitHub上,仓库地址是: https://github.com/aspnet/Caching NuGet地址为: https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory/2.0.0 回到目录 从IMemoryCache说起 IMemoryCache 就提供了三个方法并实现了 IDisposable 接口。 很好理解 CreateEntry 添加一个缓存 Remove 删除一个缓存

VS2017 nuget package files treated as link instead of actual file

三世轮回 提交于 2021-01-04 05:57:31
问题 I am trying to create a nuget using the csproj file. My files are copied, but my log4net.config (and others) are treated as a link when the nuget package is imported by another project. These files are also not copied to the target directory on build. (see the blue icon in the screenshot below) My cs project contains the following code. <ItemGroup> <Content Include="contentFiles/**/*.*;log4net.config" copyToOutput="true"> <IncludeInPackage>true</IncludeInPackage> <CopyToOutput>true<

ASP.NET Core WebAPI帮助页--Swagger简单使用1.0

孤人 提交于 2021-01-03 14:36:06
1、什么是Swagger? Swagger 是一个规范且完整的框架,提供描述、生产、消费和可视化RESTful API ,它是为了解决Web API生成有用文档和帮助页的问题。 2、为啥选用swagger? 1)它具有交互式文档、客户端SDK生成和API可发现性等优点。 2)书写api说明文档的工具有很多,但是能称之框架只有swagger 3、 Swagger 规范 (swagger.json) Swagger 流的核心是 Swagger 规范,默认情况下是名为 swagger.json 的文档。 它由 Swagger 工具链(或其第三方实现)根据你的服务生成。 它描述了 API 的功能以及使用 HTTP 对其进行访问的方式。 它驱动 Swagger UI,并由工具链用来启用发现和客户端代码生成。 4、ASP.NET Core 使用Swagger生成api说明文档 4.1引用Nuget包,“ Swashbuckle.AspNetCore ” Swashbuckle.AspNetCore 是一个开源项目,用于生成 ASP.NET Core Web API 的 Swagger 文档。 Swashbuckle 有三个主要组成部分: Swashbuckle.AspNetCore.Swagger :将 SwaggerDocument 对象公开为 JSON 终结点的 Swagger

How to include pre-release packages with MSBuild restore target

自闭症网瘾萝莉.ら 提交于 2021-01-03 05:34:24
问题 This question is specific to MSBuild 15.1+ (Visual Studio 2017) and to PackageReference , which is the new way Nuget is fully integrated within MSBuild . In my continuous integration script, I've got something like: MSBuild.exe /t:Restore MySolution.sln /p:RestoreConfigFile=NuGet.config One of the csproj file contains: <PackageReference Include="MyPackageA"> <Version>1.2.*</Version> </PackageReference> MyPackageA is an internal package and I would like nuget to resolve the reference to the

How to find out which .NET framework nuget package targets?

半世苍凉 提交于 2021-01-02 05:07:28
问题 I have C# project that has to target .NET 3.5. framework and I have several nuget packages I'd like to install in the given project. How to find out, for a given nuget package, which .NET framework versions it supports (by version of package for example), without me trying to install every available version of the package in order to see if its installation will pass without rolling back because of the dependency of the given version of the package to .NET framework higher than 3.5.? For

How to find out which .NET framework nuget package targets?

两盒软妹~` 提交于 2021-01-02 05:06:26
问题 I have C# project that has to target .NET 3.5. framework and I have several nuget packages I'd like to install in the given project. How to find out, for a given nuget package, which .NET framework versions it supports (by version of package for example), without me trying to install every available version of the package in order to see if its installation will pass without rolling back because of the dependency of the given version of the package to .NET framework higher than 3.5.? For

How to find out which .NET framework nuget package targets?

徘徊边缘 提交于 2021-01-02 05:04:58
问题 I have C# project that has to target .NET 3.5. framework and I have several nuget packages I'd like to install in the given project. How to find out, for a given nuget package, which .NET framework versions it supports (by version of package for example), without me trying to install every available version of the package in order to see if its installation will pass without rolling back because of the dependency of the given version of the package to .NET framework higher than 3.5.? For

Nuget Semver - what are allowed prerelease characters?

半世苍凉 提交于 2021-01-01 07:08:15
问题 I'm trying to use semantiv versioning for one of my .Nuget Packages (.Net Core 2) The Version looks like this 1.0.0-my_fancy_branch.123. As you can guess, I try to set the branch name and the current BuildId as a prerelease tag. Unfortunately, dotnet build spews this error: ... is not a valid version string. But why? The absolutely great documentation of dotnet push / nuget does not list any forbidden characters. And I thought PIP is obtuse... 回答1: According to the reference on NuGet package

Nuget Semver - what are allowed prerelease characters?

被刻印的时光 ゝ 提交于 2021-01-01 07:06:53
问题 I'm trying to use semantiv versioning for one of my .Nuget Packages (.Net Core 2) The Version looks like this 1.0.0-my_fancy_branch.123. As you can guess, I try to set the branch name and the current BuildId as a prerelease tag. Unfortunately, dotnet build spews this error: ... is not a valid version string. But why? The absolutely great documentation of dotnet push / nuget does not list any forbidden characters. And I thought PIP is obtuse... 回答1: According to the reference on NuGet package