pamidur / aspect-injector

AOP framework for .NET (c#, vb, etc)
Apache License 2.0
745 stars 112 forks source link

Why i have so many DLLs file in Debug folder? #86

Closed prixodkooleg0 closed 5 years ago

prixodkooleg0 commented 5 years ago

It is super project, Thank you. I used version 1.0.1 was ok. Now i try lastest version and have all framework dlls in debug folder. How can i fix this? i am using MVS2017.

pamidur commented 5 years ago

I suspect you're not using TFM that directly supports netstandard2.0. Can you me please what framework you target?

pamidur commented 5 years ago

net461 image net471 image

pamidur commented 5 years ago

Ok, so here is the explanation: Since 2.0 we keep the runtime reference to AspectInjector.Broker.dll. And since it depends on netstandard2.0 it requires those assemblies to work. However those assemblies only appear in your output folder if your target framework doesn't support netstandard2.0 directly (not through shim).

So the solution is to use either >= net471 or >=netcoreapp2.0

https://stackoverflow.com/questions/47184230/large-number-of-assemblies-in-net461-output-folder-when-building-net-framework

prixodkooleg0 commented 5 years ago

Using framework 4.7.2 helps. Thank you very much. And program steel donot need AspectInjector.Broker.dll after build?( i must copy only .exe file?)

pamidur commented 5 years ago

This the whole point here -> AspectInjector.Broker.dll is now required.

This is done for better compatibility, for ease reusing aspects into other assemblies and for other features in future. The drawback is that you need this dll to be alongside your exe.

If you desperately need not AspectInjector.Broker.dll in your bin could you please describe your use cases? We might consider return this 'referenceless' feature as an option in upcoming releases.

prixodkooleg0 commented 5 years ago

I am set donot copy to AspectInjector.Broker.dll and then copy exe file to another folder and it is works.

pamidur commented 5 years ago

Well no problem with that. I'm glad it works for you, just be aware it works until you try to get custom attributes on your classes.

pamidur commented 5 years ago

Closed. Feel free to reopen if needed.