LazyMagic

How to Install Visual Studio IDE for LazyMagic

⚡ Quick Answer

If you are using Visual Studio IDE you can run LazyMagicCLI as an external tool. Just add an external tool entry with these properties: Title: LzGen, Command: pwsh.exe, Arguments: -NoExit -Command LazyMagicCLI, Initial Directory: ${SolutionDir}. Also select the Use Output window option.

Prerequisites

  • ✅ Windows 10 or 11
  • ✅ Administrator access
  • ⏱️ Estimated time: 5 minutes
  • 💰 Cost: Free (Community Edition)

What is Visual Studio IDE?

Visual Studio IDE Community Edition is Microsoft's integrated development environment for .NET applications. While optional for LazyMagic development, it provides excellent tooling for building and debugging the sample system. You can alternatively use command-line tools or other .NET-compatible IDEs.

Step-by-Step Installation Guide

Step 1: Configure VS IDE to run LazyMagicCLI as a tool.

  1. Navigate to Tools → ExternalTools
  2. Add a new Menu Item
  3. Title: LzGen
  4. Command: pwsh.exe
  5. Arguments: -NoExit -Command LazyMagicCLI
  6. Initial directory: ${SolutionDir}
  7. Use Output Window:
  8. Click OK to save the new tool.

Once added, the new tool can be found in the Tools menu.

Step 2: Configure PowerShell 7 Terminal

Configure Visual Studio to use PowerShell 7 instead of the default PowerShell for better LazyMagic compatibility:

2.1 Open Terminal Settings

  1. Launch Visual Studio 2022
  2. Navigate to Tools → Options → Environment → Terminal

2.2 Add PowerShell 7 Profile

  1. Click "Add" to create a new terminal profile
  2. Set the name to "PowerShell 7"
  3. Set the shell location to your PowerShell 7 executable (typically C:\Program Files\PowerShell\7\pwsh.exe)
  4. Add the following arguments:
-NoExit -Command "& { Import-Module """$env:VSAPPIDDIR\..\Tools\Microsoft.VisualStudio.DevShell.dll"""; [Void](Enter-VsDevShell  -SkipAutomaticLocation -SetDefaultWindowTitle -InstallPath $env:VSAPPIDDIR\..\..); [Console]::WriteLine('** PowerShell 7 Developer Shell Initialized **'); }"

2.3 Set as Default

  1. Select the PowerShell 7 profile as the default terminal
  2. Click "OK" to save settings

Verification

To verify Visual Studio is properly installed and configured:

  1. Open Visual Studio 2022
  2. Open the terminal (View → Terminal or Ctrl+`)
  3. Verify PowerShell 7 is running with: $PSVersionTable.PSVersion
  4. Check that the developer environment is loaded (you should see the initialization message)

Important Notes

  • PowerShell Versions: We discourage using the default PowerShell Developer terminal as it creates confusion with PowerShell 7
  • .NET Installation: The latest .NET SDK will be installed automatically with Visual Studio
  • Mac Support: Visual Studio for Mac is no longer supported as Microsoft discontinued that product
  • Alternative IDEs: You can use other .NET-compatible IDEs like JetBrains Rider or VS Code if preferred

Troubleshooting

Common Issues

  • Installation failures: Ensure you have sufficient disk space and administrator privileges
  • Workload missing: Re-run the installer and modify your installation to add missing workloads
  • PowerShell 7 not found: Verify PowerShell 7 is installed and note its installation path
  • Terminal configuration: Double-check the command arguments for any typos

Next Steps

After successfully installing Visual Studio IDE, proceed to install .NET in the next step of the LazyMagic setup process.