/r/dotnet

Photograph via snooOG

.NET Community, if you are using C#, VB.NET, F#, or anything running with .NET... you are at the right place!

/r/dotnet

191,119 Subscribers

1

Any way to put a scrollbar in a table? (VB.NET)

I know you're not meant to use tables for a webpage, but this is an A-Level project so they cut me some slack. My project requires me to have a thing in the middle of the page where I can scroll down and click on different links. I'm using VB.NET, by the way. Thank you so much for reading this.

2 Comments
2024/12/23
22:43 UTC

2

Differences between WPF on .NET Framework VS .NET

I have difficulties understanding the differences between a WPF project built on top of .NET Framework VS built on top of .NET. The “new” WPF still remains a Windows-only application framework, still it uses .NET which is cross-platform. Moreover, I don’t understand what the ”old” WPF has compared to the “new” WPF, and if all the logic of an “old” WPF app can be used with the “new” WPF. Someone with experience with the “new” WPF can tell me the differences he/she met?

Moreover, can the old “.NET Framework 4.x” docs be used as a foundation to learn WPF today? Or are the new docs “.NET (Desktop)” the full new docs to follow with all the new stuff and migrations, or is it still a work in progress?

https://preview.redd.it/h2r9pc1hco8e1.png?width=827&format=png&auto=webp&s=ee8a0f0c0b01570ac1e386ae8ad2618b609afa18

3 Comments
2024/12/23
22:26 UTC

3

Where should EF Core code live?

Working on an ASP.NET Core project, and the examples/generated code puts the EF objects directly in the view.

Would it be better practice to create a DTO that reads the values of the EF object and displays the DTO in the view?

I guess in general, is the generated code that uses the EF object bad practice, and should I be creating a DTO?

Why/why not?

TIA

6 Comments
2024/12/23
21:08 UTC

1

Rider: How to find files not containing text

Using Rider, I'd like to find all files in my project that do NOT contain a certain text string. I'm guessing it will be some kind of regex solution, but I can't land on something that works.

What I'm trying to accomplish is to find all files that don't have `#nullable enable` anywhere in the file. I'm wanting to enable nullability project-wide, but first I need to find the files that are assuming it is disabled and disable it in those.

I'd be open to other ways to switch the default nullability setting safely!

2 Comments
2024/12/23
20:55 UTC

33

How long until .NET Framework 4.8 becomes obsolete ?

I have a business application developed with Winforms and .NET Framework 4.8
Do I need to rewrite it into the latest .NET Core ? How long until .NET Framework 4.8 becomes obsolete ? Does Microsoft have a roadmap for it ?

57 Comments
2024/12/23
20:46 UTC

5

Orleans: is my understanding correct?

I am trying to get a better understanding of Orleans by playing around with it. I am maintaining some realworld.io .net implementations and use it as base. My play around code is here.

So far my understanding is that a key use case for Orleans is to provide a smart way to have distributed in memory cache -> no need for a service like Redis, I can easily update my in memory state, I can build as if my code is running on a single machine. This could greatly reduce the load on a db.

I am struggling with the following: this approach seems to work well for individual objects, but how can I query on large sets of grains (like a db search with skip / take). The only benefit I see in this is to be able to do some response caching. Am I missing something?

What is the benefit of specific grain persistence as provdided by Orleans vs injecting a DbContext (or Repository in my example)? I do get this in the case of a Journalled grain using event sourcing, but what other advantages do I oversee?

5 Comments
2024/12/23
20:03 UTC

1

OS dotnet marketplace project

Is there any open source project that implements basics of a marketplace with suppliers and products?

2 Comments
2024/12/23
19:43 UTC

23

Does anyone actually uses Winforms these days ? I don't mean in personal projects

59 Comments
2024/12/23
18:19 UTC

4

Insights from My NuGet Package Ranking Analysis 📊

Two months ago, I asked this community a question in my post titled Optimizing NuGet Package For Better Discoverability.

Inspired by the feedback and curiosity, I decided to conduct a detailed analysis of the factors that influence search rankings for packages published on NuGet.

Using 59 data points here in this Google Sheet, I uncovered some interesting insights!

Most Impactful Factors on Ranking:

  • Tags Matching Keywords: Packages with tags that match the search keywords have a higher chance of ranking better. This was the most positively correlated factor in my analysis.
  • Number of Keywords in Title/Description: Including more keywords from the search query in your title or description also helps improve the rankings, though slightly less impactful than tags.

