你的位置: 首页 / 资讯列表 / 分类资讯

最新.NET/.NET Core/Web开发资讯源


登录专享特权: 登录后点击链接可直接跳转到原文地址。

26 热度

Monitoring .NET Core applications on Kubernetes

In this article, I show you how to use Prometheus to monitor a .NET Core application running on Kubernetes. Note that installation instructions are not included with the article. I do include a reference for using the Prometheus Operator to create and configure Prometheus on Kubernetes.

收录时间: 2020-08-07
分类: .NET Core
贡献者: Rector
39 热度

Visual Studio 2019 for Mac version 8.7 is now available

Visual Studio 2019 for Mac version 8.7 is available today and includes support for gRPC / OpenAPI client generation and improved unit testing integration. Additionally, it includes several improvements for Xamarin developers, including Xamarin.Forms 4.8 Support. This release also includes initial support for macOS Big Sur, with the exception of Xamarin support. macOS Big Sur support for Xamarin is expected in one of the first servicing releases for Visual Studio for Mac 8.7.

收录时间: 2020-08-07
分类: Visual Studio
贡献者: Rector
29 热度

Visual Studio 2019 v16.7 and v16.8 Preview 1 Release Today!

Today we are excited to announce the release of Visual Studio 2019 version 16.7 and Visual Studio 2019 version 16.8 Preview 1. Each of these releases have features we have been working hard to deliver. Install version 16.7 to start using our highlight improvements. Included in this list are Git integration including a new merge editor and easy conflict resolution, WPF design-time data, C++ support for 64-bit projects and debug builds, and additional IntelliSense functionality.

收录时间: 2020-08-06
分类: Visual Studio
贡献者: Rector
25 热度

Removing ALL assembly names in Json.NET TypeNameHandling output

In some cases, it may be desirable to include type name information in Json.NET output but for those type names to not include assembly names. In my case it's because I have a Shared Project that contains classes that I want to appear in my .NET Core C# server code and in my Bridge.NET client code and this results in the class names existing in assemblies with different names (but there are also other people with their own cases, such as How do I omit the assembly name from the type name while serializing and deserializing in JSON.Net?.

收录时间: 2020-08-06
分类: .NET
贡献者: Rector
33 热度

Using .NET Core Tools to Create Reusable and Shareable Tools & Apps

Starting with .NET Core 2.1 Microsoft introduced the Dotnet Tools platform as part of the .NET Core SDK and since then these tools have become a vital although underutilized part of the .NET Eco system. Dotnet Tools are a simple way to create, publish and consume what are essentially .NET Core applications that can be published and shared using the existing NuGet infrastructure for packaging and distribution. This means it's really quick and easy to build tools that you can share either publicly or privately.

收录时间: 2020-08-06
分类: .NET Core
贡献者: Rector
29 热度

Handle HTTP Status Codes With Razor Pages

In this post, we’ll see how we can use a middleware to process status codes respectfully so that both humans and our web clients get the necessary information necessary to take the next step.

收录时间: 2020-08-06
分类: ASP.NET Core
贡献者: Rector
AD 友情赞助
31 热度

How to call stored procedures with OUTPUT parameters with FromSqlRaw in EF Core

In this post I will show how you can call stored procedures with OUTPUT parameters from EF Core. I am using the Northwind database for the sample code.

收录时间: 2020-08-06
贡献者: Rector
25 热度

Roslyn 读取 PackageReference 的版本号和内容

在写 msbuild 的预编译逻辑,如果想要拿到项目安装的 NuGet 库和版本,可以通过获取 PackageReference 的方法获取。获取方法是放在 Target 里面,如下面代码...

收录时间: 2020-08-06
分类: .NET
贡献者: Rector
35 热度

Best way to create an empty collection (array and list) in C# (.NET)

I one of APIs I was working a while back I needed to return an empty collection. It was not a performance critical code, yet I decided what would be the best way to do it. Exploring and learning. The signature required me to return List, but I started with testing arrays first. I expected Array.Empty to be clear winner, but I was also interested how other “common” ways stack up.

收录时间: 2020-08-05
分类: .NET
贡献者: Rector
31 热度

Testing and Configuration in .NET Core

When running automated tests, or running things locally, I often want to use a different configuration to what I would run in production. A JSON file often suffices for local development, however this isn’t useful for automated tests where I want different configurations for different tests, or if my configuration is dynamic (e.g. I need to spin up a docker container during startup, and I have to get some configuration from that on the fly).

收录时间: 2020-08-05
分类: .NET Core
贡献者: Rector
28 热度

.Net Core HttpClient处理响应压缩

在上篇文章[ASP.NET Core中的响应压缩]中我们谈到了在ASP.NET Core服务端处理关于响应压缩的请求,服务端的主要工作就是根据Content-Encoding头信息判断采用哪种方式压缩并返回。之前在群里有人问道过,现在的网络带宽这么高了还有必要在服务端针对请求进行压缩吗?确实,如今分布式和负载均衡技术这么成熟,很多需要处理高并发大数据的场景都可以通过增加服务器节点来进行。但是,在资源受限的情况下,或者是还没必要为了某一个点去增加新的服务器节点的时候,我们还是要采用一些程序本身的常规处理手段来进行处理。笔者个人认为响应压缩的使用场景是这样的,在带宽压力比较紧张的情况,且CPU...

收录时间: 2020-08-05
分类: .NET Core
贡献者: Rector
28 热度

十分钟搭建自己的私有NuGet服务器-BaGet

开始搭建BaGet上传程序包在vs中使用其他最后前言NuGet是用于微软.NET(包括 .NET Core)开发平台的软件包管理器。NuGet能够令你在项目中添加、移除和更新引用的工作变得更加快捷方便。通常使用NuGet都是官方的服务,但你有没有想过搭建自己的NuGet呢?在私有的NuGet上托管一些自己的类库,公司内部的类库等。。。搭建私有NuGet的方法有很多,比如NuGet.Server、ProGet、MyGet等等。本文使用的是BaGet,搭建过程也非常简单,下面进入正题。开始搭建BaGetBaGet是一个构建于ASP.NET Core 基础上的 NuGet V3 服务器的开源...

收录时间: 2020-08-05
分类: 开发工具
贡献者: Rector
31 热度

asp.net core 3.1多种身份验证方案,cookie和jwt混合认证授权

开发了一个公司内部系统,使用asp.net core 3.1。在开发用户认证授权使用的是简单的cookie认证方式,然后开发好了要写几个接口给其它系统调用数据。并且只是几个简单的接口不准备再重新部署一个站点,所以就直接在MVC的项目里面加了一个API区域用来写接口。这时候因为是接口所以就不能用cookie方式进行认证,得加一个jwt认证,采用多种身份验证方案来进行认证授权。认证授权身份验证是确定用户身份的过程。 授权是确定用户是否有权访问资源的过程。 在 ASP.NET Core 中,身份验证由 IAuthenticationService 负责,而它供身份验证中间件使用。 身份验证服务会使用...

收录时间: 2020-08-05
分类: ASP.NET Core
贡献者: Rector
30 热度

可能是Asp.net Core On host、 docker、kubernetes(K8s) 配置读取的最佳实践

可能很多新手都会遇到同样的问题:我要我的Asp.net Core 应用传统方式直接部署(host),docker部署(docker-compose),kubernetes(以下称k8s)下部署,都用统一的方式读取配置,怎么实现呢?大家知道,我们默认平时配置文件以appsettings.json 、appsettings.{EnvironmentName}.json 形式存在,这样在host方式下面没有问题,但在docker下,如果直接把配置打包到镜像,那每次改一下下配置就需要重新打包,那成本太大了。另外在k8s下面又有Secret、ConfigMap等多种方式管理配置,如何把多种配置存储和读取,有机结合、同一份代码统一管理使用,是我们今天的主题。

收录时间: 2020-08-05
分类: ASP.NET Core
贡献者: Rector
28 热度

asp.net core 3.1 自定义中间件实现jwt token认证

asp.net core 3.1 自定义中间件实现jwt token认证...

收录时间: 2020-08-05
分类: ASP.NET Core
贡献者: Rector
AD 友情赞助
30 热度

C# dotnet 使用 startIndex 提升 IndexOf 的性能

在代码审查 WPF 仓库的时候,小伙伴告诉我说使用 dotnet core 版本的 WPF 开了 ReadyToRun 的提升还不够大,他准备开始一大波业务无关的优化,其中就包含了 xaml 中的字符串相关优化。我在 davidwrighton 大大的优化代码和 pentp 大大的代码审查里面学到了使用 startIndex 提升 IndexOf 的性能,本文就来和大家分享一下。

收录时间: 2020-08-05
分类: C#开发
贡献者: Rector
30 热度

C# dotnet 使用判断文件夹存在的方法判断一个文件路径会怎样

假定我有一个文件的路径,我将这个文件路径放在文件夹判断方法里面,请问此时返回的是存在还是不存在?答案是返回不存在。如下面测试代码,这里的 GelteajoutrerebaKoutigasremawcho.dll 就是程序集,也就是文件是存在的,那么放在 DirectoryInfo 判断输出的内容是否存在...

收录时间: 2020-08-05
分类: C#开发
贡献者: Rector
31 热度

重学c#系列——异常续[异常注意事项](七)

对上节异常的补充,也可以说是异常使用的注意事项。正文减少try catch的使用前面提及到,如果一个方法没有实现该方法的效果,那么就应该抛出异常。如果有约定那么可以按照约定,如果约定有歧义,那么还是要抛出异常。我们知道使用try catch 其实是要消耗性能的,那么是否能避免使用try catch呢?或者减少使用try catch呢?我们使用api的时候,知道http制定了一套错误码,那么我们是否能使用错误码返回来做一个约定的呢?答案是否定的,且不论我们的业务的不同,错误码制定的困难,单是方法里面使用错误码偶和性就非常大。既然无法通过约定一套错误码来解决,那么是否可以先验证该方法能否执行成...

收录时间: 2020-08-05
分类: C#开发
贡献者: Rector
19 热度

Blazor WebAssembly Registration Functionality with ASP.NET Core Identity

In this article, we are going to learn how to implement Blazor WebAssembly registration functionality to create a new user for our application. We are going to integrate the ASP.NET Core Identity library to help us in a process. After the Identity integration, we are going to create a registration functionality on the server-side and after that the Blazor WebAssembly registration form for our users to interact with.

收录时间: 2020-08-05
分类: ASP.NET Core
贡献者: Rector
22 热度

Exploring the code behind IHttpClientFactory in depth

In this post I take a look at the code in the default implementation of IHttpClientFactory in ASP.NET Core—DefaultHttpClientFactory. We'll see how it ensures that HttpClient instances created with the factory prevent socket exhaustion, while also ensuring that DNS changes are respected.This post ass...

收录时间: 2020-08-05
分类: .NET Core
贡献者: Rector
AD 友情赞助