Fody / PropertyChanged

Injects INotifyPropertyChanged code into properties at compile time
MIT License
1.88k stars 227 forks source link

PropertyChanged.dll in .NET 5 - not in output of build OR Publish #715

Closed CorsairRO closed 3 years ago

CorsairRO commented 3 years ago

Where it is clear that the below content has not read, the issue is likely to be closed with "please read the template". Please don't take offense at this. It is simply a time management decision. When someone raises an issue, without reading the template, then often too much time is spent going back and forth to obtain information that is outlined below.

You should already be a Patron

It is expected that all developers using Fody either become a Patron on OpenCollective, or have a Tidelift Subscription. See Licensing/Patron FAQ for more information. With that in mind, it is assumed anyone raising an issue is already a Patron. As such your GitHub Id may be verified against the OpenCollective contributors. This process will depend on the issue quality, your circumstances, and the impact on the larger user base.

Preamble

Questions specific to IL manipulation should be placed on Stack Overflow or the Cecil Forum.

General questions about Fody or weavers should be placed on Stack Overflow or the Fody Gitter room

Where relevant, ensure you are using the current stable versions of the following:

Any code or stack traces must be properly formatted with GitHub markdown.

Describe the issue

I have 50+ nuget packages in my projects that i am starting now to move them to .NET 5.

ALL the others, respect my true setting in the .csproj file.

Than means, in the build of my project i have ALL required nuget dll's. Well, all except 1 ( PropertyChanged )

I tried to do a publish of my project like it is suggested in other item here. Same stuff, NOTHING goes in publish output.

I tried to manually add Fody Also in my project nuget deps. This doesnt change anything.

Is it a secretive stuff that the .dll is NOT included in the build at any time? How am i supposed to distribute my app that is using it? I tried to do a manual xcopy of it, but i dont think it is the correct way to do it. I mean, all the other packages works fine like that.

i;ve played with IncludeAssets / ExcludeAssets / PrivateAsssets in almost all combinations possible but it doesnt work...

Thank you

Minimal Repro

Ensure you have replicated the bug in a minimal solution with the fewest moving parts. Often this will help point to the true cause of the problem. Upload this repro as part of the issue, preferably a public GitHub repository, a failing unit test in a PR, or a downloadable zip. The repro will allow the maintainers of this project to smoke test the any fix.

Make an effort to fix the bug

Attempt to submit a Pull Request (PR) that fixes the bug. Include in this PR a test that verifies the fix. If you were not able to fix the bug, a PR that illustrates your partial progress will suffice. If you prefer someone else fix this bug for you, please donate to the Fody OpenCollective and include a note to that effect in this issue.

SimonCropp commented 3 years ago

did i you read the issue template?

CorsairRO commented 3 years ago

Hello, Yes, i've read the template. My issue is NOT a fody issue or an IL issue. It is just a potential bug with PropertyChanged in itself. What's the idea of it being a nuget package if it is the only one from my list that doesnt get copied to output under any circumstances?

Minimal repro steps: Create a .NET 5 project. I added PropertyChanged to it. Build the project. No dll in the output. Publish project => No dll in the output.

Added 30+ nuget packages ( diverse scopes and usages ). Set CopyLocalLockAssembliesToOutput in csproj. All of them are copied, propertychanged is not.

After i added Fody as a Specific nuget package to my project, PropertyChanged Finally got into the output of the Publish. Still not on Build. Why do i need to add explicitly Fody as it is already in deps of PropertyChanged.

Target: .NET 5 Windows PropertyChanged: 3.3.0 Fody: 6.4.0 VS 2019 16.9.2

thank you and sorry if i understood something wrong from the template

tom-englert commented 3 years ago

PropertyChanged.dll is only needed at compile time and it is intended that it is not copied to the output folder.

pipe01 commented 3 years ago

When running an application that uses this package on a fresh Windows machine I get this error:

Error:
  An assembly specified in the application dependencies manifest (Kantoku.Master.deps.json) was not found:
    package: 'PropertyChanged.Fody', version: '3.3.1'
    path: 'lib/netstandard2.0/PropertyChanged.dll'

Is there any way to tell the build system not to add this library to the deps.json file?

tom-englert commented 3 years ago

PrivateAssets=All should do the job, just follow the warnings in your build...

pipe01 commented 3 years ago

That was already added by default, turns out I also had to add ExcludeAssets="runtime". Thank you regardless!