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

Unable to use DynamicClassFactory.CreateType from Blazor WebAssembly #516

Closed
Matthewsre opened this issue Jun 7, 2021 · 6 comments
Closed
Assignees
Labels

Comments

@Matthewsre
Copy link

1. Description

Unable to use DynamicClassFactory.CreateType from Blazor WebAssembly.

2. Exception

Exception message: 'The method or operation is not implemented.'
Stack trace:
   at System.RuntimeType.MakeGenericType(Type[] instantiation)
   at System.Linq.Dynamic.Core.DynamicClassFactory.CreateType(IList`1 properties, Boolean createParameterCtor)

3. Fiddle or Project

Simple example Blazor page to repro:

@page "/dynamic"

@using System.Linq.Dynamic.Core

@code {
    protected override Task OnInitializedAsync()
    {
        var dynamicProperties = new List<DynamicProperty>();
        dynamicProperties.Add(new DynamicProperty("Name", typeof(string)));

        try
        {
            var model = DynamicClassFactory.CreateType(dynamicProperties);
        }
        catch (Exception exception)
        {
            throw;
        }

        return Task.CompletedTask;
    }
}

Exception screenshot:

image

4. Any further technical details

Using .Net 5 Blazor WebAssembly, can provide more details it needed. Not sure if there are workaround options or if this is something that needs to be addressed in the underlying runtime used for WebAssembly.

@StefH StefH self-assigned this Jun 8, 2021
@StefH
Copy link
Collaborator

StefH commented Jun 9, 2021

#518

@StefH
Copy link
Collaborator

StefH commented Jun 9, 2021

@Matthewsre
Copy link
Author

@Matthewsre

Can you please try 11-preview-01 from https://www.myget.org/feed/system-linq-dynamic-core/package/nuget/System.Linq.Dynamic.Core ?

@StefH,

Just walked through the code with the preview package from your feed and it worked as expected.

Thank you so much for providing a fix so quickly on this! :)

How long until I might expect an updated package on NuGet.org so I don't have to change the build pipelines?

@StefH
Copy link
Collaborator

StefH commented Jun 10, 2021

I still need to verify another PR and review some other issues.

Would it help you if I would publish this version to the normal NuGet ?

@StefH StefH closed this as completed Jun 20, 2021
@Matthewsre
Copy link
Author

@StefH , Sorry for the late follow up, it would be very helpful if you were able to push the preview version to the normal NuGet. :)

@StefH
Copy link
Collaborator

StefH commented Jul 19, 2021

@Matthewsre
Official version 11 has been updated to NuGet.

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

No branches or pull requests

2 participants