Turn2Jesus2
✅ How to copy an EXE from a NuGet package in SDK-style project with PackageReference?
In the old msbuild format, I was including a nuget package that distributed an EXE file among other things. In the Content include, we referenced back to the exe using relative pathing ..\packages\my.exe and used Link to place it in the build output. How do I do that in PackageReference world?
This is my old msbuild-style project content include where it worked
It copied the EXE file to the bin directory, where I want it
packages.config
However, now, it's in SDK-style format and I can't figure out how to include it.
How should I solve this?
2 replies
Immutable Service Options
I have a service which mutates its options. I discovered that IOptions<T> creates a singleton and all of the unit tests I'm running all get the same options but unrelated services are mutating the options and other services are seeing those changes.
I'd like to have a simple solution that would ensure the options are not mutated and should something try to, it breaks or doesn't compile or whatever.
If there's a simple solution, what is it?
Someone in the chat yesterday mentioned something about IImmutable, but I don't know the specifics.
I saw something about an ImmutableDictionary, but I'd like the whole class to be.
Ideas?
I kind of think this should be a standard of some sort.
14 replies