اشتراک‌ها
تهیه قالبی بهتر برای برنامه‌ها‌ی کنسول دات نتی

اگر امروز با استفاده از دستور dotnet new console یک برنامه‌ی کنسول را شروع کنیم، به یک فایل program.cs تقریبا خالی و یک فایل csproj. مرتبط می‌رسیم و ... همین! اما نیازهای واقعی ما در یک برنامه‌ی کنسول، شامل این موارد هستند:
- نیاز به انجام تزریق وابستگی‌ها
- نیاز به دسترسی به فایل‌های کانفیگ؛ شبیه به برنامه‌های وب
- نیاز به کار با EF و مدیریت صحیح طول عمر Context آن
- مشخص بودن شماره نگارش دات نت و همچنین ابزارهای EF استفاده شده
- غنی سازی کامپایلر با یک سری آنالایزر و تنظیمات مخصوص آن جهت اعمال سخت گیری‌های بیشتر!
- استفاده از مدیریت مرکزی بسته‌های نیوگت برای پروژه‌های مختلف در Solution
- نیاز به کار با HttpClient؛ آن هم به نحو صحیحی
- نیاز به دسترسی به سوئیچ‌ها و پارامترهای ارسالی به برنامه‌ی کنسول از طریق خط فرمان
- نیاز به دسترسی به سیستم Logging؛ شبیه به برنامه‌های وب
- امکان انجام آزمون‌های واحد و یکپارچگی درون حافظه‌ای

تمام این موارد به صورت از پیش تنظیم شده، در قالب ارائه شده‌ی توسط این پروژه موجود هستند.
برای نصب آن‌، ابتدا مخزن کد فوق را clone کرده و سپس فایل register_template.cmd آن‌را اجرا کنید. پس از آن دستور dotnet new dntconsole، جهت ایجاد پروژه‌های جدید مبتنی بر این قالب، در دسترس خواهد بود.

تهیه قالبی بهتر برای برنامه‌ها‌ی کنسول دات نتی
اشتراک‌ها
Rider 2022.1 منتشر شد

Rider 2022.1 includes full Unreal Engine support, which converts Rider into a full-fledged IDE for game development, no matter what game engine you use. 

In v2022.1, Rider also supports a Beta version of the long-awaited remote development workflow. It allows you to connect to a remote machine running Rider’s backend from anywhere in the world.

In addition to these new features, this release also brings Docker Fast mode, updates to the main toolbar, and full-text search throughout the solution right from the Search Everywhere pop-up.

 
Rider 2022.1 منتشر شد
اشتراک‌ها
در چه شرایطی از برنامه نویسی ناهمزمان استفاده کنیم ؟

:When to use Async/Await

There are basically two scenarios where Async/Await is the right solution
I/O-bound work: Your code will be waiting for something, such as data from a database, reading a file, a call to a web service. In this case you should use Async/Await, but not use the .Task Parallel Library
CPU-bound work: Your code will be performing a complex computation. In this case, you should use Async/Await but spawn the work off on another thread using Task.Run. You may .also consider using the Task Parallel Library

در چه شرایطی از برنامه نویسی ناهمزمان استفاده کنیم ؟
اشتراک‌ها
اضافه کردن امکان Observability به پروژه های Asp.Net Core

Modern software development practices value quick and continuous updates, following processes that minimize the impact of software failures. As important as identifying bugs early, finding out if changes are improving business value are equally important. These practices can only work when a monitoring solution is in place. This article explores options for adding observability to .NET Core apps. They have been collected based on interactions with customers using .NET Core in different environments. We will be looking into OpenTelemetry and Application Insights SDKs to add observability to a sample distributed application. 

اضافه کردن امکان Observability به پروژه های Asp.Net Core
اشتراک‌ها
کتاب رایگان Power BI Succinctly

Power BI is a cloud-based business analytics service that gives us a single view of the most critical business data. A tool for creating live dashboards and rich, interactive reports, Power BI allows access to data for monitoring the health of a business. Pierstefano Tucci will take readers through the Power BI interface, query creation, publishing your work, and more in Power BI Succinctly.

Table of Contents
  1. What is Power BI?
  2. Service
  3. Desktop
  4. Mobile Apps
  5. Solution Template
  6. Devoloper
  7. Power BI Embedded
  8. Power BI Gateway: Data Security 
کتاب رایگان Power BI Succinctly
اشتراک‌ها
10 دلیل استفاده از Visual Studio برای C++ Android Development

