Changes

split .NET 6 into what's new vs breaking changes (SMAPI can still load .NET 5 mods, but you won't be able to compile them anymore)
Line 24: Line 24:  
==What's new architecturally?==
 
==What's new architecturally?==
 
===.NET 6===
 
===.NET 6===
For C# mod authors, Stardew Valley 1.6 updates from .NET 5 to .NET 6. See [https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6 ''What's new in .NET 6''] and [https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10 ''What's new in C# 10''] for more info, but some highlights include improved performance, [https://devblogs.microsoft.com/dotnet/update-on-net-hot-reload-progress-and-visual-studio-2022-highlights/ improved hot reload], [https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6#new-linq-apis new LINQ methods], [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record record structs], and support for ARM64 on macOS.
+
: ''See also: [[#.NET 6 2|.NET 6]] under breaking changes.''
   −
You can continue building mods in .NET 5 (SMAPI will load them fine), or migrate to .NET 6 to make use of newer features. If you want to update a C# mod:
+
For C# mod authors, Stardew Valley 1.6 updates from .NET 5 to .NET 6. See [https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6 ''What's new in .NET 6''] and [https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10 ''What's new in C# 10''] for more info, but some highlights include...
<ol>
+
* improved performance;
<li>Fully exit Visual Studio.</li>
+
* [https://devblogs.microsoft.com/dotnet/update-on-net-hot-reload-progress-and-visual-studio-2022-highlights/ improved hot reload];
<li>Open each mod's <samp>.csproj</samp> file in a text editor, then find this line:
+
* [https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6#new-linq-apis new LINQ methods];
<syntaxhighlight lang="xml">
+
* [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record record structs];
<TargetFramework>net5.0</TargetFramework>
+
* and support for ARM64 on macOS.
</syntaxhighlight>
  −
 
  −
And change it to this:
  −
<syntaxhighlight lang="xml">
  −
<TargetFramework>net6.0</TargetFramework>
  −
</syntaxhighlight>
  −
</li>
  −
<li>Delete your solution's hidden <samp>.vs</samp> folder, and every project's <samp>bin</samp> and <samp>obj</samp> folders.</li>
  −
<li>Reopen the solution in Visual Studio, click ''Build > Rebuild Solution'', and make sure it still loads into the game fine.</li>
  −
</ol>
      
==What's new for items==
 
==What's new for items==
Line 5,564: Line 5,554:     
See also [[#Breaking changes for content packs|''Breaking changes for content packs'']], which affect C# mods too.
 
See also [[#Breaking changes for content packs|''Breaking changes for content packs'']], which affect C# mods too.
 +
 +
===.NET 6===
 +
: ''See also: [[#.NET 6|.NET 6]] under what's new.''
 +
 +
Stardew Valley 1.6 updates from .NET 5 to .NET 6. SMAPI can still load .NET 5 mods fine, but you'll get a build error when compiling them. To update a C# mod:
 +
<ol>
 +
<li>Fully exit Visual Studio.</li>
 +
<li>Open each mod's <samp>.csproj</samp> file in a text editor, then find this line:
 +
<syntaxhighlight lang="xml">
 +
<TargetFramework>net5.0</TargetFramework>
 +
</syntaxhighlight>
 +
 +
And change it to this:
 +
<syntaxhighlight lang="xml">
 +
<TargetFramework>net6.0</TargetFramework>
 +
</syntaxhighlight>
 +
</li>
 +
<li>Delete your solution's hidden <samp>.vs</samp> folder, and every project's <samp>bin</samp> and <samp>obj</samp> folders.</li>
 +
<li>Reopen the solution in Visual Studio, click ''Build > Rebuild Solution'', and make sure it still loads into the game fine.</li>
 +
</ol>
    
===Item ID changes===
 
===Item ID changes===
translators
8,447

edits