Saltar al contenido principal
ProductosHerramientas de escritorioTASTECADRevisión de planosTASTEFILESGestión de archivosTASTEFTPTransferencia de archivosTASTESSHEspacio de trabajo remotoTASTEZIPCompresión y extracciónTASTEWINMGestión de archivosHerramientas para desarrolladoresTASTECODEEntorno de desarrollo integrado para RustTASTESTUDIOEntorno integrado de desarrollo y pruebasTASTEETLIntegración de datos (ETL)ServidoresTASTEREMOTEServidor de escritorio remotoTASTEGEOServidor geoespacialTASTEMAILEspacio de trabajo de correoInversiónTASTESTOCKAplicación de escritorio de trading automático de accionesEmpezarDescargasDocumentaciónComprarTodos los productos
Marketplace
Noticias
TecnologíaNoticiasNoticias de desarrollo de hoyDocumentaciónLenguajes de programaciónRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFrameworks web frontendNext.jsReactVue.js · NuxtSvelteKitAngularFrameworks de servidorSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFrameworks de apps y escritorioTauriFlutterReact NativeElectronAlgoritmosFundamentos de algoritmosAlgoritmos esencialesAlgoritmos avanzadosAlgoritmos prácticos
ComunidadProyectosRegistros de desarrolloPromptsProblemas con herramientas de IAEscaparateGuía de la comunidad
ColaboraTransferencia técnicaDesarrollo de sitio webDesarrollo de app de escritorioCanal de lanzamiento y pagosSocio de ventasContacto
ServiciosEscritorio remotoPaquetes de instalación a medida
TASTEDEV
Productos

Herramientas de escritorio

TASTECADAbre planos complejos con ligerezaTASTEFILESSolo los archivos que necesitas, lo más rápido posibleTASTEFTPEl camino más limpio para tus archivosTASTESSHEntre tu servidor y tú, una conexión más sólidaTASTEZIPComprime más rápido, descomprime más seguroTASTEWINMUn gestor de archivos de dos paneles pensado para el teclado

Herramientas para desarrolladores

TASTECODEEdita, compila, depura y prueba apps de Rust en una sola ventanaTASTESTUDIODe la edición a las pruebas remotas y las correcciones con IA aprobadasTASTEETLMueve datos viendo sus valores

Servidores

TASTEREMOTEUn escritorio remoto que funciona en tu propio servidorTASTEGEOUn servidor geoespacial compatible con GeoServer, reconstruido en RustTASTEMAILRecupera el control de tu correo

Inversión

TASTESTOCKTrading automático de acciones según las reglas que tú defines: cuándo y qué

Empezar

DescargasÚltimas versiones de cada productoDocsCómo usar cada productoComprarSuscripciones y licencias perpetuasTodos los productosTodos los productos de un vistazo
Todos los productos
MarketplaceNoticias
Tecnología

Noticias

Noticias de desarrollo de hoyAnuncios oficiales de lenguajes, frameworks, GitHub e IADocumentaciónGuías de lenguajes, frameworks y algoritmos

Lenguajes de programación

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Frameworks web frontendNext.jsReactVue.js · NuxtSvelteKitAngular
Frameworks de servidorSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Frameworks de apps y escritorioTauriFlutterReact NativeElectron

Algoritmos

Fundamentos de algoritmosAnálisis de complejidad · Ordenamiento · Búsqueda · Estructuras de datos básicas · Árboles y montículosAlgoritmos esencialesRecorrido de grafos · Camino mínimo y árbol generador mínimo · Programación dinámica · Algoritmos voraces · Divide y vencerás · Backtracking (vuelta atrás)Algoritmos avanzadosAlgoritmos de cadenas · Matemáticas y teoría de números · Manipulación de bits · Árboles de segmentos · Union-FindAlgoritmos prácticosEstrategia para entrevistas de código · Caché LRU · Limitación de tasa · Hashing consistente
Toda la documentación de desarrollo
Comunidad
ProyectosDescubre creadores y su trabajoRegistros de desarrolloDecisiones y aprendizajesPromptsInstrucciones reutilizablesProblemas con herramientas de IAProblemas y alternativas de Claude, Codex, GeminiEscaparateResultados terminadosGuía de la comunidadCómo construimos en abierto
Colabora
Transferencia técnicaApps nativas con Rust y eguiDesarrollo de sitio web10 idiomas, cuentas, documentación y descargasDesarrollo de app de escritorioRust y egui, sin WebViewCanal de lanzamiento y pagosFirma, MSI, deb, rpm, AppImage, hashesSocio de ventasRecomiéndanos y gana el 30 %ContactoDesarrollo, alianzas e inversión
Servicios
Escritorio remotoAccede a tu ordenador desde el navegadorPaquetes de instalación a medidaSolo lo necesario, ajustes precargados
Comprar
ES
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Iniciar sesión
Iniciar sesión
TASTEDEV

De pequeñas herramientas a un mejor desarrollo.

support@tastedev.netApoyar a TASTEDEV
ProductosLínea de productosComprarDocsDescargasMarketplaceSoporte
ComunidadProyectosRegistros de desarrolloPromptsProblemas con herramientas de IAEscaparate
PolíticasQuiénes somosPolítica de privacidadTérminos de servicioCondiciones de suscripciónReembolsosNormas de la comunidad
CuentaIniciar sesiónRegistrarse
Visitantes
Hoy
Ayer
Vistas totales
Empresa
GXSOFT
Representante
CHOI YOUNG GU
Número de registro mercantil
853-44-00368
Dirección
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Teléfono
+82-10-4404-1523
Correo electrónico
whitecalvin@tastedev.net
Responsable de privacidad
CHOI YOUNG GU

