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

Console app probem: PlatformNotSupportedException #742

Closed
mariorancic01 opened this issue Mar 5, 2024 · 3 comments
Closed

Console app probem: PlatformNotSupportedException #742

mariorancic01 opened this issue Mar 5, 2024 · 3 comments
Labels
stale stale not updated issue & pr

Comments

@mariorancic01
Copy link

I was using services very successfully in Wpf app, now when i need to use the same client in my console app i got exception :
The type initializer for 'MagicOnion.Client.DynamicClient.DynamicClientBuilder`1' threw an exception.'
PlatformNotSupportedException: Dynamic code generation is not supported on this platform.

Here is the same code i used in WPF APP:
var channel = GrpcChannel.ForAddress("myAddress");
var proxy = MagicOnionClient.Create(channel)!;

@mariorancic01
Copy link
Author

i found solution to my own problem. I just needed to set PublishAot parameter to false instead of true

Copy link
Contributor

github-actions bot commented Sep 6, 2024

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale stale not updated issue & pr label Sep 6, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2024
@flier268
Copy link

flier268 commented Jan 9, 2025

How do I fix that? I want to use AOT
@mayuki

System.PlatformNotSupportedException: Dynamic code generation is not supported on this platform.
   at System.Reflection.Emit.AssemblyBuilder.ThrowDynamicCodeNotSupported()
   at System.Reflection.Emit.AssemblyBuilder.EnsureDynamicCodeSupported()
   at System.Reflection.Emit.AssemblyBuilder.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, IEnumerable`1 assemblyAttributes, Assembly callingAssembly)
   at MagicOnion.Server.Glue.MagicOnionGlueService.CreateType()
   at Microsoft.Extensions.DependencyInjection.MagicOnionServicesExtensions.AddMagicOnionCore(IServiceCollection services, Action`1 configureOptions)
   at Microsoft.Extensions.DependencyInjection.MagicOnionServicesExtensions.AddMagicOnion(IServiceCollection services, Action`1 configureOptions)
   at Program.<Main>$(String[] args) in E:\Projects\Company_Projects\TeraSync\TeraSync.Service\Program.cs:line 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale stale not updated issue & pr
Projects
None yet
Development

No branches or pull requests

2 participants