Least Impactful Factors:

  • Number of Versions Released: Surprisingly, the number of versions released had minimal correlation with the ranking. It seems NuGet doesn’t weigh this factor heavily in its algorithm.
  • Download Counts (Total and Current Version): While download numbers often indicate package popularity, they showed a weak negative correlation with ranking. This suggests that having many downloads doesn’t guarantee a higher rank, possibly due to competition or outdatedness.

Here’s a heat map summarizing the correlations across the various factors I analyzed, including search rankings:

https://preview.redd.it/whfve8uewm8e1.png?width=1944&format=png&auto=webp&s=bc63e8fbc7fb12498eb7e65d1ad5dbf20cb9547c

I hope this analysis helps fellow package developers! I’d love to hear your thoughts—are there other factors you think might influence rankings that I didn’t capture? Let me know in the comments below!

3 Comments
2024/12/23
17:37 UTC

2

Convert Crystal report ?

Hi ,
I have large numbers of Crystal reports in a Old VB project. The project is modifying need a better solution for convert that reports. I have tried RDLC its fine but report disiginig getting too much time. can anybody recommend me a way to convert easy crystel to alernative please.

2 Comments
2024/12/23
16:32 UTC

21

How to Convert SQL Server DB to Postgresql DB?

What is the best and most reliable way of converting a production environment sql server database with lots of data and tables to a Postgresql database? In development i am using EF core code first approach.

I saw alot of tools that does that but i am not so sure about them and don't know if that is a good approach.

27 Comments
2024/12/23
13:23 UTC

0

One Piece Theory Generator AI

A platform developed with .NET 9 that generates One Piece theories using the OpenAI API, designed with a layered architecture

Source: https://github.com/LightSenpai7/OnePieceTheoryGeneratingAI

2 Comments
2024/12/23
12:41 UTC

0

Ide for dot net

suggest me any best ide for dot net,

I don't like Visual Studio

8 Comments
2024/12/23
12:24 UTC

26

Have you ever refactored complex stored procedure with Linq?

Long story short,
I am tasked with converting complex stored procedures with LINQ. Stored procedures are around 600 line and uses lots of tables, dynamic SQL, temp tables etc.

How to approach this task, any opinion would be useful for me.

The reason behind such decision that client is currently using SQL Server but they might move to Postgre SQL. Since converting SQL servers SP's to Postgre SQL is another pain.

42 Comments
2024/12/23
11:49 UTC

4

C# and asp.net core web API with EntityFramworkcore.

I am currently working with the ABP.IO framework, but I find it challenging to grasp many C# concepts. This difficulty extends to understanding and applying ASP.NET Core Web API principles effectively. My goal is to master both C# and ASP.NET Core Web API, from the basics to the most advanced topics, so I can confidently work with the ABP framework, even when dealing with complex models and structures.

This includes understanding advanced topics like one-to-many relationships involving three or four different tables, managing foreign key relationships, and other intricate data modeling scenarios. Could you recommend any resources—such as books or courses—that can guide me in building a strong foundation in C# and ASP.NET Core, and help me advance to an expert level?

7 Comments
2024/12/23
08:28 UTC

0

Looking for Resources to Practice LINQ Queries

Can anyone recommend articles or resources to practice LINQ queries? Most articles I find online are great for SQL questions, but not for LINQ. I often get LINQ-related questions in interviews, which I haven't practiced before.

6 Comments
2024/12/23
07:29 UTC

1

Aspire and config files for services

I'm looking for the sanest way to handle service config files(tempo.yaml, grafana.ini...) using Aspire. The target for production will be k8s using Aspire8, but if possible I'd like to have a similar setup locally.

Couldn't find any mention of configmaps in Aspire documentation, so I guess it is manual intervention, or another way. This is my first try with k8s, until now it's been mostly a single host, multi service docker-compose. Not sure about using s3 for this purpose.

2 Comments
2024/12/23
07:28 UTC

1

Trying to Improve My .NET Skills –Any Feedback?

Hi everyone,

I’m a CS student, and I recently developed a project to apply what I’ve learned and strengthen my .NET knowledge. I’d really appreciate any feedback you could provide!

The project: https://github.com/Ahmed-BarqO3/Simple-Library-Api.git

Feel free to share your thoughts, suggestions, or advice. Thank you for taking the time to check it out!

2 Comments
2024/12/23
06:26 UTC

82

I love this sub

Just want to shout out my appreciation for this subreddit. People are very active and helpful in responding to questions, cordial in discussions, and are not condescending, unlike a certain website forum (I'm sure you know what I'm referring to). This sub has helped me tremendeously in growing as a dev

19 Comments
2024/12/23
03:57 UTC

231

VS Code is now the Flagship "IDE" at Microsoft

On the latest .NET Rocks! podcast, April Yoho from Github is talking about Copilot and says this:

