Changes

Jump to navigation Jump to search
no edit summary
Line 32: Line 32:  
# Filter by "C#" and "Library", then choose ''Class Library'' and click ''Next''. Make sure you '''don't''' choose ''Class Library (.NET Framework)'' which won't work.<br />[[File:Modding - IDE reference - create project (Visual Studio 2).png| 589px]]
 
# Filter by "C#" and "Library", then choose ''Class Library'' and click ''Next''. Make sure you '''don't''' choose ''Class Library (.NET Framework)'' which won't work.<br />[[File:Modding - IDE reference - create project (Visual Studio 2).png| 589px]]
 
# In the ''configure your new project'' window: <ol><li>Enter a descriptive mod name. By convention, the name should be one word with mixed caps (like "PineapplesEverywhere").</li><li>Make sure "Place solution and project in the same directory" is ''not'' checked.</li><li>Click "Create" to to create the project.</li></ol>[[File:Modding - IDE reference - create project (Visual Studio 3).png|800px]]
 
# In the ''configure your new project'' window: <ol><li>Enter a descriptive mod name. By convention, the name should be one word with mixed caps (like "PineapplesEverywhere").</li><li>Make sure "Place solution and project in the same directory" is ''not'' checked.</li><li>Click "Create" to to create the project.</li></ol>[[File:Modding - IDE reference - create project (Visual Studio 3).png|800px]]
# Next, select NET 5.0 and click "Create" to create the project. For VS 2022, this will be on the next page. <br/>[[File:Screenshot 2021-12-16 140835.png]]
+
# Next, select NET 6.0 and click "Create" to create the project. For VS 2022, this will be on the next page. <br />[[File:Screenshot 2021-12-16 140835.png]]
    
===Linux (MonoDevelop)===
 
===Linux (MonoDevelop)===
Line 47: Line 47:  
# Click ''File » New Solution'' from the menu bar:<br />[[File:VS Mac 1 newsolution.png|600px]]
 
# Click ''File » New Solution'' from the menu bar:<br />[[File:VS Mac 1 newsolution.png|600px]]
 
# Select the correct type of class library:<br />[[File:VS Mac 2 createlibrary.png|600px]]
 
# Select the correct type of class library:<br />[[File:VS Mac 2 createlibrary.png|600px]]
# Set it to target <b>.NET 5.0.</b>:<br />[[File:VS Mac 3 setframework.png|600px]]
+
# Set it to target '''.NET 5.0.''':<br />[[File:VS Mac 3 setframework.png|600px]]
 
# Enter a descriptive mod name for the project. By convention, the name should be one word with mixed caps (like "PineapplesEverywhere"):<br />[[File:VS Mac 4 nameproject.png|600px]]
 
# Enter a descriptive mod name for the project. By convention, the name should be one word with mixed caps (like "PineapplesEverywhere"):<br />[[File:VS Mac 4 nameproject.png|600px]]
   Line 59: Line 59:  
==Set the target framework==
 
==Set the target framework==
 
<span id="set-target-framework"></span>
 
<span id="set-target-framework"></span>
The 'target framework' is the version of .NET your code uses, which affects the version needed to run your mod. The recommended target framework is .NET 5.0, which is the version SMAPI itself targets. <b>Please find the subsection below for your OS</b> (Windows/Mac).  
+
The 'target framework' is the version of .NET your code uses, which affects the version needed to run your mod. The recommended target framework is .NET 5.0, which is the version SMAPI itself targets. '''Please find the subsection below for your OS''' (Windows/Mac). '''You cannot use .NET 6.0'''.
 +
 
 +
(yes, we know .NET 5.0 is past EOL.)
    
===In Windows Visual Studio 2019/2022===
 
===In Windows Visual Studio 2019/2022===
Line 95: Line 97:     
===In MonoDevelop/Visual Studio for Mac===
 
===In MonoDevelop/Visual Studio for Mac===
<b><p style="color:red;">This section is out of date for Stardew Valley 1.5.5. It appears you cannot change the .NET framework in this way with Visual Studio 2019 and Stardew Valley 1.5.5.</p><b/>
+
<p style="color:red;">'''This section is out of date for Stardew Valley 1.5.5. It appears you cannot change the .NET framework in this way with Visual Studio 2019 and Stardew Valley 1.5.5.'''</p>
    
# Open the Solution pad. If it's not visible, click ''View » Pads » Solution'' from the menu:<br />[[File:Modding - IDE reference - show solution pane (MonoDevelop).png]]
 
# Open the Solution pad. If it's not visible, click ''View » Pads » Solution'' from the menu:<br />[[File:Modding - IDE reference - show solution pane (MonoDevelop).png]]
Line 130: Line 132:  
<span id="add-nuget"></span>
 
<span id="add-nuget"></span>
   −
===In Visual Studio 2017===
+
===In Visual Studio 2019/2022===
 
# Click ''Tools » NuGet Package Manager » Manage NuGet Packages for Solution'' from the menu:<br />[[File:Modding - IDE reference - add NuGet package (Visual Studio 1).png]]
 
# Click ''Tools » NuGet Package Manager » Manage NuGet Packages for Solution'' from the menu:<br />[[File:Modding - IDE reference - add NuGet package (Visual Studio 1).png]]
 +
# Note: if the nuget package manager is missing, you can add it as a package source with the following steps: https://stackoverflow.com/questions/37293242/nuget-package-manager-no-packages-found-even-though-the-package-exists
 
# On the ''Browse'' tab, search for the package and click on the result to display some options:<br />[[File:Modding - IDE reference - add NuGet package (Visual Studio 2).png]]
 
# On the ''Browse'' tab, search for the package and click on the result to display some options:<br />[[File:Modding - IDE reference - add NuGet package (Visual Studio 2).png]]
 
# In the options, check the box next to your project and click ''Install'':<br />[[File:Modding - IDE reference - add NuGet package (Visual Studio 3).png]]
 
# In the options, check the box next to your project and click ''Install'':<br />[[File:Modding - IDE reference - add NuGet package (Visual Studio 3).png]]
Line 184: Line 187:  
# Find the DLL you want to reference, select it, and click ''Add'':<br />[[File:Modding - IDE reference - add reference (Visual Studio 3).png]]
 
# Find the DLL you want to reference, select it, and click ''Add'':<br />[[File:Modding - IDE reference - add reference (Visual Studio 3).png]]
 
# From the 'Reference Manager' window, click ''OK'':<br />[[File:Modding - IDE reference - add reference (Visual Studio 4).png]]
 
# From the 'Reference Manager' window, click ''OK'':<br />[[File:Modding - IDE reference - add reference (Visual Studio 4).png]]
 +
 +
===In Rider===
 +
When opening a project for the first time, you must add a reference to StardewModdingAPI.dll for code completion to work.
 +
# In the Explorer panel, select the ''Solution'' view
 +
# Under the project, right-click on ''Dependencies'' and choose ''Reference...''
 +
# In the Add Reference window, click ''Add From...'' at the bottom
 +
# Find the DLL you want to reference, select it, and click ''OK''
 +
    
[[Category:Modding]]
 
[[Category:Modding]]
    +
[[es:Modding:Referencia IDE]]
 
[[ru:Модификации:Настройка среды разработки]]
 
[[ru:Модификации:Настройка среды разработки]]
 
[[zh:模组:IDE 参考]]
 
[[zh:模组:IDE 参考]]

Navigation menu