「C Sharpその他 - C SharpとVisual Studio」の版間の差分

📢 Webサイト閉鎖と移転のお知らせ
このWebサイトは2026年9月に閉鎖いたします。
新しい記事は移転先で追加しております。(旧サイトでは記事を追加しておりません)

タグ: モバイル編集 モバイルウェブ編集
 
(同じ利用者による、間の11版が非表示)
12行目: 12行目:
C# 7.1やC# 7.2はマイナーバージョンなので、使用する場合はC#のバージョンをlatestまたはバージョン指定を行う必要がある。<br>
C# 7.1やC# 7.2はマイナーバージョンなので、使用する場合はC#のバージョンをlatestまたはバージョン指定を行う必要がある。<br>
<center>
<center>
{| class="wikitable"
{| class="wikitable" | style="background-color:#fefefe;"
|-
|-
! Visual Studioのバージョン !! C#のバージョン
! style="background-color:#66CCFF;" | Visual Studioのバージョン  
! style="background-color:#66CCFF;" | C#のバージョン
|-
|-
| Visual Studio 2013 || 5.0
| Visual Studio 2013 || 5.0
|-
|-
| Visual Studio 2015 || 6.0
| Visual Studio 2015 || 6.0 (.NET Framework)<br>6.0 (.NET Core 1.x)
|-
|-
| Visual Studio 2017 15.0|| 7.0
| Visual Studio 2017 || 7.0 (.NET Framework)
|-
|-
| Visual Studio 2017 15.3|| 7.1
| Visual Studio 2017 15.5 || 7.1 (.NET Framework)<br>7.1 (.NET Core 2.0)
|-
|-
| Visual Studio 2017 15.5 || 7.2
| Visual Studio 2017 15.8 || 7.2 (.NET Framework)<br>7.2 (.NET Core 2.1)
|-
| Visual Studio 2017 15.9 || 7.3 (.NET Framework)<br>7.3 (.NET Core 2.2)
|-
| Visual Studio 2019 || 7.3 (.NET Framework)<br>8.0 (.NET Core 3.x)
|-
| Visual Studio 2019 16.8 || 9.0 (.NET 5.0)
|-
| Visual Studio 2022 17.0 || 10.0 (.NET 6.0)
|-
| Visual Studio 2022 17.4 || 11.0 (.NET 7.0)
|}
|}
</center>
</center>
34行目: 45行目:
また、ターゲットバージョンは別途SDKをダウンロードしてインストールする必要がある。<br>
また、ターゲットバージョンは別途SDKをダウンロードしてインストールする必要がある。<br>
<center>
<center>
{| class="wikitable"
{| class="wikitable" | style="background-color:#fefefe;"
|-
|-
! Visual Studioバージョン !! .NET Frameworkバージョン
! style="background-color:#66CCFF;" | Visual Studioバージョン  
! style="background-color:#66CCFF;" | .NET Frameworkバージョン
|-
|-
| Visual Studio 2013 || 4.5
| Visual Studio 2013 || 4.5
43行目: 55行目:
|-
|-
| Visual Studio 2017 || 4.7
| Visual Studio 2017 || 4.7
|}
</center>
<br><br>
== Visual Studioのサポート期間 ==
<center>
{| class="wikitable" | style="background-color:#fefefe;"
|-
! style="background-color:#66CCFF;" | 製品名
! style="background-color:#66CCFF;" | サポート終了日
|- style="background-color:#AAAAAA;"
| Visual Studio 2010 Service Pack 1 || 2020/07/14 (サポート終了済)
|- style="background-color:#AAAAAA;"
| Visual Studio 2012 Update 5 || 2023/01/10 (サポート終了済)
|- style="background-color:#AAAAAA;"
| Visual Studio 2013 Update 5 || 2024/04/09 (サポート終了済)
|-
| Visual Studio 2015 Update 3 || 2025/10/14
|-
| Visual Studio 2017 Version 15.9 || 2027/04/13
|-
| Visual Studio 2019 Version 16.4 || 2029/04/10
|-
| Visual Studio 2022 || 2031/11/08
|-
| VS Code || モダンライフサイクルポリシーに従う
|}
</center>
<br><br>
== .NET / .NET Frameworkのサポート期間 ==
.NET5のリリースにより、.NET Frameworkは4.8が最終となる。<br>
<center>
{| class="wikitable" | style="background-color:#fefefe;"
|-
! style="background-color:#66CCFF;" | 製品名
! style="background-color:#66CCFF;" | サポート終了日
|-
| .NET Framework 3.5 SP1 || 2029/01/09
|- style="background-color:#AAAAAA;"
| .NET Framework 4.5.2 || (サポート終了済)<br>OSのライフサイクルが適用<br>(Windows 8.1 / 2012 / 2012 R2と同じ)<br>Windows 8.1では、2023/01/10<br>Windows Server 2012 R2では、2023/10/10
|- style="background-color:#AAAAAA;"
| .NET Framework 4.6 || (サポート終了済)<br>OSのライフサイクルが適用<br>(Windows 8.1 / 2012 / 2012 R2と同じ)<br>Windows 8.1では、2023/01/10<br>Windows Server 2012 R2では、2023/10/10
|- style="background-color:#AAAAAA;"
| .NET Framework 4.6.1 || (サポート終了済)<br>OSのライフサイクルが適用<br>(Windows 8.1 / 2012 / 2012 R2と同じ)<br>Windows 8.1では、2023/01/10<br>Windows Server 2012 R2では、2023/10/10
|- style="background-color:#AAAAAA;"
| .NET Framework 4.6.2 || (サポート終了済)<br>OSのライフサイクルが適用<br>(Windows 8.1 / 2012 / 2012 R2と同じ)<br>Windows 8.1では、2023/01/10<br>Windows Server 2012 R2では、2023/10/10
|-
| .NET Framework 4.7 || OSのライフサイクルが適用<br>(Windows 8.1 / 2012 / 2012 R2 / 2016と同じ)<br>Windows 8.1では、2023/01/10<br>Windows Server 2016では、2027/01/12
|-
| .NET Framework 4.7.1 || OSのライフサイクルが適用<br>(Windows 8.1 / 2012 / 2012 R2 / 2016と同じ)<br>Windows 8.1では、2023/01/10<br>Windows Server 2016では、2027/01/12
|-
| .NET Framework 4.7.2 || OSのライフサイクルが適用<br>(Windows 8.1 / 2012 / 2012 R2 / 2016 / 2019と同じ)<br>Windows 8.1では、2023/01/10<br>Windows Server 2019では、2029/01/09
|-
| .NET Framework 4.8 || OSのライフサイクルが適用<br>(Windows 8.1 / 10 / 2012 / 2012 R2 / 2016 / 2019と同じ)<br>Windows 8.1では、2023/01/10<br><br>Windows 10では、2025/10/14<br>(Windows 10は、.NET Framework 4.8以降のみインストールできる)<br><br>Windows Server 2019では、2029/01/09
|- style="background-color:#AAAAAA;"
| .NET Core 3.1 || 2022/12/13 (LTS) (サポート終了済)
|- style="background-color:#AAAAAA;"
| .NET 5 || 2022/5/10 (サポート終了済)
|- style="background-color:#AAAAAA;"
| .NET 6 || 2024/11/12 (LTS) (サポート終了済)
|- style="background-color:#AAAAAA;"
| .NET 7 || 2024/5/14 (サポート終了済)
|-
| .NET 8 || 2026/11/10
|-
| .NET 9 || 2026/5/12
|}
</center>
<br>
詳細は、[https://docs.microsoft.com/ja-jp/dotnet/framework/migration-guide/versions-and-dependencies Microsoft公式Webサイトの各バージョンとサポートOS]を参照すること。<br>
<br><br>
== .NETおよび.NET Frameworkのバージョンの取得 ==
C#.NET等のソフトウェアから、.NETおよび.NET Frameworkのバージョンを取得する。<br>
<syntaxhighlight lang="c#">
using System.Runtime.InteropServices;
public static string FrameworkDescription { get; }
</syntaxhighlight>
<br>
型:
String
説明:
ソフトウェアが実行されている.NETおよび.NET Frameworkのインストール名を取得する。
<br>
プロパティ<code>FrameworkDescription</code>には、現在、実行中の.NET実装名を示す文字列を返す。<br>
この文字列は、以下に示すいずれかの説明で始まり、次に、バージョンが続く。<br>
* ".NET" (.NET 5 以降のバージョンの場合)
* ".NET Core" (.NET Core 1.0 - 3.1 の場合)
* ".NET Framework"
* ".NET Standard"
<br>
# 出力例
.NET Framework 4.8.4250.0
.NET Core 3.1.9
.NET 5.0.0
<br>
<center>
{| class="wikitable" | style="background-color:#fefefe;"
|+ 適用対象
|-
! style="background-color:#66CCFF;" | 製品
! style="background-color:#66CCFF;" | バージョン
|-
| .NET || Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1<br>5, 6, 7
|-
| .NET Framework || 4.7.1, 4.7.2, 4.8
|-
| .NET Standard || 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
|-
| Xamarin.iOS || 10.8
|-
| Xamarin.Mac || 3.0
|}
|}
</center>
</center>