# .NET development

Published articles for .NET development.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## C# 15 Union Types for API Results: Examples, Trade-Offs, and Migration

DevFeed: [C# 15 Union Types for API Results: Examples, Trade-Offs, and Migration](<https://devfeed.tech/articles/c-15-union-types-for-api-results-examples-trade-offs-and-migration-92884.md>)

Original publisher: [Read original article](<https://www.syncfusion.com/blogs/post/csharp-15-union-types-api-results>)

Author: Arunachalam Kandasamy Raja

Published: 2026-10-21T14:17:46Z

Content type: article

Language: en

Sources: [Syncfusion](<https://devfeed.tech/sources/syncfusion-blogs.md>)

Topics: [union types](<https://devfeed.tech/topics/union-types.md>), [ASP.NET](<https://devfeed.tech/topics/aspnet.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [asp-net-core](<https://devfeed.tech/tags/asp-net-core.md>), [business](<https://devfeed.tech/tags/business.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [c-sharp-15](<https://devfeed.tech/tags/c-sharp-15.md>), [c-sharp-15-union-types](<https://devfeed.tech/tags/c-sharp-15-union-types.md>), [c-sharp-discriminated-unions](<https://devfeed.tech/tags/c-sharp-discriminated-unions.md>), [c-sharp-result-pattern](<https://devfeed.tech/tags/c-sharp-result-pattern.md>), [c-sharp-union-types](<https://devfeed.tech/tags/c-sharp-union-types.md>), [c-sharp-union-types-in-asp-net-core](<https://devfeed.tech/tags/c-sharp-union-types-in-asp-net-core.md>), [cases](<https://devfeed.tech/tags/cases.md>), [compare](<https://devfeed.tech/tags/compare.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [examples](<https://devfeed.tech/tags/examples.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [migration](<https://devfeed.tech/tags/migration.md>), [net-11](<https://devfeed.tech/tags/net-11.md>), [net-development](<https://devfeed.tech/tags/net-development.md>), [net-development-asp-net-core-c-sharp-software-architecture-web-platform-apis-what-s-new](<https://devfeed.tech/tags/net-development-asp-net-core-c-sharp-software-architecture-web-platform-apis-what-s-new.md>), [net-sdk](<https://devfeed.tech/tags/net-sdk.md>), [results](<https://devfeed.tech/tags/results.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [types](<https://devfeed.tech/tags/types.md>), [union](<https://devfeed.tech/tags/union.md>), [union-types](<https://devfeed.tech/tags/union-types.md>), [web-api](<https://devfeed.tech/tags/web-api.md>), [web-platform-apis](<https://devfeed.tech/tags/web-platform-apis.md>), [what-s-new](<https://devfeed.tech/tags/what-s-new.md>)

### AI overview

C# 15 union types represent a fixed set of result cases and let the compiler flag unhandled cases in switch expressions. In the ASP.NET Core example, a service returns distinct order outcomes while a controller maps them to HTTP responses, keeping business logic separate from HTTP handling. Unions suit closed sets of expected outcomes; interfaces better fit extensible implementations, and an established Result<T> may already meet a project's needs. Generated unions store cases through object?, so value types may box; the text recommends measuring performance-sensitive use. JSON deserialization can be ambiguous when structural case shapes overlap, and explicit polymorphic serialization may suit APIs needing a stable discriminator. Because unions are preview features in the C# 15/.NET 11 development cycle, migration guidance is to update internal consumers first and check response contracts, OpenAPI, generated clients, and serialized or persisted data before removing an old result model.

### Source excerpt

Learn how C# 15 union types simplify ASP.NET Core API results, compare with existing C# patterns, and help you decide when to adopt them.

## How Does Dotnet Publish Work

DevFeed: [How Does Dotnet Publish Work](<https://devfeed.tech/articles/how-does-dotnet-publish-work-4525.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/923705738/0/baeldung/ops~How-Does-Dotnet-Publish-Work>)

Author: John Caleb

Published: 2025-08-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Baeldung - Ops](<https://devfeed.tech/sources/baeldung-ops.md>)

Topics: [Deployment](<https://devfeed.tech/topics/deployment.md>), [NuGet](<https://devfeed.tech/topics/nuget.md>)

Tags: [application](<https://devfeed.tech/tags/application.md>), [applications](<https://devfeed.tech/tags/applications.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [arguments](<https://devfeed.tech/tags/arguments.md>), [assets](<https://devfeed.tech/tags/assets.md>), [binaries](<https://devfeed.tech/tags/binaries.md>), [build](<https://devfeed.tech/tags/build.md>), [cli](<https://devfeed.tech/tags/cli.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [cloud-environments](<https://devfeed.tech/tags/cloud-environments.md>), [code](<https://devfeed.tech/tags/code.md>), [command](<https://devfeed.tech/tags/command.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [containers](<https://devfeed.tech/tags/containers.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [deployment-tools](<https://devfeed.tech/tags/deployment-tools.md>), [dotnet](<https://devfeed.tech/tags/dotnet.md>), [environment](<https://devfeed.tech/tags/environment.md>), [net](<https://devfeed.tech/tags/net.md>), [net-development](<https://devfeed.tech/tags/net-development.md>), [package](<https://devfeed.tech/tags/package.md>)

### AI overview

dotnet publish compiles a .NET project, resolves dependencies, and gathers binaries, configuration, and static resources into a deployment folder. The excerpt shows -c Release for an optimized build and -o to choose the output directory. Framework-dependent output is smaller but requires the target machine to have .NET installed; self-contained output includes the runtime for a specified runtime identifier and operating system architecture. PublishSingleFile can bundle the application and dependencies into one executable, though the example notes that a few runtime-dependent files may remain. These options let developers shape output for different deployment needs.

### Source excerpt

Explore what dotnet publish does, how it works behind the scenes, and how to use it efficiently in various deployment circumstances. Related Stories Configuring Environment Variables in Ansible Introduction to GoCD Using a Package Manager in GitHub Actions

## Migrating From PostgreSQL to MongoDB in a .NET EF Core Application

DevFeed: [Migrating From PostgreSQL to MongoDB in a .NET EF Core Application](<https://devfeed.tech/articles/migrating-from-postgresql-to-mongodb-in-a-net-ef-core-application-21837.md>)

Original publisher: [Read original article](<https://www.thepolyglotdeveloper.com/blog/2025/05/migrating-from-postgresql-to-mongodb-in-a-net-ef-core-application/>)

Author: Luce Carter

Published: 2025-05-01T12:00:00Z

Content type: tutorial

Language: en

Sources: [Nic Raboy](<https://devfeed.tech/sources/nic-raboy.md>)

Topics: [MongoDB](<https://devfeed.tech/topics/mongodb.md>), [efcore](<https://devfeed.tech/topics/efcore.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Database](<https://devfeed.tech/topics/database.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [.NET](<https://devfeed.tech/topics/net.md>)

Tags: [application](<https://devfeed.tech/tags/application.md>), [application-modernization](<https://devfeed.tech/tags/application-modernization.md>), [collections](<https://devfeed.tech/tags/collections.md>), [data-migration](<https://devfeed.tech/tags/data-migration.md>), [database](<https://devfeed.tech/tags/database.md>), [dotnet](<https://devfeed.tech/tags/dotnet.md>), [efcore](<https://devfeed.tech/tags/efcore.md>), [embedding](<https://devfeed.tech/tags/embedding.md>), [genai](<https://devfeed.tech/tags/genai.md>), [migrate](<https://devfeed.tech/tags/migrate.md>), [modernization](<https://devfeed.tech/tags/modernization.md>), [mongodb](<https://devfeed.tech/tags/mongodb.md>), [net](<https://devfeed.tech/tags/net.md>), [net-development](<https://devfeed.tech/tags/net-development.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [relational-databases](<https://devfeed.tech/tags/relational-databases.md>), [scalability](<https://devfeed.tech/tags/scalability.md>)

### AI overview

The tutorial outlines moving a .NET application from PostgreSQL to MongoDB while retaining EF Core through MongoDB's EF Core Provider, which became generally available in May 2024. It uses a simple application as its example and says MongoDB Relational Migrator was used to migrate the PostgreSQL data, applying recommendations to model collections around the principle that data accessed together should be stored together. The excerpt names seven source tables, including join tables for movie casts and genres, and notes that the migrated model takes advantage of MongoDB features such as embedded documents. It explicitly leaves the migration process itself to separate documentation and a demo video, so the excerpt does not provide the migration steps.

### Source excerpt

For many reasons--including scalability, flexibility, and modernization--more and more development teams are looking to migrate away from PostgreSQL to MongoDB. In the past, these teams might have been ... The post Migrating From PostgreSQL to MongoDB in a .NET EF Core Application appeared first on DEV.

## Abusing and Detecting LOLBIN Usage of .NET Development Mode Features

DevFeed: [Abusing and Detecting LOLBIN Usage of .NET Development Mode Features](<https://devfeed.tech/articles/abusing-and-detecting-lolbin-usage-of-net-development-mode-features-20501.md>)

Original publisher: [Read original article](<https://bohops.com/2021/05/30/abusing-and-detecting-lolbin-usage-of-net-development-mode-features/>)

Author: bohops

Published: 2021-05-30T16:24:30Z

Content type: article

Language: en

Sources: [Bohops](<https://devfeed.tech/sources/bohops.md>)

Topics: [.NET](<https://devfeed.tech/topics/net.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [.NET Framework](<https://devfeed.tech/topics/net-framework.md>)

Tags: [configuration](<https://devfeed.tech/tags/configuration.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [defensive](<https://devfeed.tech/tags/defensive.md>), [environment](<https://devfeed.tech/tags/environment.md>), [execution](<https://devfeed.tech/tags/execution.md>), [feature](<https://devfeed.tech/tags/feature.md>), [net](<https://devfeed.tech/tags/net.md>), [net-development](<https://devfeed.tech/tags/net-development.md>), [override](<https://devfeed.tech/tags/override.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>)

### AI overview

The excerpt describes turning a .NET executable into a living-off-the-land binary by redirecting assembly resolution ahead of the Global Assembly Cache (GAC). It requires a configuration file with `developmentMode` set to `true` and the `DEVPATH` environment variable pointing to a directory; the CLR then checks that path for unresolved dependencies before searching the GAC. An application configuration file can be modified without administrator privileges when placed in a writable directory alongside the target assembly, while changing the system-wide `machine.config` requires administrator privileges. The excerpt introduces execution examples and defensive detection considerations but ends before providing their details.

### Source excerpt

Background As discussed in this previous post, Microsoft has provided valuable (explicit and implicit) insight into the inner workings of the functional components of the .NET ecosystem through online documentation and by open-sourcing .NET Core. .NET, in general, is a very powerful and capable development platform and runtime framework for building and running .NET managed [...]