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

NCCS: TargetInvocationException empty InitialValue #795

Open
cschuchardt88 opened this issue Sep 30, 2023 · 1 comment
Open

NCCS: TargetInvocationException empty InitialValue #795

cschuchardt88 opened this issue Sep 30, 2023 · 1 comment

Comments

@cschuchardt88
Copy link
Member

cschuchardt88 commented Sep 30, 2023

Having empty string in InitialValue attribute crashes the compiler

This Crashes

[InitialValue("", Neo.SmartContract.ContractParameterType.Hash160)]

This does not

[InitialValue("NgiALPHzer4fMTBdkHTNVwHA4ApA5dp554", Neo.SmartContract.ContractParameterType.Hash160)]

Exception Log

dotnet nccs "LoomsTokenContract.csproj"
1>      Determining projects to restore...
1>      All projects are up-to-date for restore.
1>    Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
1>     ---> System.FormatException: One of the identified items was in an invalid format.
1>       at Neo.Cryptography.Base58.Base58CheckDecode(String input)
1>       at Neo.Wallets.Helper.ToScriptHash(String address, Byte version)
1>       at Neo.Compiler.MethodConvert.ProcessFieldInitializer(SemanticModel model, IFieldSymbol field, Action preInitialize, Action postInitialize) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/MethodConvert.cs:line 323
1>       at Neo.Compiler.MethodConvert.ProcessStaticFields(SemanticModel model) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/MethodConvert.cs:line 254
1>       at Neo.Compiler.MethodConvert.Convert(SemanticModel model) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/MethodConvert.cs:line 156
1>       at Neo.Compiler.CompilationContext.ConvertMethod(SemanticModel model, IMethodSymbol symbol) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/CompilationContext.cs:line 524
1>       at Neo.Compiler.CompilationContext.ProcessMethod(SemanticModel model, IMethodSymbol symbol, Boolean export) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/CompilationContext.cs:line 504
1>       at Neo.Compiler.CompilationContext.ProcessClass(SemanticModel model, INamedTypeSymbol symbol) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/CompilationContext.cs:line 471
1>       at Neo.Compiler.CompilationContext.ProcessMemberDeclaration(HashSet`1 processed, SemanticModel model, MemberDeclarationSyntax syntax) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/CompilationContext.cs:line 409
1>       at Neo.Compiler.CompilationContext.ProcessMemberDeclaration(HashSet`1 processed, SemanticModel model, MemberDeclarationSyntax syntax) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/CompilationContext.cs:line 405
1>       at Neo.Compiler.CompilationContext.ProcessCompilationUnit(HashSet`1 processed, SemanticModel model, CompilationUnitSyntax syntax) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/CompilationContext.cs:line 396
1>       at Neo.Compiler.CompilationContext.Compile() in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/CompilationContext.cs:line 128
1>       at Neo.Compiler.CompilationContext.CompileProject(String csproj, Options options) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/CompilationContext.cs:line 251
1>       at Neo.Compiler.Program.ProcessCsproj(Options options, String path) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/Program.cs:line 119
1>       at Neo.Compiler.Program.Handle(RootCommand command, Options options, String[] paths, InvocationContext context) in /home/runner/work/neo-devpack-dotnet/neo-devpack-dotnet/src/Neo.Compiler.CSharp/Program.cs:line 75
1>       at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
1>       at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
1>       --- End of inner exception stack trace ---
1>       at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
1>       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
1>       at System.Delegate.DynamicInvokeImpl(Object[] args)
1>       at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
1>       at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.Invoke(InvocationContext context)
1>       at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
1>    --- End of stack trace from previous location ---
1>       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
1>    --- End of stack trace from previous location ---
1>       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
1>    --- End of stack trace from previous location ---
1>       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
1>    --- End of stack trace from previous location ---
1>       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
1>    --- End of stack trace from previous location ---
1>       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
1>    --- End of stack trace from previous location ---
1>       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
1>    --- End of stack trace from previous location ---
1>       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
1>    --- End of stack trace from previous location ---
1>       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
1>    C:\Users\Chris\Projects\cschuchardt88\neo-looms\src\LoomsTokenContract\LoomsTokenContract.csproj(9,5): error MSB3073: The command "dotnet nccs "LoomsTokenContract.csproj"" exited with code 1.
@cschuchardt88 cschuchardt88 changed the title Unhandled exception: System.Reflection.TargetInvocationException NCCS: TargetInvocationException empty InitialValue Sep 30, 2023
@shargon
Copy link
Member

shargon commented Oct 2, 2023

System.FormatException: One of the identified items was in an invalid format.

I think that the error was sent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants