Forum member

Silvenga

40 posts

Posts by Silvenga

  1. Build fails if SourceGenerator project has a package reference.

    Can confirm, this does make NCrunch happy in our source generator project. [img]https://i.imgur.com/Thksfwv.png[/img] And we correctly get the warning about this edge case: [quote]This project contains source generation code that makes use of MS code analyzers. Source generation executes c…

  2. Unit Testing Source Generators

    Will do, thanks!

  3. Unit Testing Source Generators

    Thanks, that'll help me continue preaching the gospel of NCrunch. That's the only solution I can think of too. I much prefer a warning with developers needing to explicitly disable, in a solution of 10's of thousands of tests, a couple low value tests could easily assert on the output of a sourc…

  4. Unit Testing Source Generators

    I'm using the GeneratorDriver (https://docs.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.generatordriver) to exercise the source generator in unit tests (to test the syntax trees produced), so compilation breaks when the interface is removed. Above is an example helper method used to produc…

  5. Unit Testing Source Generators

    I understand why source generators can be complicated and why this check exists for projects that use a source generator as a reference. The problem though, I'm unit testing the source generator. I'm not running the source generator. The source generator project is not referenced as an analyzer. …

  6. Unit Testing Source Generators

    I have this private source generator that we use in our projects. We have these source generator tests separated out into two sections - unit tests and functional tests. (when used in our projects, this source generator generates DI registrations, DI is not tested in unit tests) [list] [*] Fu…

  7. Support for C# source generators?

    OutputItemType doesn't look like it's a valid attribute (does nothing during build). Looking deeper, Analyzer looks to be the equivalent: [code=plain]<Analyzer Include="C:\Users\<user>\AppData\Local\NCrunch\48840\1\src\Blah.Build.SourceGeneration\bin\Debug\netstandard2.0\Blah.Build.SourceGenerati…

  8. Support for C# source generators?

    Actually, it looks like NCrunch's modifications to the csproj might not be correct: [code=plain] <ItemGroup> <ProjectReference Include="..\Blah.Builds.SourceGeneration\Blah.Builds.SourceGeneration.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" /> </ItemGroup>[/code] …

  9. Support for C# source generators?

    @Remco do you know if C# 9 source generators work in general? I'm making one for a project and NCrunch can't even build the project (but the .NET Core SDK can). It doesn't look NCrunch is updating it's Syntax Model with the new code from the source generation - the source generation code never e…

  10. MissingMethodException during Analyzing

    You're right, I upgraded NCrunch on all my machines except one. I just downloaded NCrunch 4.6.0.3, but never installed it. Upgrading fixes this problem. Apologies.

  11. MissingMethodException during Analyzing

    Oops, sorry about that. I messed around with it and was able to repo the behavior here: https://github.com/Silvenga/ncrunch-bug-repo The exception seems to be triggered when the custom TestFramework exists in a different assembly under a different target framework.

  12. MissingMethodException during Analyzing

    We have unit tests for a wide gamut of frameworks, everything from e.g. .NET Framework, .NET Core, and .NET 5. When analysing the .NET 5 builds, the following error is thrown: [code=plain] An error occurred while analysing this project after it was built: System.MissingMethodException: Method no…

  13. FrameworkReference Build Error on a netcoreapp2.1 Target Build

    Also, my issues with the new optimized mode have been resolved.

  14. FrameworkReference Build Error on a netcoreapp2.1 Target Build

    Tentatively, looks like 4.4.0.9 resolves the bug, I can no longer reproduce it by modifying the csproj. I've been committing a lot of broken tests over the past couple of months, because the status icon was permanently in a fail state, so very happy to finally see green again.

  15. FrameworkReference Build Error on a netcoreapp2.1 Target Build

    I am so sorry, I never got a notification email from YAF. I just dropped by wondering how that investigation was going. I tried the builds, same issue. [code=plain] NCrunch: This project was built on server '(local)' System.Exception: An exception was thrown in the remote environment: System…

  16. FrameworkReference Build Error on a netcoreapp2.1 Target Build

    I've managed to create 4 reproduction cases relevant to this. I've uploaded a ZIP.

  17. FrameworkReference Build Error on a netcoreapp2.1 Target Build

    I'll try to make a small repo case, thanks.

  18. FrameworkReference Build Error on a netcoreapp2.1 Target Build

    Sorry, the holidays and the resulting context switch had me space on this. I did try those builds (3 months ago), no change. I've since updated to newer release, and the issue does still exist. It's not 100% consistent though, and sometimes works. I think it's related to https://forum.ncrunch.net…

  19. FrameworkReference Build Error on a netcoreapp2.1 Target Build

    Sorry, this is actually what I was coming here is ask about - https://forum.ncrunch.net/yaf_postst2910_TargetInvocationException-Looping.aspx was just a minor annoyance I've been encounting for months that made it hard to make a test case for this issue. Something odd is happening with a csproj t…

  20. TargetInvocationException Looping

    Thanks for the response! I installed the new build, the looping is still occuring. Partly related, I've noticed when adding a new target to a test project, that NCrunch doesn't run the tests under that target until I restart the NCrunch engine. I see the new project target being built, but th…