اشتراکها
اشتراکها
5 بلاگ مفید #C در سال 2019
نگارش نهایی دات نت 6، حدود یک ماه دیگر منتشر میشود و اگر برای نمونه RC2 آنرا نصب کرده باشید، با ایجاد یک پروژهی کنسول جدید مبتنی بر آن ... شگفت زده خواهید شد! شاید انتظار داشته باشید که با چنین فایلی مواجه شوید:
اما یک چنین خروجی تولید میشود:
این مورد قابلیتی است که به همراه C# 9.0 به نام «Top Level Programs» ارائه شد و اکنون در تمام قالبهای پیشفرض پروژههای مبتنی بر دات نت 6، استفاده شدهاست. این قالب شاید برای تازهکارها، جالب باشد و کم حجم و کم سطر، اما «ما آنرا درخواست نداده بودیم!».
روش بازگشت به قالبهای قبلی
در حال حاضر و در نگارش فعلی و حتی رسمی دات نت 6، روشی برای بازگشت به حالت قبلی وجود ندارد که به احتمال زیاد در نگارشهای پس از RTM لحاظ خواهد شد (میتوانید در اینجا ^ و ^ به آن رای دهید). تنها راه حل موجود، استفاده از دستور زیر است:
این دستور در اصل به این معنا است که پروژهی من را بر اساس قالب پروژههای NET 5.0. تولید کن؛ اما در فایل csproj آن، بجای net5.0 از net6.0 به عنوان target framework استفاده شود:
در اینجا سطر net5.0 را حذف و با net6.0 جایگزین کنید.
using System; namespace MyVerboseApp { public class Program { public static void Main(string[] args) { Console.WriteLine("Hello World!"); } } }
// See https://aka.ms/new-console-template for more information Console.WriteLine("Hello, World!");
روش بازگشت به قالبهای قبلی
در حال حاضر و در نگارش فعلی و حتی رسمی دات نت 6، روشی برای بازگشت به حالت قبلی وجود ندارد که به احتمال زیاد در نگارشهای پس از RTM لحاظ خواهد شد (میتوانید در اینجا ^ و ^ به آن رای دهید). تنها راه حل موجود، استفاده از دستور زیر است:
dotnet new console --framework net5.0 --target-framework-override net6.0
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net5.0</TargetFramework> + <TargetFramework>net6.0</TargetFramework> </PropertyGroup> </Project>
اشتراکها
ASP.NET Core و دانت ۷، ریلیز نهایی
What’s new?
Here’s a sampling of the great new features and improvements in ASP.NET Core for .NET 7:
- Servers and runtime
- Rating limiting: Limit the rate of handled requests using flexible endpoint configuration and policies.
- Output caching: Configure output caching to reduce to more efficiently handle request.
- Request decompression: Accept requests with compressed content.
- HTTP/3: Built-in support for HTTP/3, the latest HTTP version based on the new QUIC multiplexed transport protocol.
- WebSockets over HTTP/2: Use WebSockets over HTTP/2 connections.
- WebTransport (experimental): Create streams and data grams over HTTP/3 with experimental support for WebTransport.
- Minimal APIs
- Endpoint filters: Use endpoint filters to run cross-cutting code before or after a route handler.
- Typed results: Return strongly typed results from minimal APIs.
- Route groups: Organize groups of endpoints with a common prefix
- gRPC
- JSON transcoding: Expand the reach of your gRPC services by also exposing them as JSON-based APIs
- OpenAPI with JSON transcoding (experimenal): Use experimental support for generating OpenAPI specs for your gRPC JSON transcoded services.
- gRPC health checks: Report and check the health of gRPC server apps.
- gRPC client
AddCallCredentials
: Create clients that send authorized requests using bearer tokens.
- SignalR
- Client results: Return client results to the server in response to requests from the server.
- MVC
- Nullable view and page models: Nullable page and view models are now supported to improve the experience when using null state checking.
- Blazor
- Custom elements: Build standard HTML custom elements with Blazor to integrate Blazor components with any JavaScript-based app.
- Handle location changing events: Intercept location changing events to create custom user experiences when navigating.
- Bind after/get/set modifiers: Run async logic after data binding and independently control how data binding gets and sets the data.
- Dynamic authentication requests: Create dynamic authentication requests at runtime with custom parameters to handle advanced authentication scenarios in Blazor WebAssembly apps.
- Improved JavaScript interop on WebAssembly: Optimize JavaScript interop call when running on WebAssembly using the new
[JSImport]
/[JSExport]
support. - WebAssembly SIMD & exception handling: Improve performance with .NET WebAssembly ahead-of-time (AOT) compilation using WebAssembly SIMD and exception handling support.
اشتراکها
NET 5.0 RC 1. منتشر شد
Today, we are shipping .NET 5.0 Release Candidate 1 (RC1). It is a near-final release of .NET 5.0, and the first of two RCs before the official release in November. RC1 is a “go live” release; you are supported using it in production.
اشتراکها
بررسی NET Standard.
Description
There has been a lot of talk lately about .NET Standard, both in the community and on Channel 9. But there is also still confusion about it. In this episode, Kathleen Dollard clears up some of this confusion. She and Robert chat about why .NET Standard was created, as well as how and when you should take advantage of it.
Here’s what’s new in this preview release:
- Smaller SignalR, Blazor Server, and MessagePack scripts
- Enable Redis profiling sessions
- HTTP/3 endpoint TLS configuration
- Initial .NET Hot Reload support
- Razor compiler no longer produces a separate Views assembly
- Shadow-copying in IIS
- Vcpkg port for SignalR C++ client
- Reduced memory footprint for idle TLS connections
- Remove slabs from the
SlabMemoryPool
-
BlazorWebView
controls for WPF & Windows Forms
اشتراکها