Azure / Azure/DotNetty

DotNetty .net7.0 published Aot ok, but error to run examples/Echo.Server

Open
#600 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.3k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

(1) I changed all the dotnetty .csproj files
changed TargetFrameworks to net7.0
added PublishAot

` `
` Exe `
` net7.0 `
` false `
` Debug;Release;Package `
` AnyCPU`
` true`
` `

(2) Compiled examples/Echo.Server as debug / release version, run Echo.Server.exe, everything was OK
OK

appsettings.json
{
"ssl": "false",
"port": "28007",
"libuv": "false"
}

(3) Published the project win-x64 OK.
But there was error to run the Echo.Server.exe

[F:\github\DotNetty\examples\Echo.Server\publish]$ Echo.Server.exe
Unhandled Exception: System.AggregateException: One or more errors occurred. (Exception has been thrown by the target of an invocation.)
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.TypeInitializationException: A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property.
---> System.ArgumentNullException: Value cannot be null.
at Internal.Reflection.Extensions.NonPortable.CustomAttributeInheritanceRules.GetMatchingCustomAttributes(MemberInfo, Type, Boolean, Boolean) + 0x1af
at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](MemberInfo, Boolean) + 0x2f
at DotNetty.Transport.Channels.AbstractChannelHandlerContext.IsSkippable(Type, String, Type[]) + 0x9e
at DotNetty.Transport.Channels.AbstractChannelHandlerContext.CalculateSkipPropagationFlags(Type) + 0x2c
at DotNetty.Transport.Channels.DefaultChannelPipeline.TailContext..cctor() + 0x4f
at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0xc6
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0x167
at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstructionReturnGCStaticBase(StaticClassConstructionContext*, Object) + 0xd
at DotNetty.Transport.Channels.DefaultChannelPipeline..ctor(IChannel) + 0x3d
at DotNetty.Transport.Channels.AbstractChannel.NewChannelPipeline() + 0x23
at DotNetty.Transport.Channels.AbstractChannel..ctor(IChannel) + 0x83
at DotNetty.Transport.Channels.Sockets.AbstractSocketChannel..ctor(IChannel, Socket) + 0x1a
at DotNetty.Transport.Channels.Sockets.TcpServerSocketChannel..ctor() + 0x3a
at System.Activator.CreateInstance[T]() + 0x39
--- End of inner exception stack trace ---
at System.Activator.CreateInstance[T]() + 0xb7
at DotNetty.Transport.Bootstrapping.AbstractBootstrap`2.<>c__10`1.b__10_0() + 0x22
at DotNetty.Transport.Bootstrapping.AbstractBootstrap`2.d__27.MoveNext() + 0x4d
--- End of stack trace from previous location ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb6
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x42
at DotNetty.Transport.Bootstrapping.AbstractBootstrap`2.d__26.MoveNext() + 0xbb
--- End of stack trace from previous location ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb6
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x42
at Echo.Server.Program.d__0.MoveNext() + 0x38e
--- End of stack trace from previous location ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
at Echo.Server.Program.d__0.MoveNext() + 0x536
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32, CancellationToken) + 0xc5
at Echo.Server!+0x332125

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.