Difference between revisions of "Setting up Visual Studio"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (*replace image with file namespace;)
Line 15: Line 15:
 
# Close any solutions you currently have open by choosing '''File > Close Solution'''.
 
# Close any solutions you currently have open by choosing '''File > Close Solution'''.
 
# Start a new solution either by selecting New Project from the Home screen, or by using '''File > New... > Project...'''
 
# Start a new solution either by selecting New Project from the Home screen, or by using '''File > New... > Project...'''
# Create a new Class Library project for C#.  Name it whatever you like. (We're using MyKSPProject for this tutorial, so replace MyKSPProject with whatever you're using.) [[Image:VS2012-NewClassLib.png|thumb|right|Setting up the class library project]]
+
# Create a new Class Library project for C#.  Name it whatever you like. (We're using MyKSPProject for this tutorial, so replace MyKSPProject with whatever you're using.) [[File:VS2012-NewClassLib.png|thumb|right|Setting up the class library project]]
# In your Solution Explorer (the pane on the top right of the screen), right-click on MyKSPProject and choose Add Reference.[[Image:VS2012-AddRef.png|thumb|right|Adding references]]
+
# In your Solution Explorer (the pane on the top right of the screen), right-click on MyKSPProject and choose Add Reference.[[File:VS2012-AddRef.png|thumb|right|Adding references]]
 
# Switch to the Browse tab.
 
# Switch to the Browse tab.
 
# Find and add the following DLLs as references:
 
# Find and add the following DLLs as references:

Revision as of 22:38, 24 November 2014

Microsoft Visual Studio is a program (more specifically IDE, or Integrated Development Environment) that makes it easier to code applications for Windows. For KSP, it is used for developing part modules via the C# IDE, although any program that can compile C# is sufficient.

Prerequisites

In order to complete this tutorial you must have the following. Plugins may be written in other environments.

Setting Up

  1. Close any solutions you currently have open by choosing File > Close Solution.
  2. Start a new solution either by selecting New Project from the Home screen, or by using File > New... > Project...
  3. Create a new Class Library project for C#. Name it whatever you like. (We're using MyKSPProject for this tutorial, so replace MyKSPProject with whatever you're using.)
    Setting up the class library project
  4. In your Solution Explorer (the pane on the top right of the screen), right-click on MyKSPProject and choose Add Reference.
    Adding references
  5. Switch to the Browse tab.
  6. Find and add the following DLLs as references:
    • KSP_INSTALL_FOLDER\KSP_Data\Managed\Assembly-CSharp.dll
    • KSP_INSTALL_FOLDER\KSP_Data\Managed\UnityEngine.dll
  7. Save your solution.
  8. In your Solution Explorer (the pane on the top right of the screen), right-click on MyKSPProject and choose Properties. Change the Target Framework to 3.5 (Visual Studio will default to a newer framework version). Visual Studio will reload the project after you click ok.


Great, you're all set! Now continue to creating your first module!