Solidity Installation – How to Install Solidity in Visual Studio

contract-deploymentinstallationsolidityvisual-studio

I see microsoft visual studio now supports solidity and smart contracts deployments. The release notes state:

  • Creates project scaffolding with smart contract samples
  • Supports context sensitive menus for compilation and deployment of smart contracts.
  • Compilation generates both abi and binary files in the project ‘bin’ folder that are needed for deployment
  • The deploy option is tailored for the BlockApps STRATO instance
  • The deploy option automatically launches a self generated UI that can be used to test the smart contract
  • Generates automatic key upon first use and the default settings can be viewed on the project properties

But, I have Visual Studio installed. How to install solidity support and start developing / deploying smart contracts?

Best Answer

  1. You will need to download and install the SolidityProject.vsix from the link you have provided.
  2. Once installed, you will be able to create a new DecentralizedApplication which can be found under the Solidity folder.New Decentralized Solidity Application in Visual Studio

  3. The extension provides a sample structure, contracts and a readme file with instructions for integration with BlockApps. Decentralized Solidity Application sample structure

  4. Right clicking in a contract allows you to Compile and/or deploy a contract to BlockApps.

  5. Compiling a contract mainly calls solc (which is embedded as a resource in the extension) and outputs the .abi and .bin files in the bin folder. You will need to use Explorer to view the files.

  6. To deploy using Blockapps, follow the instructions on the readme file for installation and configuration of your project.

Note: If after creating a new project you have issues with the readme file continuously reopening, restart visual studio.

Syntax highlighting is not yet implemented, but work in progress. If you require this now there are extensions for Visual Studio Code and Sublime.