Cronologia di C#The history of C#
Questo articolo include la cronologia di ogni versione principale del linguaggio C#.This article provides a history of each major release of the C# language. Il team di C# continua a innovare il prodotto e ad aggiungere nuove funzionalità.The C# team is continuing to innovate and add new features. Informazioni dettagliate sullo stato delle funzionalità del linguaggio, include le funzionalità prese in considerazione per versioni future, sono reperibili nel repository dotnet/roslyn su GitHub.Detailed language feature status, including features considered for upcoming releases can be found on the dotnet/roslyn repository on GitHub.
Importante
Per alcune funzionalità, il linguaggio C# si basa sui tipi e metodi inclusi in quella che la specifica C# definisce la libreria standard.The C# language relies on types and methods in what the C# specification defines as a standard library for some of the features. La piattaforma .NET rende disponibili questi tipi e metodi in numerosi pacchetti.The .NET platform delivers those types and methods in a number of packages. Un esempio è l'elaborazione delle eccezioni.One example is exception processing. Ogni istruzione o espressione throw
viene controllata per assicurarsi che l'oggetto generato derivi da Exception.Every throw
statement or expression is checked to ensure the object being thrown is derived from Exception. Analogamente, ogni istruzione catch
viene controllata per verificare che il tipo intercettato derivi da Exception.Similarly, every catch
is checked to ensure that the type being caught is derived from Exception. In ogni versione potrebbero essere aggiunti nuovi requisiti.Each version may add new requirements. Per usare le funzionalità del linguaggio più recenti in ambienti meno recenti, potrebbe essere necessario installare librerie specifiche.To use the latest language features in older environments, you may need to install specific libraries. Queste dipendenze sono documentate nella pagina per ogni versione specifica.These dependencies are documented in the page for each specific version. Le informazioni sulle relazioni tra linguaggio e libreria possono essere utili per comprendere meglio questa dipendenza.You can learn more about the relationships between language and library for background on this dependency.
Gli strumenti di compilazione per C# considerano la versione del linguaggio principale più recente la versione del linguaggio predefinita.The C# build tools consider the latest major language release the default language version. Potrebbero esistere versioni intermedie tra le versioni principali, descritte in dettaglio in altri articoli in questa sezione.There may be point releases between major releases, detailed in other articles in this section. Per usare le funzionalità più recenti in una versione a punti, è necessario configurare la versione in lingua del compilatore e selezionare la versione.To use the latest features in a point release, you need to configure the compiler language version and select the version. Sono state rilasciate tre versioni a partire da C# 7,0:There have been three-point releases since C# 7.0:
- C# 7,3:C# 7.3:
- C# 7.3 è disponibile a partire da Visual Studio 2017 versione 15.7 e .NET Core 2.1 SDK.C# 7.3 is available starting with Visual Studio 2017 version 15.7 and .NET Core 2.1 SDK.
- C# 7,2:C# 7.2:
- C# 7,2 è disponibile a partire da Visual Studio 2017 versione 15,5 e .NET Core 2,0 SDK.C# 7.2 is available starting with Visual Studio 2017 version 15.5 and .NET Core 2.0 SDK.
- C# 7,1:C# 7.1:
- C# 7.1 è disponibile a partire da Visual Studio 2017 versione 15.3 e .NET Core 2.0 SDK.C# 7.1 is available starting with Visual Studio 2017 version 15.3 and .NET Core 2.0 SDK.
C# versione 1.0C# version 1.0
Quando si torna indietro e si guarda, C# versione 1,0, rilasciata con Visual Studio .NET 2002, è molto simile a Java.When you go back and look, C# version 1.0, released with Visual Studio .NET 2002, looked a lot like Java. Come affermato negli obiettivi di progettazione dichiarati per ECMA, C# cercava di essere "un linguaggio orientato agli oggetti di utilizzo generico, semplice e moderno".As part of its stated design goals for ECMA, it sought to be a "simple, modern, general-purpose object-oriented language." All'epoca, somigliare molto a Java significava aver raggiunto tali obiettivi di progettazione di allora.At the time, looking like Java meant it achieved those early design goals.
Ma se si guarda ora com'era C# 1.0, la sensazione è di disorientamento.But if you look back on C# 1.0 now, you'd find yourself a little dizzy. Mancavano le capacità asincrone predefinite e alcune delle semplici funzionalità relative ai generics che ora si danno per scontate.It lacked the built-in async capabilities and some of the slick functionality around generics you take for granted. In realtà,i generics mancavano completamente.As a matter of fact, it lacked generics altogether. E LINQ?And LINQ? Non era ancora disponibile.Not available yet. Queste aggiunte avrebbero richiesto ancora alcuni anni.Those additions would take some years to come out.
Rispetto alla versione odierna, C# versione 1.0 sembra privo di funzionalitàC# version 1.0 looked stripped of features, compared to today. e costringeva gli sviluppatori a scrivere codice piuttosto prolisso.You'd find yourself writing some verbose code. Da qualche parte, tuttavia, bisognava cominciare.But yet, you have to start somewhere. Per la piattaforma Windows, C# versione 1.0 rappresentava una valida alternativa a Java.C# version 1.0 was a viable alternative to Java on the Windows platform.
Le principali funzionalità di C# 1.0 includevano:The major features of C# 1.0 included:
- ClassiClasses
- StructStructs
- InterfacceInterfaces
- EventiEvents
- ProprietàProperties
- DelegatiDelegates
- Operatori ed espressioniOperators and expressions
- IstruzioniStatements
- Attributes (Attributi)Attributes
Versione C# 1.2C# version 1.2
C# versione 1,2 fornita con Visual Studio .NET 2003.C# version 1.2 shipped with Visual Studio .NET 2003. Conteneva alcuni piccoli miglioramenti del linguaggio.It contained a few small enhancements to the language. L'aspetto più importante è che a partire da questa versione, il codice veniva generato in un ciclo foreach
denominato Dispose in IEnumerator quando IEnumerator implementava IDisposable.Most notable is that starting with this version, the code generated in a foreach
loop called Dispose on an IEnumerator when that IEnumerator implemented IDisposable.
C# versione 2.0C# version 2.0
Qui le cose iniziano a farsi interessanti.Now things start to get interesting. Ecco alcune delle funzionalità principali di C# 2.0, rilasciato nel 2005 insieme a Visual Studio 2005:Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005:
- GenericsGenerics
- Tipi parzialiPartial types
- Metodi anonimiAnonymous methods
- Tipi valore nullableNullable value types
- IteratorsIterators
- Covarianza e controvarianzaCovariance and contravariance
Altre funzionalità di C# 2.0 aggiungevano capacità alle funzionalità esistenti:Other C# 2.0 features added capabilities to existing features:
- Accessibilità separata getter/setterGetter/setter separate accessibility
- Conversioni di gruppi di metodi (delegati)Method group conversions (delegates)
- Classi staticheStatic classes
- Inferenza del delegatoDelegate inference
All'inizio C# era un linguaggio orientato agli oggetti (OO) generico, ma con la versione 2.0 la situazione cambiò con grande rapidità.While C# may have started as a generic Object-Oriented (OO) language, C# version 2.0 changed that in a hurry. Dopo aver trovato una posizione stabile, gli sviluppatori di C# hanno affrontato alcuni gravi punti dolenti.Once they had their feet under them, they went after some serious developer pain points. E li hanno affrontati alla grande.And they went after them in a significant way.
Con generics, tipi e metodi possono operare su un tipo arbitrario, mantenendo comunque l'indipendenza dal tipo.With generics, types and methods can operate on an arbitrary type while still retaining type safety. La classe List<T>, ad esempio, consente di eseguire un'iterazione attraverso List<string>
o List<int>
eseguendo operazioni indipendenti dai tipi su tali stringhe o tali numeri interi.For instance, having a List<T> lets you have List<string>
or List<int>
and perform type-safe operations on those strings or integers while you iterate through them. L'utilizzo di generics è preferibile rispetto alla creazione di un ListInt
tipo che deriva da ArrayList
o dal cast da Object
per ogni operazione.Using generics is better than creating a ListInt
type which derives from ArrayList
or casting from Object
for every operation.
Con C# versione 2.0 sono arrivati gli iteratori.C# version 2.0 brought iterators. In breve, gli iteratori consentono di esaminare tutti gli elementi di un List
(o di altri tipi enumerabili) con un ciclo foreach
.To put it succinctly, iterators let you examine all the items in a List
(or other Enumerable types) with a foreach
loop. La presenza degli iteratori come parte fondamentale del linguaggio ha migliorato notevolmente la leggibilità del codice e la possibilità di comprenderlo.Having iterators as a first-class part of the language dramatically enhanced readability of the language and people's ability to reason about the code.
C#, tuttavia, continuava a correre dietro a Java,And yet, C# continued to play a bit of catch-up with Java. che aveva già rilasciato versioni che prevedevano generics e iteratori,Java had already released versions that included generics and iterators. ma questa situazione sarebbe cambiata presto. Man mano che procedevano nella loro evoluzione, infatti, i due linguaggi continuarono a differenziarsi.But that would soon change as the languages continued to evolve apart.
C# versione 3.0C# version 3.0
C# versione 3.0 è stato rilasciato alla fine del 2007, insieme a Visual Studio 2008, anche se la gamma completa delle funzionalità del linguaggio è stata in realtà rilasciata con .NET Framework versione 3.5.C# version 3.0 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with .NET Framework version 3.5. Questa versione rappresenta un cambiamento fondamentale,This version marked a major change in the growth of C#. perché caratterizza C# come linguaggio di programmazione dalle caratteristiche davvero eccezionali.It established C# as a truly formidable programming language. Ecco alcune delle funzionalità principali di questa versione:Let's take a look at some major features in this version:
- Proprietà implementate automaticamenteAuto-implemented properties
- Tipi anonimiAnonymous types
- Espressioni di queryQuery expressions
- Espressioni lambdaLambda expressions
- Alberi delle espressioniExpression trees
- Metodi di estensioneExtension methods
- Variabili locali tipizzate in modo implicitoImplicitly typed local variables
- Metodi parzialiPartial methods
- Inizializzatori di oggetto e di raccoltaObject and collection initializers
A posteriori, molte di queste funzionalità sembrano inevitabili e inseparabili,In retrospect, many of these features seem both inevitable and inseparable. perché si fondono l'una con l'altra in modo strategico.They all fit together strategically. Si pensa in genere che la funzionalità killer di questa versione di C# sia l'espressione di query, nota anche come Language-Integrated Query (LINQ),It's generally thought that C# version's killer feature was the query expression, also known as Language-Integrated Query (LINQ).
che, grazie a una vista più particolareggiata, consente di esaminare alberi delle espressioni, espressioni lambda e tipi anonimi, le fondamenta su cui la funzionalità LINQ stessa si basa.A more nuanced view examines expression trees, lambda expressions, and anonymous types as the foundation upon which LINQ is constructed. In entrambi i casi, tuttavia, C# 3.0 ha introdotto un concetto rivoluzionario.But, in either case, C# 3.0 presented a revolutionary concept. C# 3.0 ha iniziato a creare i presupposti per la trasformazione di C# in un linguaggio ibrido, orientato agli oggetti e funzionale.C# 3.0 had begun to lay the groundwork for turning C# into a hybrid Object-Oriented / Functional language.
In particolare, ha reso possibile scrivere query dichiarative nello stile di SQL per eseguire operazioni, tra l'altro, sulle raccolte.Specifically, you could now write SQL-style, declarative queries to perform operations on collections, among other things. Anziché scrivere un ciclo for
per calcolare la media di un elenco di numeri interi, è diventato possibile eseguire tale operazione semplicemente usando list.Average()
.Instead of writing a for
loop to compute the average of a list of integers, you could now do that as simply as list.Average()
. La combinazione di espressioni di query e di metodi di estensione rendeva quell'elenco di numeri interi molto più interessante.The combination of query expressions and extension methods made it look as though that list of integers had gotten a whole lot smarter.
La comprensione e l'integrazione effettive del concetto da parte degli utenti ha richiesto tempo, ma si è gradualmente realizzata.It took time for people to really grasp and integrate the concept, but they gradually did. E ora, dopo anni, il codice è molto più conciso, semplice e funzionale.And now, years later, code is much more concise, simple, and functional.
C# versione 4.0C# version 4.0
In C# la versione 4,0, rilasciata con Visual Studio 2010, avrebbe avuto un tempo difficile per lo stato rivoluzionario della versione 3,0.C# version 4.0, released with Visual Studio 2010, would have had a difficult time living up to the groundbreaking status of version 3.0. Con la versione 3.0, il linguaggio C# è uscito con decisione dall'ombra di Java e ha assunto una propria rilevanza.With version 3.0, C# had moved the language firmly out from the shadow of Java and into prominence. Il linguaggio stava rapidamente diventando elegante.The language was quickly becoming elegant.
La versione successiva introdusse comunque alcune nuove interessanti funzionalità:The next version did introduce some interesting new features:
- Associazione dinamicaDynamic binding
- Argomenti denominati/facoltativiNamed/optional arguments
- Covarianti e controvarianti genericheGeneric covariant and contravariant
- Tipi di interoperabilità incorporatiEmbedded interop types
I tipi di interoperabilità risolvevano un problema di distribuzione.Embedded interop types alleviated a deployment pain. Le covarianze e le controvarianze generiche offrono modalità più avanzate per l'uso dei generics, ma hanno un'aria accademica e sono probabilmente apprezzate soprattutto dagli autori di librerie e di framework.Generic covariance and contravariance give you more power to use generics, but they're a bit academic and probably most appreciated by framework and library authors. I parametri denominati e facoltativi consentono di eliminare molti overload di metodi e sono più comodi da usare.Named and optional parameters let you eliminate many method overloads and provide convenience. Ma nessuna di queste funzionalità è precisamente un modifica di paradigma.But none of those features are exactly paradigm altering.
La caratteristica principale è stata l'introduzione della parola chiave dynamic
.The major feature was the introduction of the dynamic
keyword. La parola chiave dynamic
introdotta in C# versione 4.0 offre la possibilità di eseguire l'override del compilatore per la tipizzazione in fase di compilazione.The dynamic
keyword introduced into C# version 4.0 the ability to override the compiler on compile-time typing. Con la parola chiave dynamic è possibile creare costrutti simili a quelli dei linguaggi tipizzati in modo dinamico, come JavaScript.By using the dynamic keyword, you can create constructs similar to dynamically typed languages like JavaScript. È possibile creare dynamic x = "a string"
e quindi aggiungere 6, lasciando decidere al runtime cosa deve succedere dopo.You can create a dynamic x = "a string"
and then add six to it, leaving it up to the runtime to sort out what should happen next.
L'associazione dinamica è suscettibile di errori ma offre anche la possibilità di usare il linguaggio in modo estremamente avanzato.Dynamic binding gives you the potential for errors but also great power within the language.
C# versione 5.0C# version 5.0
C# versione 5,0, rilasciata con Visual Studio 2012, è stata una versione focalizzata del linguaggio.C# version 5.0, released with Visual Studio 2012, was a focused version of the language. Quasi tutto l'impegno per questa versione è stato indirizzato verso un altro concetto rivoluzionario: il modello async
e await
per la programmazione asincrona.Nearly all of the effort for that version went into another groundbreaking language concept: the async
and await
model for asynchronous programming. Ecco l'elenco delle funzionalità principali:Here is the major features list:
Vedere ancheSee Also
Gli attributi informativi sul chiamante consentono di recuperare facilmente informazioni sul contesto di esecuzione senza dover ricorrere a una grande quantità di codice di reflection boilerplate.The caller info attribute lets you easily retrieve information about the context in which you're running without resorting to a ton of boilerplate reflection code. Questi attributi hanno molte applicazioni nelle attività di diagnostica e di registrazione.It has many uses in diagnostics and logging tasks.
Ma le vere stelle di questa versione sono async
e await
.But async
and await
are the real stars of this release. Con il rilascio di queste funzionalità nel 2012, C# ha cambiato di nuovo le carte in tavola, incorporando l'asincronia nel linguaggio e assegnandole un ruolo fondamentale.When these features came out in 2012, C# changed the game again by baking asynchrony into the language as a first-class participant. Tutti coloro che hanno avuto a che fare con operazioni di lunga esecuzione e con l'implementazione di reti di callback hanno molto apprezzato questa funzionalità.If you've ever dealt with long running operations and the implementation of webs of callbacks, you probably loved this language feature.
C# versione 6.0C# version 6.0
Le versioni 3.0 e 5.0 hanno aggiunto a C# nuove funzionalità eccezionali per un linguaggio orientato agli oggetti.With versions 3.0 and 5.0, C# had added major new features in an object-oriented language. Con la versione 6,0, rilasciata con Visual Studio 2015, è possibile evitare di eseguire una funzionalità killer dominante e rilasciare invece molte funzionalità più piccole che rendevano più produttive la programmazione in C#.With version 6.0, released with Visual Studio 2015, it would go away from doing a dominant killer feature and instead release many smaller features that made C# programming more productive. Eccone alcuni:Here are some of them:
- Importazioni staticheStatic imports
- Filtri eccezioniException filters
- Inizializzatori di proprietà automaticheAuto-property initializers
- Membri con corpo di espressioneExpression bodied members
- Propagazione NullNull propagator
- Interpolazione di stringheString interpolation
- operatore NameOfnameof operator
Le altre nuove funzionalità includono:Other new features include:
- Inizializzatori di indiceIndex initializers
- Await nei blocchi catch e finallyAwait in catch/finally blocks
- Valori predefiniti per le proprietà solo getterDefault values for getter-only properties
Ognuna di queste funzionalità è interessante in sé,Each of these features is interesting in its own right. ma osservandole nel loro complesso si scopre uno schema interessante.But if you look at them altogether, you see an interesting pattern. In questa versione, C# ha eliminato il boilerplate del linguaggio, per rendere il codice più conciso e leggibile.In this version, C# eliminated language boilerplate to make code more terse and readable. Per gli amanti della pulizia e della semplicità del codice, questa versione del linguaggio rappresenta una vittoria notevole.So for fans of clean, simple code, this language version was a huge win.
Con questa versione è stata introdotta un'altra caratteristica, che di per sé non rappresenta una funzionalità tradizionale del linguaggio.They did one other thing along with this version, though it's not a traditional language feature in itself. È stato rilasciato Roslyn, il compilatore come servizio.They released Roslyn the compiler as a service. Il compilatore C# è ora scritto in C# e può essere usato all'interno dei progetti di programmazione.The C# compiler is now written in C#, and you can use the compiler as part of your programming efforts.
C# versione 7.0C# version 7.0
C# versione 7,0 è stato rilasciato con Visual Studio 2017.C# version 7.0 was released with Visual Studio 2017. Questa versione presenta alcune delle caratteristiche evolutive e innovative di C# 6.0, ma senza il compilatore come servizio.This version has some evolutionary and cool stuff in the vein of C# 6.0, but without the compiler as a service. Ecco alcune delle nuove funzionalità:Here are some of the new features:
- Variabili outOut variables
- Tuple e decostruzioneTuples and deconstruction
- Criteri di ricercaPattern matching
- Funzioni localiLocal functions
- Membri di espressioni corpo espansiExpanded expression bodied members
- Variabili locali e valori restituiti per riferimentoRef locals and returns
Altre funzionalità:Other features included:
- Variabili discardDiscards
- Valori letterali binari e separatori di cifreBinary Literals and Digit Separators
- Espressioni throwThrow expressions
Tutte queste caratteristiche offrono nuove utili funzionalità agli sviluppatori, oltre alla possibilità di scrivere codice più pulito che mai.All of these features offer cool new capabilities for developers and the opportunity to write even cleaner code than ever. Una funzionalità di particolare rilievo è la possibilità di condensare la dichiarazione di variabili da usare con la parola chiave out
, consentendo più valori restituiti tramite tupla.A highlight is condensing the declaration of variables to use with the out
keyword and by allowing multiple return values via tuple.
Ma C# è ora destinato a un uso ancora più ampio.But C# is being put to ever broader use. .NET Core ora supporta qualsiasi sistema operativo ed è decisamente orientato al cloud e alla portabilità..NET Core now targets any operating system and has its eyes firmly on the cloud and on portability. Queste nuove capacità, insieme alla realizzazione di nuove funzionalità, tengono sicuramente impegnati i progettisti del linguaggio.These new capabilities certainly occupy the language designers' thoughts and time, in addition to coming up with new features.
C# versione 7,1C# version 7.1
C# ha iniziato a rilasciare le versioni dei punti con c# 7,1.C# started releasing point releases with C# 7.1. Questa versione ha aggiunto l'elemento di configurazione della selezione della versione della lingua , tre nuove funzionalità del linguaggio e il nuovo comportamento del compilatore.This version added the language version selection configuration element, three new language features, and new compiler behavior.
Le nuove funzionalità relative al linguaggio in questa versione sono:The new language features in this release are:
async``Main
Metodoasync
Main
method- Il punto di ingresso per un'applicazione può avere il modificatore
async
.The entry point for an application can have theasync
modifier.
- Il punto di ingresso per un'applicazione può avere il modificatore
default
espressioni letteralidefault
literal expressions- Quando è possibile dedurre il tipo di destinazione, si possono usare espressioni letterali predefinite nelle espressioni con valore predefinito.You can use default literal expressions in default value expressions when the target type can be inferred.
- Nomi di elemento di tupla dedottiInferred tuple element names
- In molti casi i nomi degli elementi della tupla possono essere dedotti dall'inizializzazione tupla.The names of tuple elements can be inferred from tuple initialization in many cases.
- Criteri di ricerca su parametri di tipo genericoPattern matching on generic type parameters
- È possibile usare espressioni di criteri di ricerca sulle variabili in cui il tipo è un parametro di tipo generico.You can use pattern match expressions on variables whose type is a generic type parameter.
Infine, il compilatore offre due opzioni -refout
e -refonly
che controllano la generazione dell'assembly di riferimento.Finally, the compiler has two options -refout
and -refonly
that control reference assembly generation.
C# versione 7,2C# version 7.2
C# 7,2 ha aggiunto diverse funzionalità del linguaggio Small:C# 7.2 added several small language features:
- Tecniche per la scrittura di codice efficiente e sicuroTechniques for writing safe efficient code
- Una combinazione di miglioramenti della sintassi che consentono l'utilizzo dei tipi valore tramite la semantica di riferimento.A combination of syntax improvements that enable working with value types using reference semantics.
- Argomenti denominati non finaliNon-trailing named arguments
- Gli argomenti denominati possono essere seguiti da argomenti posizionali.Named arguments can be followed by positional arguments.
- Caratteri di sottolineatura iniziali nei valori letterali numericiLeading underscores in numeric literals
- I valori letterali numerici possono ora includere caratteri di sottolineatura iniziali prima di qualsiasi cifra stampata.Numeric literals can now have leading underscores before any printed digits.
private protected
modificatore di accessoprivate protected
access modifier- Il modificatore di accesso
private protected
consente l'accesso per le classi derivate nello stesso assembly.Theprivate protected
access modifier enables access for derived classes in the same assembly.
- Il modificatore di accesso
- Espressioni condizionali
ref
Conditionalref
expressions- Il risultato di un'espressione condizionale (
?:
) può ora essere un riferimento.The result of a conditional expression (?:
) can now be a reference.
- Il risultato di un'espressione condizionale (
C# versione 7,3C# version 7.3
Esistono due temi principali per C# versione 7.3.There are two main themes to the C# 7.3 release. Un tema comprende funzionalità che consentono al codice gestito di offrire prestazioni altrettanto elevate di quelle del codice non gestito.One theme provides features that enable safe code to be as performant as unsafe code. Il secondo tema comprende miglioramenti incrementali delle funzionalità esistenti.The second theme provides incremental improvements to existing features. Inoltre, in questa versione sono state aggiunte nuove opzioni del compilatore.In addition, new compiler options were added in this release.
Le nuove funzionalità seguenti supportano il tema del miglioramento delle prestazioni per il codice gestito:The following new features support the theme of better performance for safe code:
- È possibile accedere a campi fissi senza blocco.You can access fixed fields without pinning.
- È possibile riassegnare le
ref
variabili locali.You can reassignref
local variables. - È possibile usare gli inizializzatori nelle
stackalloc
matrici.You can use initializers onstackalloc
arrays. - È possibile usare
fixed
istruzioni con qualsiasi tipo che supporta un modello.You can usefixed
statements with any type that supports a pattern. - È possibile usare vincoli generici aggiuntivi.You can use additional generic constraints.
Sono stati apportati i miglioramenti seguenti alle funzionalità esistenti:The following enhancements were made to existing features:
- È possibile testare
==
e!=
con i tipi di tupla.You can test==
and!=
with tuple types. - È possibile usare le variabili di espressione in più posizioni.You can use expression variables in more locations.
- È possibile associare gli attributi al campo sottostante delle proprietà implementate automaticamente.You may attach attributes to the backing field of auto-implemented properties.
- È stata migliorata la risoluzione del metodo quando gli argomenti sono diversi da
in
.Method resolution when arguments differ byin
has been improved. - La risoluzione dell'overload ora presenta un minor numero di casi ambigui.Overload resolution now has fewer ambiguous cases.
Le nuove opzioni del compilatore sono le seguenti:The new compiler options are:
-publicsign
per abilitare la firma degli assembly con software open source.-publicsign
to enable Open Source Software (OSS) signing of assemblies.-pathmap
per fornire un mapping per le directory di origine.-pathmap
to provide a mapping for source directories.
C# versione 8,0C# version 8.0
C# 8,0 è la prima versione principale di C# che è destinata specificamente a .NET Core.C# 8.0 is the first major C# release that specifically targets .NET Core. Alcune funzionalità si basano sulle nuove funzionalità CLR, altre sui tipi di libreria aggiunti solo in .NET Core.Some features rely on new CLR capabilities, others on library types added only in .NET Core. C# 8,0 aggiunge le funzionalità e i miglioramenti seguenti al linguaggio C#:C# 8.0 adds the following features and enhancements to the C# language:
- Membri di sola letturaReadonly members
- Metodi di interfaccia predefinitiDefault interface methods
- Miglioramentidi criteri di ricerca:Pattern matching enhancements:
- Utilizzo di dichiarazioniUsing declarations
- Funzioni locali staticheStatic local functions
- Struct ref DisposableDisposable ref structs
- Tipi riferimento nullableNullable reference types
- Flussi asincroniAsynchronous streams
- Indici e intervalliIndices and ranges
- Assegnazione di Unione nullNull-coalescing assignment
- Tipi costruiti non gestitiUnmanaged constructed types
- Stackalloc nelle espressioni annidateStackalloc in nested expressions
- Miglioramento delle stringhe verbatim interpolateEnhancement of interpolated verbatim strings
I membri di interfaccia predefiniti richiedono miglioramenti in CLR.Default interface members require enhancements in the CLR. Queste funzionalità sono state aggiunte in CLR per .NET Core 3,0.Those features were added in the CLR for .NET Core 3.0. Gli intervalli e gli indici e i flussi asincroni richiedono nuovi tipi nelle librerie di .NET Core 3,0.Ranges and indexes, and asynchronous streams require new types in the .NET Core 3.0 libraries. I tipi di riferimento Nullable, implementati nel compilatore, sono molto più utili quando le librerie vengono annotate per fornire informazioni semantiche relative allo stato null degli argomenti e dei valori restituiti.Nullable reference types, while implemented in the compiler, is much more useful when libraries are annotated to provide semantic information regarding the null state of arguments and return values. Queste annotazioni vengono aggiunte nelle librerie di .NET Core.Those annotations are being added in the .NET Core libraries.
Articolo originariamente pubblicato nel blog NDepend, gentilmente concesso da Erik Dietrich e Patrick Smacchia.Article originally published on the NDepend blog, courtesy of Erik Dietrich and Patrick Smacchia.