Skip to content

Commit

Permalink
Update getting-started-csharp.md (neo-project#288)
Browse files Browse the repository at this point in the history
Fixing grammar. Also added a tip regarding the missing dll when trying to use neon.
  • Loading branch information
chrisflor authored and Celia18305 committed Jan 8, 2018
1 parent 348090c commit f16c472
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions en-us/sc/getting-started-csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ typora-root-url: ..\..

### How to use C# to write an NEO smart contract

We currently recommend C# for developing smart contracts (though we support or plan to support Java, Kotlin, Go, C/C++, Python, JavaScript and other programming languages)
We currently recommend C# for developing smart contracts (though we support or plan to support Java, Kotlin, Go, C/C++, Python, JavaScript and other programming languages).

This section contains a short tutorial that guides you in configuring the C# development environment for NEO smart contracts and gives you an idea of ​​how to create a smart contract project and how to compile it.
This section contains a short tutorial that guides you in configuring the C# development environment for NEO smart contracts. It also gives you an idea of ​​how to create a smart contract project and how to compile it.

   > [!Note]
   > At present, all the projects have been upgraded to the Visual Studio 2017 version, if you want to use Visual Studio 2015 to create intelligent contracts can refer to [how to use C # to write NEOs intelligent contract for VS2015](getting-started-2015.md)
   > At present, all the projects have been upgraded to the Visual Studio 2017 version. If you want to use Visual Studio 2015 to create intelligent contracts, refer to [how to use C # to write NEOs intelligent contract for VS2015](getting-started-2015.md).

## Development Tools

Expand All @@ -21,7 +21,7 @@ Download and install:

[Visual Studio download address](https://www.visualstudio.com/products/visual-studio-community-vs)

The installation process is very simple, follow the operation prompts step-by-step, it should be noted that you need to check the installation of `.NET Core cross-platform development`, otherwise you will not be able to open neo-vm project in step #3. The installation takes about ten minutes or up to an hour.
The installation process is very simple, just follow the operation prompts step-by-step. It should be noted that you need to check the installation of `.NET Core cross-platform development`, otherwise you will not be able to open neo-vm project in step #3. The installation takes about ten minutes or up to an hour.

![install net core cross-platform development toolset](/assets/install_core_cross_platform_development_toolset.png)

Expand All @@ -37,7 +37,7 @@ Open Visual Studio 2017, open Tools, click on Extensions and Updates, click on t

Installation and configuration steps:

Download the [neo-compiler](https://github.com/neo-project/neo-compiler) project on Github, open the solution with Visual Studio 2017, publish the neon project,
Download the [neo-compiler](https://github.com/neo-project/neo-compiler) project on Github, open the solution with Visual Studio 2017, and publish the neon project

![publish NEO compiler msil project](/assets/publish_neo_compiler_msil_project.png)

Expand Down Expand Up @@ -65,20 +65,20 @@ We now need to add this directory to our execution path. The PATH is the system

![edit environmental variables](/assets/edit_environmental_variables.png)

Now run Command or PowerShell, and enter neon.exe. If there is no error and the output shows the version number (as shown) the environment variable configuration is successful
Now run Command or PowerShell, and enter neon.exe. If there is no error and the output shows the version number (as shown), then the environment variable configuration is successful.

![powershell enviornment variabled updated correctly](/assets/powershell_enviornment_variabled_updated_correctly.png)


NOTE. Windows 7 SP1 users might encounter an error "Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'api-ms-win-core-console-l2-1-0.dll': The specified module could not be found". The required 'api-ms-win-core-console-l2-1-0.dll' file is only found in Windows 8 or later versions. This error can be resolved by obtaining a copy of 'api-ms-win-core-console-l2-1-0.dll' and putting it in the directory C:\Windows\System32.
NOTE. Windows 7 SP1 users might encounter an error "Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'api-ms-win-core-console-l2-1-0.dll': The specified module could not be found". The required 'api-ms-win-core-console-l2-1-0.dll' file is only found in Windows 8 or later versions. This error can be resolved by obtaining a copy of 'api-ms-win-core-console-l2-1-0.dll' and putting it in the directory C:\Windows\System32. This dll can be found in other folders on your computer(search it, then copy it to \System32), or alternatively found online.

## Create project

After the above installation configuration is successful, you can create an NeoContract project in Visual Studio 2017.
After the above installation configuration is successful, you can create a NeoContract project in Visual Studio 2017.

![new smart contract project](/assets/new_smart_contract_project.png)

Once you create a project, it will automatically generate a C# file, the default class inherited from the SmartContract, as shown in the following:
Once you create a project, it will automatically generate a C# file. The default class which inherits the SmartContract is shown in the following:

![smart contract function code](/assets/smart_contract_function_code.png)

Expand All @@ -97,7 +97,7 @@ public class Contract1: SmartContract
}
```

After you compiled it successfully, you will see` SmartContract1.avm` in the `bin/Debug` directory, which is the file that is generated as the NEO smart contract.
After you compiled it successfully you will see` SmartContract1.avm` in the `bin/Debug` directory, which is the file that is generated as the NEO smart contract.

![compile smart contract](assets/compile_smart_contract.png)

Expand Down

0 comments on commit f16c472

Please sign in to comment.