/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

186,901 Subscribers

1

Template Hunting

Is there any basic .NET 8 Web template project with jwt authentication and basic admin panel for free? I looked for a bit, couldn't find any for free.

3 Comments
2024/11/10
18:45 UTC

0

🌟 If You Had No Constraints... What Would You Build With? 💻

Imagine this: no constraints, no barriers. You have mastery over every programming language, framework, and technical stack out there.

Now, with all that expertise in your toolbox, here's the big question: What framework or tech stack would you choose for your next project, and why?

Would you stick to your favorites, try something cutting-edge, or explore a tech stack you’ve always been curious about?

11 Comments
2024/11/10
17:50 UTC

0

Let’s talk about the term “Bootsrap/Bootsrapping”

Hey guys. As I just had this discussion with a colleague, what is your opinion on the term Bootrap or Bootstrapping in context of .Net applications.

I explained my colleague that Bootstrapping in this context describes the process of initialising your application. Register services, configuring them etc.

They had a different opinion on it, as for them Bootstrapping is something a compiler does and they thought this term is not fitting my description.

As there is no official definition of this term from the .Net devs (and this term is generally overloaded), I have the impression, that this term is commonly used in the .Net community and ppl know what you mean when you’re talking about Bootstrapping.

What’s your opinion on that, do you agree? Do you use the term to describe you apps startup / init process?

38 Comments
2024/11/10
16:42 UTC

0

IMAGE TRANSFORM WEBSITE IN BLAZOR WEB APP .NET | .BLAZOR

1 Comment
2024/11/10
16:08 UTC

9

How to find any .NET side gigs as a foreigner?

Hello again everyone! Since my currency is now worth roughly 6x less than the dollar, I decided to start looking for side jobs that pays in dollar. Since I’m from Brazil, I’m having a hard time to find where those opportunities are, so here I am asking for any tips you got! My English fine for everything, and my coding skills as well. Thanks in advance.

Edit: typo.

11 Comments
2024/11/10
14:36 UTC

8

.NET Core Security

Hello, I want to improve myself in terms of security in my current projects in .NET Core. Do you have a course or series etc. that you recommend?

4 Comments
2024/11/10
12:48 UTC

0

iOS Tab image not resizing?

I am trying to add icon images in the Tab as the example below shows, but they're coming as actual images and are not resizing, how can I solve this, I saw on the Maui repo that it closed the issue, but no solution, does it mean the fix is coming in with dotnet nine release updates for Maui as well or not?

  <ShellContent
        ContentTemplate="{DataTemplate views:StartPage}"
        Route="StartPage"
        Shell.TabBarIsVisible="False" />
    
    <ShellContent
        ContentTemplate="{DataTemplate views:LoginPage}"
        Route="LoginPage"
        Shell.TabBarIsVisible="False" />
        


    <ShellContent 
        ContentTemplate="{DataTemplate views:RegisterPage}"
        Route="RegisterPage"
        Shell.TabBarIsVisible="False" />

    <TabBar>
        <Tab Title="Home" Icon="{OnPlatform Android='home.png'}" >
            <ShellContent 
                ContentTemplate="{DataTemplate views:HomePage}"
                Route="HomePage"
                Title="My Budgets"/>
        </Tab>
 
         <Tab Title="Notifications"  Icon="{OnPlatform Android='bell.png'}">
            <ShellContent 
                ContentTemplate="{DataTemplate budget:NotificationsPage}"
                Route="NotificationsPage"
                Title="Notifications"/>
        </Tab>

        <Tab Title="Friends"  Icon="{OnPlatform Android='friend.png'}">
            <ShellContent 
                
                ContentTemplate="{DataTemplate account:FriendsPage}"
                Route="FriendsPage"
                Title="Friends"/>
        </Tab>


        <Tab Title="Settings"  Icon="{OnPlatform Android='setting.png'}">
            <ShellContent 
                ContentTemplate="{DataTemplate account:SettingsPage}"
                Route="SettingsPage"
                Title="Settings"/>
        </Tab>
    </TabBar> 

I use the OnPlatform because the icons show up on android how can i make them be normakl on ios ?

1 Comment
2024/11/10
11:15 UTC

109

More advanced sub than this?

I like the variety of depth in the content of this sub, but I'd also love to find another one that is more focused on senior concepts than "my first project doesn't build" kind of issues.

I hope this doesn't spark too much anger and some of you know other subs that keep on challenging and teaching less basic things in c#/dotnet.

41 Comments
2024/11/10
08:30 UTC

12

How do you good people search for .NET specific roles?

Using Linkedin as an example... if I type in:

  • dotnet
  • dotnet developer
  • .NET
  • dotnet and react

No matter which combination (there are more), I get a bunch on Typescript/Python results. Maybe one dotnet position per page. There are hundreds of pages like this.

How do you efficiently find .NET positions in the UK?

8 Comments
2024/11/10
08:30 UTC

2

DevOps helpers for WiForms app.

Hello there, I'm looking for a solution for a per-build app that can deliver updates made to a WinForms application from a developers end to client's end that doesn't have a static IP/public IPs.

My app is a part ERP that need constantly updates and bug fixes as feature keep updating and requirments changes from time to time, we generally deal with clients specific changes in the code so no matter if all clients have the Dlls only that specific client can use that specific method (these are generally their own way of doing business, thats built in to the application)

I've tried the Azure DevOps pipeline tutorials but the all need clients to have a public IP, also there are tools like TeamCity but they need me to have a public repo for free version.

In short I'm looking for a DevOps app that can read private repo and does all the things mentioned here, and yet free or is cheap.

3 Comments
2024/11/10
08:26 UTC

0

Aspire with non-microservice api application?

Hi guy. I'm new and learning advanced .Net. I see aspire is new and it's specific for microservice. But my application just have 2 project is api and blazor. Does it worth to use aspire on it? My api use vertical slice architecture.

5 Comments
2024/11/10
06:44 UTC

6

RBAC for B2C App Registration

Hello all,

* I wrote a C# web app that successfully connects with a standard Entra tenant.

* I then implemented Azure RBAC to limit access to Azure resources (e.g. Key Vault, Service Bus) to only those App Registrations that authenticated through the web app (i.e. Tenant / Client ID / Client Secret combination).

* The next phase of the project involved moving the web app to an Entra AAD B2C tenant, which I have successfully done - the app now logs in through the B2C user flows, etc.

* However I can no longer use RBAC to assign the same roles to the B2C App registrations as I had assigned to the standard Entra tenant App registrations. There doesn't seem to be a great deal of information on this.

https://preview.redd.it/9ukny0tkizzd1.png?width=838&format=png&auto=webp&s=592249b641d2278063f4378aa04e2045acc34a04

* I don't want fine-grained control per B2C user. I simply want to grant the B2C app registration access to a key vault, for example, the same way I would have provisioned it in the default Entra tenant.

2 Comments
2024/11/10
02:27 UTC

2

Client & System Reporting engine + analytics framework suggestions

In the finance industry, what is the most widely adopted reporting framework that meets enterprise needs for both internal and client reporting? Currently, we use a mix of custom code, libraries, and proprietary code to schedule and deliver reports through various channels (email, network share, SFTP) in CSV or Excel format. For client reporting, we use RDL designs embedded with .NET to generate and deliver formatted reports. Now, we’re exploring a more unified solution, possibly Power BI with Power Automate, combined with a data warehouse or Databricks for data analysis.

Are there any best practices, recommendations, or alternative frameworks that could meet both reporting and analysis needs effectively within a single solution? I’m particularly interested in approaches that minimize the need for multiple tools and streamline report generation and analysis. Any insights would be greatly appreciated!
1 Comment
2024/11/10
01:57 UTC

6

EF core with manually map

Should I use EF Core with a manually created database and manually map the corresponding properties? I don't like Code First and migrations, and tool for migrating conflict with other library like carter because of Microsoft.CodeAnalysis.Common

6 Comments
2024/11/10
01:38 UTC

0

VS 2022 just updated itself with Avalonia templates

All--

I just opened up my copy of Visual Studio 2022 Pro and what did I see but three new templates for Avalonia cross-platform apps! I did not install these, myself -- VS took significantly longer to load than usual, so I'm guessing the bits came down in the background. Anybody else see these appear auto-magically?

10 Comments
2024/11/09
23:21 UTC

3

Anyone familiar with Microsoft.AspNetCore.Connections custom kestrel transport?

Hello,
At work, I’m implementing custom transport for Kestrel using our native communication library. I’ve mostly followed the approach in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.

However, when writing to Application.Output, the incoming data isn’t reaching gRPC as expected. I suspect I’m either overlooking something or there's a gap in my understanding.

Has anyone worked with custom transports in Kestrel? Or does anyone know where I might find more detailed documentation on this?

1 Comment
2024/11/09
22:15 UTC

1

I made a small library that helps server bootstrap actions.

Hey.

Your server probably does DB migrations, seeding, any other long-running tasks while starting, right?

Here's a small library that allows to pipeline these actions and notify frontend that server is not quite available yet.

Available for .NET 6/7/8

I hope you guys find it useful. Suggestions are welcome.

GitHub: https://github.com/0x25CBFC4F/Void.Libs.Bootstrap

5 Comments
2024/11/09
22:06 UTC

56

Is AWS more commonly used than azure ?

I've switched between 4 companies now and all have been using aws for some reason.

does aws provide better cost and benefits as compared to azure?

81 Comments
2024/11/09
16:39 UTC

4

Ocelot API gateway and openapi spec dot net 8/9

Im using dot net 9 and want to remove swagger, the issue is replacing the swagger for ocelot, I want the routes to be available in the openapi specification, that way it can be used with postman or any other UI tool like scalar.

My goals is to have the document generated using Microsoft.AspNetCore.OpenApiMicrosoft.AspNetCore.OpenApi so it's available at the default "/openapi/v1.json" which I can then import into postman/scalar

but all i get is this right now (i am able to generate a document with a custom method but not sure if its the best way)

openapi "3.0.1"

info

title "OcelotAPIGateway | v1"

version "1.0.0"

servers

0

url "http://[::]:55560"

paths {}

components {}

6 Comments
2024/11/09
15:46 UTC

0

Gantt chart free in WPF

Hi everyone,
I has a personal project, i need a Gantt chart for manage progresses in project management. it look like this, so when starting i found some Gantt chart template for WPF, but i can't not found anything free for me, and I'm a student, i don't have money that to pay for license.

Who can help to find a template free for WPF or a tutorial about Gantt chart for WPF in the nearly time.

https://preview.redd.it/u0yjizy1gvzd1.png?width=1024&format=png&auto=webp&s=73510abb8ec00d4e5f55f8937f4194118505474a

Thanks for anyone seen and read my post.

10 Comments
2024/11/09
12:43 UTC

1

Pathfinder - CLI & Lib for finding all endpoints in any dotnet assembly

I've been working on a (free & open source) utility which could be useful to more people.

It's a dll scraper which finds all routable endpoints in any .net assembly (core & framework). It works on both conventional and attribute routes. You get out a lot of metadata useful for architecture tests, doc. gen. etc...

It can also template reports (you can override templates etc.) based on the analysis.

I have plans to expand the scope of docs gen and maybe integrate with logging/tracing providers to provide usage stats in one place.

Repo: https://github.com/makspll/Pathfinder
Nuget: https://www.nuget.org/packages/Makspll.Pathfinder#readme-body-tab

1 Comment
2024/11/09
11:56 UTC

3

Is smarterasp.net worth it?

We plan to buy a dedicated server from smarterasp.net, but we have some concerns about the bandwidth speed. Have you tried it? We are located in the Middle East and expect users from the Middle East and Europe.

9 Comments
2024/11/09
10:55 UTC

7

Date time interoperability

In my .NET backend web API app, the user can create a meeting in his schedule by specifying the start and end time. The web app exposes web APIs to create and update a task.

For example, the DTO used in the request to create a task is similar to the one for updating the task:

public class CreateTaskRequestDto 
{
     public required string Title { get; set; }
     public required DateTime From { get; set; }
     public required DateTime To { get; set; }      
}

Let's say we have two front-end client apps, a C# app and a web app. The C# client app creates a task like this, which then gets saved in the data base:

var request = new CreateTaskRequestDto() { From = DateTime.UtcNow, ... }

In the web app, when the user edits the task, you can imagine there's a <form> with the "title", "from" and "to" fields.

When the form is saved, it POSTs the updated task data to the /tasks/{id} web API.

The issue is the backend will see the "From" property as changed even when the user doesn't really changed it. This is because the date time value has different precision in the .NET vs Javascript. In Javascript, the date time has a lower precision, it is down to milliseconds.

How do you handle this in your code?

One obvious approach is that on the backend, in the update task Web API implementation, I strip down the incoming From and To fields down to minutes, since it does not make sense for the user to select seconds or milliseconds. But this approach does not seem the best, because a client app which created a task could expect the same from/to values back when it queries the backend.

Or, I could do this in the client app. But every client app must know not to send a date-time value with seconds or milliseconds, because these will be ignored.

It's a bit weird to "normalize" the input like that, or maybe I'm overthinking it?

There's a known pattern, called the Postel's law "Be liberal in what you accept, and conservative in what you send.". But in the cons side of things, the forgiving behavior can be counter intuitive for a client app. It makes believe it can send seconds and milliseconds, when in fact, they will be ignored. Shouldn't the client not be allowed instead to call with seconds/milliseconds?

But how about, instead of using DateTime, have a specific structure (DTO) for a date time value which (clearly) does not take a second or millisecond?

class ScheduleDateTime {
   public required int Year {get;set;}
   public required int Month {get;set;}
   public required int Day {get;set;}
   public required int Hour {get;set;}
   public required int Minute {get;set;}
}         

Or is it over engineering? Not sure.

The cons side of this is the JSON serialization and deserialization, now all clients need to know about this specific DTO.

EDIT: Why the down votes? I don't understand, it's the first time I post in the community.

11 Comments
2024/11/09
08:19 UTC

75

Int or guid as unique identifier/primary key

I'm building a new .NET application with SQL and I'm stuck with a decision to make.

  • Is it good to use the primary key as an INT or as a GUID?
  • Should the keys be generated in the code or in the database?
  • Is it required to have both id as an INT in SQL and userId as a GUID in .NET for indexing purpose?

I'm considering performance and also and easier way to migrate the database when in need.

193 Comments
2024/11/09
06:49 UTC

0

Should We Create an Interface for Every Class to Ensure SOLID Design Quality ?

To what extent should we create an interface for every class in a project to ensure adherence to SOLID principles ?
Does avoiding interfaces for certain classes compromise design quality or disregard best programming practices ?

40 Comments
2024/11/09
06:07 UTC

Back To Top