-1

Some years ago I used Costura.Fody and it worked after the installation via NuGet perfectly. Yesterday I tried it at home, and got first the error, that Fody is missing (I just installed Fody via NuGet). Then I was missing the FodyWeavers.xml, which I created as in another post mentioned. Afterwards it wokred fine for me, I just had to start debugging and the dll's would be included in the exe. Today I wanted to do the same at work, so I installed Costura.Fody, but this time Fody was installed with it as well. As a result I got two errors:

First: Could not find a weaver named 'PropertyChanged'

Second: FodyWeavers.xml is missing

I installed PropertyChanged.Fody and created the FodyWeavers File. Now I can run my application, but the dll's are not embedded.

A few years ago I used Win7 + VS Community 15

At home: Win 10 + VS 15

At work: Win7 + VS Community 15

Please help :(

EDIT

I tried soooooo many approaches but I coudln't make it work. I managed to find a blogpost which let's me embedded the dll's in the exe without 3rd party libraries. I can highly recommend to use this instead of Costura, because it seems several People online have now a Problem with this library

Link to my <3 http://adamthetech.com/2011/06/embed-dll-files-within-an-exe-c-sharp-winforms/

Best regards!

Shmosi
  • 322
  • 2
  • 17
  • What targer framework are you using? I ask because fody is no longer supported in net45 (though it will install via nuget if multi targeting) and you haven't mentioned which you are using – pinkfloydx33 Sep 05 '18 at 09:20
  • @pinkfloydx33 I am using 4.6.1 but I created a new Project with framework 4. Long story short: Fody didn't install (I did in manually), the FodayWeavers File was missing (for anyone who is struggling with this: YOU have to create this file because of Microsoft restrictions) and then PropertyChanged.Fody was missing. I wanted to intall it, but it needs at least Framework 4.5.2 – Shmosi Sep 05 '18 at 09:49

1 Answers1

0

Probably you need to extract your application's starting point to new project, as fody cannot embedd resources located in your starting project. In other words, add new project that has no resources and start your app from there

J. Krz
  • 56
  • 4
  • I tried but it's still not working. The program starts but the dll's are not included... – Shmosi Sep 05 '18 at 09:57
  • @Shmosi you need to extract ONLY application startup, leave resources files in your older project. It would go sth like this: Foo project containing resources and Fody's starting point -> Foo project containing resources|Bar project containing app's starting point without resources. I hope this helps – J. Krz Sep 07 '18 at 10:41
  • Thanks for the update, I didn't manage to work with Costura (and I'll never try again for sure), but I could achieve what I want through my own code and not through some package. I'm gonna update my question regarding this – Shmosi Sep 07 '18 at 10:44