-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
[Blazor webassembly] library not working with linker disabled #358
Comments
Is this something which can be fixed by this library, or just as notification? |
I'm not really sure... at the end of the issue (this one mono/mono#12917) they speak about a PreserveDependencyAttribute which can be add to solve the problem but we have a lack of information. So if you understand what they speak about in the issue maybe you can make something but otherwise i will wait for more information. |
If that property solves the issue, that means that property should be defined in the calling application, cannot be defined in this project. I think... |
apparently the guys of mono back to us in the month to explain, we will see at this moment. |
Hi @julienGrd. You should be able to configure the linker for your library by embedding an XML linker config file into the library. I've put together a sample that shows how to do this here: https://github.com/danroth27/ComponentLibWithXmlLinkerConfig. Could you please try this out and see if it works for your scenario? |
Hi @danroth27 , thanks it seem work perfectly ! just an important thing to make it works, i have to add the file at the project but also edit the csproj to add this directive (like your project)
Is this file not impact other .NET standard type of project? because its not a blazor specific library ! @StefH : OK to add this to your project ? otherwise it seem i can make it directly on my client project |
All this is doing is embedded the XML linker config file into the assembly. This file will get picked up appropriately by the .NET IL linker wherever it gets used, including Xamarin apps and standalone .NET Core desktop apps. For apps that aren't using the linker this file is completely benign. In short, this file is not Blazor specific and is safe to add to any .NET Standard library. |
@danroth27 finally It seem not enough with this library. I fall into another problems when i try to use dynamic group by.
you will have this error :
What is strange, is im unable to reproduce this error when i reference the csproj of this project, its only when i reference the nuget package. @StefH : some idea on this ? |
@julienGrd Makes sense - the type initializer for |
Yes i was thinking was something like that, i still don't really understand how to use the linker :-/. i try both these configuration without make it work
|
@julienGrd |
ok it works perfect ! i will be happy to have some documentations about the linker when it will be possible ! @StefH if you still want include by default this configuration to make it works in mono projects without client configuration, i can suggest a PR. just reopen this issue and say me. |
@julienGrd Docs on how to configure the linker for libraries are in the works: dotnet/AspNetCore.Docs#17369 |
the final solution to make it works, on the library or on the client project
csproj
|
Please make a PR. |
perfect ! i will do this these next days ! |
And when this is done; I need to update the Wiki. Also: can you include a full working example blazor project? Place this in a new src-blazor folder. |
yes it's a good idea !Do you want some specific test in the blazor project ? or a simple dynamic order by on a table is OK for you ? |
Keep it simple. |
closing issue because PR is merged to master |
Hello and thanks for your work ! I use your library in one of my blazor webassembly project, but it seem not working when the linkler is disabled
You will find a reproduction project here : https://github.com/julienGrd/blazorWebassembly3.2Preview1
It seem this issue is related to this one on mono, if it can help : mono/mono#12917
if you disable the linker(in the webassembly csproj) there is no longer problem, but it's not a good thing and make the app bigger
thanks for your help !
The text was updated successfully, but these errors were encountered: