Base solution for your next web application

Activities of "MainTechAS"

In the APB framework, what possibilities are there to catch specific database exceptions during DB DML statements? e.g. when using ReferentialAction.Restrict in EF Core, one might catch the foreign key constraint violation exception and display a more intuitive message than "An internal error occurred during your request!"

Ah, sweet, thanks

Hi,

In version 4.5.0 of PowerTools alle templates are updatet implementing the feature 'file-scoped namespace' in all C# files created, this is all good and well, but not for template code generated for projects still not upgraded from target framework netstandard2.0

Error (active) CS8370 Feature 'file-scoped namespace' is not available in C# 7.3. Please use language version 10.0 or greater.

Such as projects

  • .Core.Shared
  • .Application.Shared

I hesitated to upgrade the projects, so as a workaround, I created "a lot" of MainTemplate.custom.txt files avoiding the issue. Yep I know, only a temporary workaround.

In AppTestBase.cs, the added function GetRandomString() has different order of min/max length parameters, than pre-version 130100

This will break all UITest based on templates that uses a different order of min/max parameters -> error: "Invalid minLength or maxLength parameters"

Pre-version 130100:

  • GetRandomString(int minLength = 0, int maxLength = 13, string regexPattern = "[^A-Za-z0-9]")

Post-version 130100 (in AppTestBase.cs)

  • GetRandomString(int maxLength = 13, int minLength = 0, string regexPattern = "[^A-Za-z0-9]")

Great, thanks for planning this on the current milestone.

Hi, I'm currently testing installation of ASPNetZero version 11.1 (Type: <span class="colour" style="color: rgb(0, 0, 0);">ASP.NET CORE & Angular, Framework: </span>.NET6, version 11.1) on Linux and noticed the build warnings "This call site is reachable on all platforms. 'Bitmap' is only supported on: 'windows'".

Searching issues regarding this on the ASPNetZero support site I found Not able to change the profile picture after deploying in Azure App Service Linux from a couple of years back.

And the remedy back then was utilizing libgdiplus for supporting the System.Drawing.Common Nuget package on Linux.

Regarding the release of .NET6 an the usage of System.Drawing on non-Windows platforms, Microsoft states the following:

System.Drawing compability ... The System.Drawing.Common NuGet package is now attributed as a Windows-specific library. The platform analyzer emits warning at compile time when compiling for non-Windows operating systems. On non-Windows operating systems, unless you set a runtime configuration switch, a TypeInitializationException exception is thrown with PlatformNotSupportedException as the inner exception. ... Since the inclusion of the Mono cross-platform implementation, we have redirected numerous issues to libgdiplus that never got fixed. In comparison, other external dependencies we have taken, such as icu or openssl, are high-quality libraries. It's not viable to get libgdiplus to the point where its feature set and quality is on par with the rest of the .NET stack. ...

Microsoft list these alternatives for recommended action To use these APIs for cross-platform apps, migrate to one of the following libraries:

  • ImageSharp
  • SkiaSharp
  • Microsoft.Maui.Graphics

Even though System.Drawing.EnableUnixSupport might be set to true, this will be deprecated in .NET7

So, in the near future, do we see ASPNetZero moving away from System.Drawing to a different library for GDI functionality, such as Microsoft.Maui.Graphics ?

Thanks.

Showing 1 to 6 of 6 entries