deadlydog

Saskatchewan, Canada

http://www.danskingdom.com

Developer and family man. Loves C#, .NET, XNA, PowerShell, AutoHotkey. Creator of DPSF (XNAParticles.com). Automate Everything!

Website: danskingdom.com

Blog: blog.danskingdom.com

Twitter: @deadlydog

Oct
11
comment Switch back to packages.config - clarification on answer
@zivkan using nuget pack wasn't mentioned in the original question or your answer. Looking now I see that you guys did discuss it in the comments. I was simply responding the question you asked in your answer of, why someone might want to revert back to packages.config; It not working with outdir is a reason. I just wanted to make you aware of that shortcoming. I'm not going to create a new question; we've simply decided not to use PackageReference for slns using outdir. Thanks.
Oct
9
comment Switch back to packages.config - clarification on answer
Hey @zivkan, an example of where the PackageReference format doesn't work is when using outdir with MSBuild. With outdir all assemblies from all projects end up in the same directory. If Project A references v2 of NuGet Package X, and Project B references NuGet Package Y which has a dependency on v1 of NuGet Package X, then I may end up with v1 of NuGet Package X copied to my output directory. Since 2nd-hand dependencies are omitted in the PackageReference format, I cannot specify that Project B should use v2 of Package X like I can with packages.config. An edge case that we have :(
Oct
9
comment Switch back to packages.config - clarification on answer
On VS 2019 (v16.3.2) I had to restart Visual Studio after step 1 for it to recognize the change and prompt me for the format selection when installing the first package.
Oct
8
comment Create Non-Nullable Types in C#
In case that link goes offline, the code you need to add to your .csproj file to enable nullable reference types is: <LangVersion>8.0</LangVersion> <NullableReferenceTypes>true</NullableReferenceTypes>
Sep
24
awarded Popular Question
Sep
21
comment How to unit test a PowerShell Core binary cmdlet in C#
Thanks for pointing me in the right direction! I've also blogged about the process of creating and testing PowerShell Core cmdlets in C# at blog.danskingdom.com/…
Sep
19
answered PowerShell pscmdlet unit testing with C#
Sep
12
accepted How to unit test a PowerShell Core binary cmdlet in C#
Sep
12
comment Why is the Visual Studio 2015/2017/2019 Test Runner not discovering my xUnit v2 tests
For some reason I had to use the keyboard shortcut to run all tests (Ctrl+R,A) before the Test Explorer would recognize my tests. For some reason clicking the Run All button with the mouse wouldn't find any tests.
Aug
13
awarded Nice Answer
Jul
31
awarded Great Answer
Jul
30
awarded Necromancer
Jul
22
awarded Good Answer
Jul
11
revised How to unit test a PowerShell Core binary cmdlet in C#
Updated to mention that it works when using .Net Framework instead of .Net Core
Jun
25
comment How to unit test a PowerShell Core binary cmdlet in C#
Thanks @JonathanGilbert. It looks like that is using RunspaceConfiguration which has a dependency on the Microsoft.PowerShell.5.ReferenceAssemblies NuGet package, which is not using .Net Standard; it requires at least .Net Framework 4.6.1, and thus is not cross-platform compatible. I guess it's not the end of the world, since I would only need to include the reference in my unit test project, but I would still like to find a truly cross-platform solution to this problem so I can run unit tests on non-Windows machines/containers.
Jun
22
awarded Yearling
Jun
22
awarded Yearling
Jun
21
revised How to unit test a PowerShell Core binary cmdlet in C#
added 48 characters in body
Jun
21
revised How to unit test a PowerShell Core binary cmdlet in C#
Added PowerShell test results
Jun
21
asked How to unit test a PowerShell Core binary cmdlet in C#
1 2 3 4 5