Version 1.1 of Solidity Extension released!


We have just released an update to the Solidity extension for Visual Studio.  There has been lots of feedback from the community and it’s very much appreciated.  Detailed below is more information about the update.

Getting the update

We had to make some core changes to the project structure to support the ability to handle multi-project solutions.  The update should happen automatically in the background as any other extension, via a notification in Visual Studio.   If you don’t see the upgrade pop up you will have to do some manual work to get this specific update.  If you don’t see the automatic upgrade, please follow these steps:

  1. First uninstall the current Solidity extension.
    • Click on Tools -> Extensions and Updates…

      tools_upd

    • Scroll down to find the Solidity Extension and click Uninstall.

      tools_upd_uninstall

  2. Next install the latest extension by browsing to the public marketplace (Solidity in Visual Studio Marketplace), downloading and installing the extension.

New Features

With this release there are several new features.  These range from code editing to new templates.

Code Editing

Obviously, one of the primary reasons you would be using Visual Studio is to write some code.  Over the years developers have become accustomed to features such as auto complete and coloring.  The Solidity extension has implemented the language from scratch so all of these features need to implemented.  We have a start with this version.

  • Auto Completion – Automatic completion of code statements have been implemented for these keywords (Contract, Function, Import, Struct, Mapping, Address, Constant, Returns, Return, If/Else)

    auto-complete

  • Bracket Matching – Bracket matching is ability of the IDE to show the starting/closing brackets for (‘{}’,'()’,'[]’).  This means that if either the starting or closing brackets are selected by the developer, the paired bracket is highlighted.  This makes it easier to find missing brackets in more complex code.

    bracket-matching

  • Keyword Highlighting – Keyword highlighting is a feature that highlights exact words that match the word that is currently select (clicked on) by the user.  This makes it easier to find dependencies in your code or when refactoring/cleaning up code.

    keyword-matching

Templates

Templates for various projects are essentially a collection of assets that make up a project or solution in Visual Studio.  These templates can be comprised of one or more projects.  In the initial release, the Solidity extension only had one project template, essentially for smart contract development.  With this release we have changed the extension to allow for multi-project templates.  This is core packaging feature change.

Smart Contract Project

This project’s purpose is for development of smart contracts including authoring, compiling and deployment from inside the IDE.

smart_contract

Decentralized ASP.Net Web Application

This project’s purpose is for not only the development of smart contracts but it also included a project for hosting the UI in the form of an ASP.Net MVC web application.  This is the initial introduction of this model and will be extended to include more samples.  The core idea here is to demonstrate to developers not only how to build smart contracts but also how to hook them up to an actual application.

aspnet

Decentralized Node Web Application

This project’s purpose is for not only the development of smart contracts but it also included a project for hosting the UI in the form of an nodejs express web application.  This is the initial introduction of this model and will be extended to include more samples.  The core idea here is to demonstrate to developers not only how to build smart contracts but also how to hook them up to an actual application.

node

Bug Fixes

And lastly, we have been busy slaying bugs that existed in the initial release.  Also, the feedback is much appreciated, both bugs and new ideas for how to make this tooling better.

  • Removed the README.html from loading automatically at startup for Smart Contract Projects.  The original intent of this was to inform the developer that they needed to run bloc in order to deploy smart contracts to a blockchain.  The manner in which is opened, was such that if the project was reloaded (which is triggered by lots of things), it will reload the readme.  This really affected developers that were trying to add this project to an existing solution or add existing projects to this solution.  We have removed this, as we have a blog post about how to set this up now.
  • Fixed issue where contracts created via New Item, were now compiling/deploying correctly.  The issue here was caused by an binary issue with the template used to create the smart contract via new item.  We have corrected this issue and this will now work with no issues.
  • Fixed bug where only one contract could be deployed in a single session.  This one is was simply caused by a caching issue inside the extension and has been resolved.
  • Improved error handling/messaging when bloc is not running.  In the initial release if bloc server was not running, the user would be a object not found issue.  We are handling these exceptions from bloc in a better way now, and the user will be messaged that bloc is having some problems, and where to start checking for problems.
  • Updated the extension to fix compatibility issues with blockapp-bloc endpoints.  There were some changes as this package evolves that the extension is now fully supported with.
  • Fixed bug where compiling smart contracts in subfolders was not outputting to the correct location.  They are all in the bin folder now.

More to follow

We will be publishing more updates in quicker timeframes going forward.  We already have a few new features queued up and in testing now, to be released shortly.  Again feedback in always welcome via comments to this site.