"All the new features are coming out in Visual Studio Code. Why? It is the flagship product at Microsoft".

And when asked about Visual Studio she says that "work is being done there". She also refers to VS Code as an "IDE".

I use VS Code on the Mac when in development for my Maui apps because it builds and runs so much faster than Visual Studio on Windows. But more days than not I am on my Windows machine (or in Parallels) in Visual Studio proper. I am just way more productive, but maybe that's because I've been using it for years. Bus VS Code for .NET stuff has come a long way, just in the last year even.

Curious as to others thoughts on dumping Visual Studio and going VS Code full time.

192 Comments
2024/12/23
02:34 UTC

0

Suggestions regarding laptop purchase

Hi dotnet!

Im going to purchase a new laptop, new workplace will cover the cost.

Use case is C# / .net with rider, containerization, VM, databases etc, normal backend dev work.
Size should be around 14 inches and it will be connected to external monitors most of the time.

i have searched for a windows laptop that is good without any real drawbacks but i dont seem to find one that ticks all the boxes. If you have one you can recommend that you have used please let me know!
Im looking for atleast 32 Gb RAM and 1TB storage. Im in sweden so most brands of laptops are available.

i have also looked at macbook pro m4 chip.
debating between the base m4 model with 32 GB ram and 1TB storage OR M4 pro chip with 24 GB ram and 1TB storage. This will max my budget so cant go over that. I really liked having a macbook air for my studies but havent used one professionally.

If you are using a macbook for backend dev work - what are your thoughts? Is 24GB to little? is the base m4 chip to slow?
Have you run into any situation where you wished you went with a windows machine instead?

Very grateful for any answers!

12 Comments
2024/12/22
23:15 UTC

1

How to extract an attachment from a .msg?

Does anyone know how to take a .msg email saved somewhere, and grab an Excel file attached to the message? I'm using vb.net. Everything I find is about sending emails or out of date. Any direction would be appreciated.

3 Comments
2024/12/22
22:54 UTC

16

What wrappers do most people use for the open ai chat completions etc.

Is there a good nuget to use for dotnet c#.

11 Comments
2024/12/22
21:55 UTC

9

Crystal Report Alternatives

We have a large number of reports implemented in Crystal. I would like to reimplement them in something else.

Things I am looking for are:

  • .net core/linux support
  • CR importing/conversion
  • designed that can be embedded in a web app
  • single report file even when using sub-reports
  • robust

Products I am investigating are:

Telerik Reports

  • Doesn't import subreports well
  • Embedding subreports is a PITA
  • Editing embedded subreports is a bigger PITA

Active reports

  • Stupidly short trial period
  • Designer crashes when there is no printer installed

Fast Reports

Power BI

No CR import

SSRS

Just no

Anything else I should consider?

21 Comments
2024/12/22
21:49 UTC

107

To users of Github Copilot Free

Completion that appears automatically when typing applies to the 2000 completion limit, whether adopted or not.

Therefore, to be useful, set the Copilot completion to turn it on only when you want to use it.

I assigned to ALT + C, where the shortcut keys do not overlap and can be use intuitively.

How to setting it [ Visual Studio }> Tools - Options - Environment - Keyboard - Type "completion" in [ Show commands containing: ] - Find starts with "OtherContextMenus. ... CopilotToggleCompletions" - Assign in shortcut keys what u want in menu "Press shortcutt keys: "

-- Done --

IntelliSence works when Copilot is turned off.

20 Comments
2024/12/22
20:24 UTC

0

Convert PlotModel (SkiaSharp/OxyPlot) to MemoryStream (PNG)

Hi, I need to convert a "PlotModel" object to a "MemoryStream" as PNG, with a resolution of 1000x400.

This is my code so far:
var stream = new MemoryStream();
PngExporter.Export(model, stream, 1000, 400);
stream.Seek(0, SeekOrigin.Begin);
(model = PlotModel)

This also works on Windows, but unfortunately not in the Docker container, where the program has to run at the end.

Error: Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'asset')

Is used:
SkiaSharp.NativeAssets.Linux.NoDependencies (v2.88.9)
OxyPlot.SkiaSharp (v2.2.0)

Can anyone help me?

1 Comment
2024/12/22
20:21 UTC

5

RBAC, Identity and JWT

Recently learnt ASP.NET Core Web APi crud using EF Core. I have been through repository pattern, custom middleware and some Serilog stuff. But having hard time with role based access control using Identity and JWT. Not sure what I am doing wrong. What learning path should I follow? Any advice will be appreciated. Thanks!

4 Comments
2024/12/22
19:54 UTC

Back To Top