© 2026 TASTEDEVLa información de los productos se basa en fuentes de desarrollo verificadas.Publicado · en mejora

Documentación de C#
C#
Getting Started with CSyntax BasicsTypes and DataProjects and PackagesErrors and TestingKey Concepts: LINQ, Delegates, and Async
Debates

Guía de C# · 4/6

Projects and Packages

Por ahora, este capítulo solo está disponible en inglés.

As a codebase grows, you split it into several projects and start pulling in libraries written by others. .NET organizes this around four units: assemblies, projects, solutions, and NuGet packages. This chapter explains how they fit together, then shows how to reference projects, add packages, and produce output you can ship.

Assemblies, Projects, and Solutions

UnitWhat it is
AssemblyThe compiled output: a .dll library or an executable, containing code plus type metadata.
ProjectOne .csproj file that produces one assembly; it lists sources, target framework, and dependencies.
SolutionA list of projects you build and test together, stored as .sln or the newer XML-based .slnx.
NuGet packageA .nupkg archive of assemblies and metadata, downloaded from a feed such as nuget.org.

Keep namespaces and assemblies apart in your head. A namespace is a logical naming scope; an assembly is a physical unit of deployment. One assembly can contain many namespaces, and a single namespace can span several assemblies.

Creating a Multi-Project Solution

A common layout is an executable, a class library holding the core logic, and a test project, all in one solution. These commands create the skeleton:

mkdir Shop && cd Shop
dotnet new sln -n Shop
dotnet new classlib -o src/Shop.Core
dotnet new console -o src/Shop.Cli
dotnet sln add src/Shop.Core src/Shop.Cli

# let Shop.Cli use the code in Shop.Core
dotnet add src/Shop.Cli reference src/Shop.Core

dotnet build   # from the solution folder, this builds every project

Adding the reference writes an entry like this into Shop.Cli.csproj. At build time the referenced project is compiled first and its assembly is copied into the consumer's output folder.

<ItemGroup>
  <ProjectReference Include="..\Shop.Core\Shop.Core.csproj" />
</ItemGroup>

Access Modifiers Across Assemblies

Only types and members marked public are visible to other projects. internal means visible within the same assembly only, which is how libraries hide implementation details. A top-level type with no modifier defaults to internal.

// src/Shop.Core/PriceCalculator.cs
namespace Shop.Core;

public static class PriceCalculator
{
    public static decimal WithTax(decimal price) => Round(price * (1 + TaxRate));

    internal const decimal TaxRate = 0.1m;   // visible only inside Shop.Core

    private static decimal Round(decimal value) => Math.Round(value, 2);
}
¿Tienes preguntas sobre este capítulo?
Capítulo anteriorTypes and DataCapítulo siguienteErrors and Testing
// src/Shop.Cli/Program.cs
using Shop.Core;

Console.WriteLine($"{PriceCalculator.WithTax(100m):F2}"); // 110.00
// PriceCalculator.TaxRate is internal, so it is not accessible here

If a test project needs to exercise internal members, the library can grant access to that specific assembly with the InternalsVisibleTo attribute.

Using NuGet Packages

NuGet is the package manager for .NET. dotnet add package records a PackageReference in the project file, and packages are restored automatically on the next build.

cd src/Shop.Cli
dotnet add package Humanizer                     # add the latest stable version
dotnet add package Humanizer --version <version> # pin a specific version
dotnet list package                              # show referenced packages
dotnet list package --outdated                   # show packages with newer versions
dotnet remove package Humanizer                  # remove it again
dotnet restore                                   # run the restore step on its own
using Humanizer;

Console.WriteLine("order_created_at".Humanize());        // Order created at
Console.WriteLine(TimeSpan.FromMinutes(95).Humanize(2)); // 1 hour, 35 minutes

Before adopting a package, check its download count, how recently it was updated, its license, and which frameworks it supports. When many projects must agree on package versions, central package management lets you set them once in a Directory.Packages.props file at the solution root, and shared build settings can live in Directory.Build.props.

Publishing

dotnet build output is meant for development. To produce something you can deploy to another machine, use dotnet publish:

# framework-dependent: smaller, but the target machine needs the .NET runtime
dotnet publish src/Shop.Cli -c Release -o out

# self-contained: bundles the runtime, nothing to install on the target
dotnet publish src/Shop.Cli -c Release -r linux-x64 --self-contained -o out-linux

# bundle everything into a single executable file
dotnet publish src/Shop.Cli -c Release -r win-x64 --self-contained -p:PublishSingleFile=true

The -r option takes a runtime identifier (RID) such as win-x64, linux-x64, or osx-arm64. If startup time and memory footprint matter, add <PublishAot>true</PublishAot> to the project to compile ahead of time to native code, though libraries that lean heavily on reflection may not be compatible. To share a library as a NuGet package of your own, run dotnet pack -c Release.

Summary

  • Each project produces one assembly, and a solution groups related projects.
  • Add projects to a solution with dotnet sln add and connect them with dotnet add reference.
  • Mark what other assemblies may use as public; keep implementation details internal.
  • dotnet add package records a PackageReference, and packages are restored at build time.
  • Ship with dotnet publish, choosing framework-dependent, self-contained, single-file, or native AOT output.

0 comentarios

Comentarios destacadosMás recientes primero

Iniciar sesión · Inicia sesión para dejar un comentario.