Comments (10)

  1. yaron says:

    Does it support 32 bit windows?

    1. Cale T says:

      Most of the extension is compliant with both architectures (x86 and x64), however the solc compiler that is used is 64bit only. This limits usage to only 64bit unfortunately.

  2. Amrik Singh Mahal says:

    I am using version 1.1.4.0 and template ‘Decentralized Node Web Application’.

    Getting error the project comes up. I am using Windows 10 and x64 with AMD processor.
    “A problem was encounters creating the sub project’WebApp’. The template specified cannot be found. Please check that the full path is correct.”

    Help Please.

    1. Cale T says:

      Can you ensure you have the nodejs tools for Visual Studio installed. We have this in the backlog to add detection to check for this but it currently doesn’t check. https://www.visualstudio.com/en-us/features/node-js-vs.aspx

      1. Amrik Mahal says:

        Thanks Cale. That worked. Moving forward on the POC.

  3. Amrik Mahal says:

    Hi,
    I am using version 1.1.4.0 and using Smart contract template. I am using Windows 10 and x64 with AMD processor.

    I am able to compile the default Payout.sol, but when i try to deploy i am getting the follow error. I have followed all the steps and started the block key server. However when i run the command “bloc start”, i dont get back any confirmation if the server has started. It hops to the next line without any response. I have tried deleting the testuser folder from under dev42 and dev4 but the error below keep on coming. Any suggestions ??

    Error Details below from Visual Studio output:
    Deployment to http://localhost:8000/ started!
    User used for deployment: testuser2
    User found: []
    Please check if keyserver is running. If keyserver is running and deploy is failing due to insufficient gas, delete the user folder on key server and a new user will automatically be created upon next contract deployment.

  4. LuizSilva says:

    Failing on deployment
    Create testuser with password testing using bloc genkey testuser and password testing

    Update visual studio properties BlockchainPassword with testing

    Visual Studio Console log says:
    Deployment to http://localhost:8000/ started!
    User used for deployment: testuser
    User: testuser created successfully
    User found: []

    Contract Payout created successfully at address invalid address or incorrect password
    Contract can be accessed here: http://localhost:8000/contracts/Payout/invalid address or incorrect password.html (default password: testing)

    From command prompt:
    c:\data\vs2015\Projects\BlockAppsSample\vsWalkthru (vsWalkthru@1.0.0)
    λ bloc genkey testuser
    prompt: Enter a high entropy password. You will need this to sign transactions.:
    wrote app\users\testuser\9e5465e3b52d9936919c64551b5a9b6d9756577c.json
    transaction successfully mined!

    c:\data\vs2015\Projects\BlockAppsSample\vsWalkthru (vsWalkthru@1.0.0)
    λ bloc start
    bloc is listening on http://0.0.0.0:8000

    api is pointed to http://strato-dev4.blockapps.net with profile strato-dev

    GET /users/ 200 36.039 ms – 24

    body: {“password”:”password”,”faucet”:”1″}

    hitting faucet for 754612dac81f2bdf1c001e10a82c8e303906a0be

    wrote: app\users\testuser\754612dac81f2bdf1c001e10a82c8e303906a0be.json

    POST /users/testuser 200 380.522 ms – 40

    GET /users/ 200 4.552 ms – 24

    contract as body is: undefined

    constructor arguments: undefined

    POST /users/testuser/[]/contract 200 11.883 ms – 37

    extension was matched: html

    c:\data\vs2015\Projects\BlockAppsSample\vsWalkthru (vsWalkthru@1.0.0)
    λ bloc start
    bloc is listening on http://0.0.0.0:8000

    api is pointed to http://strato-dev4.blockapps.net with profile strato-dev

    GET /users/ 200 45.563 ms – 24

    body: {“password”:”password”,”faucet”:”1″}

    hitting faucet for ead2170ea93de45946008ce4ccf5a963f36770ee

    wrote: app\users\testuser\ead2170ea93de45946008ce4ccf5a963f36770ee.json

    POST /users/testuser 200 323.768 ms – 40

    GET /users/ 200 4.063 ms – 24

    contract as body is: undefined

    constructor arguments: undefined

    POST /users/testuser/[]/contract 200 11.792 ms – 37

    extension was matched: html

    1. Cale T says:

      Yes, this looks the same issue as Compeador. There was a glitch with strato-dev4 (public strato instance) that probably caused your pain. Go into your the folder you created with bloc init and into the app subfolder and delete the users and meta folder and restart the bloc instance. Let me know if you see any further issues, but you should be good now.

      1. Eric says:

        I have exact the same issue. Have you been able to solve this?

        1. Cale T says:

          Hi Eric,

          Yep, same as with the others, the backend blockchain (http://strato-dev4.blockapps.net) is having some stability issues. Apologies we are getting this resolved, but no alternative but to create your own instance for now or use the TestDrive to get 2 hours for free. I will update the blog when the new server is ready.

          Thanks!
          Cale

Skip to main content