1.  Easily acquire all your Android platform needs
2.  Jump start your Android development with  C++ cross-platform templates and samples
3.  One C++ IDE to target all mobile platforms (iOS, Android, Windows and more)
4.  Leverage powerful cross-platform coding tools 
5.  Share your cross-platform C++ code easily
6.  Fastest C++ builds with Incredibuild support 
7.  The fastest and most robust debugging experience for your Android application
8.  Leverage the best in Breed, free Android Emulator
9.  Gather your application insights easily using HockeyApp 
10.  Visual Studio is the cross-platform mobile solution (Xamarin, Apache Cordova) and just not limited to cross-platform C++ 

10 دلیل استفاده از Visual Studio برای C++ Android Development
اشتراک‌ها
درک تفاوت بین Unit Test و Test Automation

As software creation processes continue to become more complicated, development teams are taking a more all-encompassing approach that involves agile testing methodologies. Like agile software development, agile testing involves running test cases that assess the overall integrity of a solution, rather than simply ensuring that each part and piece are technically sound. Viewed as an analogy, agile testing methodologies ensure that software is a well-oiled machine, whereas a linear approach to testing just ensures that each of the gears is in good order. Herein lies the difference between unit tests and test automation. 

درک تفاوت بین Unit Test و Test Automation
نظرات مطالب
تاثیر فرهنگ جاری سیستم بر روی اعداد در دات نت
یک نکته‌ی تکمیلی: روش تشخیص زود هنگام مشکلات تاثیر فرهنگ جاری برنامه بر روی محاسبات رشته‌ای آن

«Meziantou.Analyzer » بسیاری از مشکلات مرتبط با کار با رشته‌ها، عدم ذکر فرهنگ و یا نحوه‌ی مقایسه‌ی رشته‌ها را تشخیص می‌دهد. برای کار با آن فقط کافی است بسته‌ی نیوگت آن‌را به پروژه‌ی خود اضافه کنید:
<PackageReference Include="Meziantou.Analyzer" Version="1.0.708">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
و جهت محکم کاری، تمام اخطارها را تبدیل به خطا کنید تا مجبور به اصلاح آن‌ها شوید:
<PropertyGroup>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
    <RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
    <RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis>
</PropertyGroup>
و اگر فکر می‌کنید نیازی نیست تا موردی را الزاما اصلاح کنید (این موارد با شناسه‌هایی مانند MA0051 در خروجی کامپایلر ظاهر می‌شوند)، می‌توانید آن‌را به صورت زیر به فایل editorconfig. که در ریشه‌ی solution قرار می‌دهید، اضافه کنید و سپس severity آن‌را به suggestion تغییر دهید:
# MA0051 : Method is too long. maximum allowed: 60.
dotnet_diagnostic.MA0051.severity = suggestion
نظرات مطالب
بررسی Source Generators در #C - قسمت سوم - بهبود کارآیی برنامه با تبدیل عملیات Reflection به تولید کد خودکار
یک نکته‌ی تکمیلی: روش دیباگ پروژه‌های Source Generator در Visual Studio

برای اینکار اولین تغییر مورد نیاز، افزودن تنظیم زیر به فایل csproj پروژه‌ی Source Generator است:
<PropertyGroup>
   <TargetFramework>netstandard2.0</TargetFramework>
   <IsRoslynComponent>true</IsRoslynComponent>
سپس در Solution explorer به خواص پروژه‌ی source generator مراجعه کرده و در برگه‌ی Debug آن، دراپ‌داون Launch را انتخاب و گزینه‌ی IsRoslynComponent تنظیمی را انتخاب کنید.
در ادامه در هر قسمتی از کدهای Source generator که نیاز به دیباگ هست، برای مثال ابتدای متد Execute، باید چندسطر زیر را اضافه کرد:
#if DEBUG
if (!Debugger.IsAttached)
{
   Debugger.Launch();
}
#endif
این کدها فقط در حالت دیباگ اضافه شده و با کامپایل برنامه و یا فشردن دکمه‌ی F5، سبب نمایش پنجره‌ی جدید choose just-in-time debugger می‌شوند. در اینجا می‌توانید یک وهله‌ی جدید از ویژوال استودیو را برای دیباگ انتخاب کنید و یا می‌توان همان وهله‌ی جاری را نیز انتخاب کرد تا سبب اجرای مجدد ویژوال استودیو نشود. در این حالت debugger به پروژه متصل شده و امکان دیباگ آن میسر می‌شود. ابتدا ویژوال استودیو بر روی سطر Debugger.Launch، متوقف می‌شود. سپس break-pointهای مدنظر خود را قرار داده و با فشردن دکمه‌ی F5 می‌توان به آن‌ها رسید و آن‌ها را دیباگ کرد.