Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use C# to write a NEO smart contract, step 3 fail and no verbose message. #368

jphellemons opened this issue Jan 29, 2018 · 9 comments


Copy link

@jphellemons jphellemons commented Jan 29, 2018

There is no info how to debug this message, or common pitfalls etc.

1>------ Rebuild All started: Project: NeoContract1, Configuration: Debug Any CPU ------
1>  NeoContract1 -> C:\Users\myuser\Documents\Visual Studio 2017\Projects\NeoContract1\NeoContract1\bin\Debug\NeoContract1.dll
1>  Start NeoContract converter, Source File: C:\Users\myuser\Documents\Visual Studio 2017\Projects\NeoContract1\NeoContract1\bin\Debug\NeoContract1.dll
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Can I manually convert it using neon.exe in order to get a more verbose message? I did update nuget packages before running all the code. ps. the screenshot of the output of neon.exe is a lot more these days.

I also moved neoa, neoj and neon to .net standard 2.0 before build it. But somehow neon.exe outputs version 1.0.1 is that because it uses an outdated neon vm?

Copy link

@jphellemons jphellemons commented Jan 30, 2018 says I just had to reboot Windows and restart Visual Studio, but that did not fix it. Is there a commandline option for neon.exe to manually start the contract converter and get a more verbose error?

Copy link

@jphellemons jphellemons commented Jan 30, 2018

Manual run dotnet build:

NeoContract1.csproj(65,5): error MSB4062: The "Neo.ConvertTask" task could not be loaded from the assembly C:\Users\myuser\Documents\Visual Studio 2017\Projects\NeoContract1\NeoContract1\Neo.ConvertTask.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Het systeem kan het opgegeven bestand niet vinden. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

I've added the Microsoft.Build.Utilities.Core nuget but it's in the NEo.ConvertTask.dll and I do not know where that came from? It's probably output of the neo-compiler solution?

Copy link

@chenzhitong chenzhitong commented Feb 1, 2018

manually convert it using neon.exe

Copy link

@chenzhitong chenzhitong commented Feb 1, 2018

I guess the compilation failed because your neon version was too low, you should download the latest neon code to redistribute
The version of NeoContractPlugin will be consistent with neon and NeoVM, if inconsistent there may be a problem of failed compilation, or compilation pass but failure to run. @jphellemons

Copy link

@jphellemons jphellemons commented Feb 1, 2018

A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found

perhaps because I thought .net core 2 was forward compatible and I moved the neon project to 2.0

@jphellemons jphellemons closed this Feb 1, 2018
Copy link

@vimalvataliya vimalvataliya commented Feb 24, 2018

i get same error, can you please tell me the right solution for this.

Thank you.

Copy link

@bobio2018 bobio2018 commented Mar 9, 2018

@chenzhitong I ran into a similar build failure for ConvertTask

1>Using "ConvertTask" task from assembly "C:\Development\Tutorial\NeoContract\NeoContract\Neo.ConvertTask.dll".
1>Task "ConvertTask"
1>Done executing task "ConvertTask" -- FAILED.
1>Done building target "AfterBuild" in project "NeoContract.csproj" -- FAILED.
1>Build FAILED.

I run the compiler manually then it did generate neocontract.abi.json and neocontract.avm . I did download the latest the compiler from (Latest commit 9777729 on Jan 14)
below is my compiler version

Neo.Compiler.MSIL console app v2.0.3.1
need one param for DLL filename.

C:\Development\Tutorial\NeoContract\NeoContract\bin\Debug>neon.exe neocontract.dll
Neo.Compiler.MSIL console app v2.0.3.1
Find entrypoint:System.Void NeoContract.Contract1::Main()
convert succ
gen abi succ
Copy link

@BSathvik BSathvik commented Mar 13, 2018

I have the same exact problem. Any solutions ?

Copy link

@skkiran skkiran commented Apr 3, 2018

I had same issue. Restarting visual studio after adding "directory of neon.exe" into the PATH (as in section 3 of resolved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants