Giter VIP home page Giter VIP logo

Comments (11)

devhawk avatar devhawk commented on June 29, 2024 1

The point here is to make the smart contract build process as natural and familiar to the C# developer as humanly possible.

from neo-devpack-dotnet.

devhawk avatar devhawk commented on June 29, 2024

Quick check in the debugger, ModuleConverter.TryInsertMethod is receiving a null Cecil MethodDefinition instance. ModuleConverter._ConvertCall is failing to resolve the method reference to Neo.SmartContract.Framework.Services.Neo.Storage::Put, but the resolve call is inside a try/catch block that swallows the exception, leading to the null ref exception down the line in TryInsertMethod

from neo-devpack-dotnet.

lightszero avatar lightszero commented on June 29, 2024

I make some test.I think it is not a bug.

When we build "dotnet framework" project, the depend dll like Neo.SmartContract.Framework.dll will be copy to same path.
but build "dotnet standard" project,will not copy that file

when we build a "dotnet framework" project we will got

HelloWorld.dll
HelloWorld.pdb
Neo.SmartContract.Framework.dll

3 files

when we build a "dotnet standard" project we will got

HelloWorld.dll
HelloWorld.pdb

2 files

we will got a error when neon build avm because miss file:Neo.SmartContract.Framework.dll

I add a standard project with a neo.smartcontract.framework.dll
https://github.com/neo-project/examples/tree/Branch_helloword_standard/csharp/helloworld_stand

and neon build succ

another way is use “dotnet publish” for netstandard project

from neo-devpack-dotnet.

lightszero avatar lightszero commented on June 29, 2024

I will try to make a better error info in this situation.

from neo-devpack-dotnet.

devhawk avatar devhawk commented on June 29, 2024

Nice to know it's a simple issue. However, instead of forcing the developer to copy the dependency, can we check the nuget global package folder first? https://docs.microsoft.com/en-us/nuget/Consume-Packages/managing-the-global-packages-and-cache-folders

Also, the .deps.json file will contain the path within the global package folder. For example, on my windows machine the global package folder is C:\Users\harry.nuget\packages. The .deps.json file has the following JSON data in the targets object:

"Neo.SmartContract.Framework/2.9.3": {
  "dependencies": {
    "NETStandard.Library": "2.0.3"
  },
  "runtime": {
    "lib/netstandard1.6/Neo.SmartContract.Framework.dll": {
      "assemblyVersion": "2.9.3.0",
      "fileVersion": "2.9.3.0"
    }
  }
},

Sure enough, the path to the DLL on my machine is "C:\Users\harry.nuget\packages\neo.smartcontract.framework\2.9.3\lib\netstandard1.6\Neo.SmartContract.Framework.dll"

from neo-devpack-dotnet.

lightszero avatar lightszero commented on June 29, 2024

@devhawk
use “dotnet publish” for netstandard

from neo-devpack-dotnet.

lock9 avatar lock9 commented on June 29, 2024

I think that this is working. Can you check @devhawk ? At least I tested with #131 and it worked fine using .net standard. Thanks.

from neo-devpack-dotnet.

devhawk avatar devhawk commented on June 29, 2024

Yes, I was able to compile the hello world contract to NEF from build artifacts alone using master branch of this repo. Can we port this back to master-2.x branch?

from neo-devpack-dotnet.

shargon avatar shargon commented on June 29, 2024

Which was exactly the change for allow this?

from neo-devpack-dotnet.

lock9 avatar lock9 commented on June 29, 2024

@shargon can we port #131 to 2.x?

from neo-devpack-dotnet.

shargon avatar shargon commented on June 29, 2024

Yes, I will

from neo-devpack-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.