GithubHelp home page GithubHelp logo

Comments (11)

kant2002 avatar kant2002 commented on August 15, 2024 1

Sorry, it was my mistake. See 797396d

If you want fetch, I assume you need to add new type here
https://github.com/kant2002/WinFormsComInterop/blob/main/samples/BlazorHybrid/rd.xml

And maybe some additional things for HttpClient, you have to test. Unfortunately currently Blazor Hybrid require such laborious work.

from winformscominterop.

Martin12350 avatar Martin12350 commented on August 15, 2024 1

Oh my... I was banging my head on the keyboard, I tried to create a new project from scratch, changing properties, versions, etc.
And it was yelling the whole time "failed to load assembly", just because it was missing one word.
Thank you for the fix :)

from winformscominterop.

kant2002 avatar kant2002 commented on August 15, 2024

Don't worry. That's normal situation, this thing a bit complicated to learn from first stab. Take your time, I bet NativeAOT eventually make your app small !

from winformscominterop.

Martin12350 avatar Martin12350 commented on August 15, 2024

I really like the idea of native AOT and their advantages. The only problem now is that a lot of things are not supported yet or need a lot of tweaking. Which leads me to another question - not sure if I should write here, spin another thread, or maybe discuss on another platform (Discord maybe?). Anyway, I will try.

Is it possible to deploy it as a single file? PublishSingleFile and NativeAOT properties cannot be used together.
Publishing now results in one .exe, few DLLs (found out that only webview2loader.dll is needed) and wwwroot folder.
I was able to embed the wwwroot inside the app, however this bug appeared #1333 issue, I peeked into .exe copied the manifest, fixed the error and manually forced it back in the app.
It obviously works, but it is tedious, and I cannot imagine doing all the time over when adding some new files.

Maybe I want a lot of things ;)

from winformscominterop.

Martin12350 avatar Martin12350 commented on August 15, 2024

Found out solution for the #1333 issue.
For those who would like to embed wwwroot into the application, it is necessary to add those lines in the .csproj

<ItemGroup>
  <EmbeddedResource Update="MainForm.resx" ExcludeFromManifest="true" />
</ItemGroup>

Big help from this thread #31107

The final step is to figure out if it is possible to embed all those dlls :)

from winformscominterop.

kant2002 avatar kant2002 commented on August 15, 2024

So you embed whole wwwroot, that's really nice. Regarding single file and NativeAOT. As you probably figure out that's mutually exclusive things. And what even Single file means for NativeAOT, some "magic" packer? it would not work. NativeAOT in a sense alreade single file.

from winformscominterop.

Martin12350 avatar Martin12350 commented on August 15, 2024

I fell into the rabbit hole. Even the name PublishSingleFile is not truly a single file, and more or less dlls are there (depending on the project size, obviously). But with combination IncludeNativeLibrariesForSelfExtract publishing will result in really only one single file. And I would like to achieve the same or similar with AOT. To have only one single file. But so far, no luck.

from winformscominterop.

kant2002 avatar kant2002 commented on August 15, 2024

You have to package that in single file yourself. This scenario does not supported.

from winformscominterop.

Martin12350 avatar Martin12350 commented on August 15, 2024

Yep, I thought that. But do you have some guide or something to steer me the right way?
Should I embed it the same way as the folder? Or used something like ILmerge? Would Costura.Fody work?
What is the way to go?

from winformscominterop.

kant2002 avatar kant2002 commented on August 15, 2024

I would try to look at https://github.com/MichalStrehovsky/PublishAotCompressed . I think your solution lays in unmanaged land of different kind of packers like UPX or something like that. Fody is for managed assemblies, but you want to pack unmanaged DLL into your EXE.

from winformscominterop.

Martin12350 avatar Martin12350 commented on August 15, 2024

Will definitely try and check. Thanks a lot for your help :)

from winformscominterop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.