umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.49k stars 2.69k forks source link

Add ReSharperTestRunnerArm32 & ReSharperTestRunnerArm64 to the assembly exclusion list in TypeFinder #14857

Open laputaworkuk opened 1 year ago

laputaworkuk commented 1 year ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

12.2

Bug summary

Description When running tests in the JetBrains Rider IDE in a project that calls .AddUmbraco(), a System.IO.FileNotFoundException is thrown, with an assembly loading error mentioning ReSharperTestRunner64 not being found. Seems like Umbraco is processing all loaded assemblies in a way that fails when this one is present. By following the stack trace, I noticed that TypeFinder which come from https://github.com/umbraco/Umbraco-CMS/blob/release-12.2.0/src/Umbraco.Core/Composing/TypeFinder.cs already has a ReSharperTestRunner32, ReSharperTestRunner64 in its exclusion list, so this PR adds the ReSharperTestRunnerArm32 & ReSharperTestRunnerArm64, which I believe should fix the issue.

Whether this issue is triggered on a given setup probably depends on stuff like OS and Rider version. But I assume one could reproduce by installing the latest version of JetBrains Rider on a 64-bit Windows machine, setting up a new Umbraco project with a test, and finally run the test through the test runner in Rider.

Specifics

No response

Steps to reproduce

The case is same as https://github.com/umbraco/Umbraco-CMS/pull/14498 where it need more type need to add inside

Expected result / actual result

No response

github-actions[bot] commented 1 year ago

Hi there @laputaworkuk!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

kjac commented 1 year ago

Hi @laputaworkuk,

Sounds like a fine way to fix the issue. But before we go ahead and do it, perhaps you can share a little more details on your setup? I'm running Rider on a Windows 64-bit machine with no issues.

By the looks of it, the assemblies might be tied to the processor architecture? Given that the assemblies you mention contains "Arm", that is 🤔

laputaworkuk commented 1 year ago

@kjac but my rider running on Windows 10 64 bit and it show this error image before the 12.1 it return Could not load file or assembly 'ReSharperTestRunnerX64

kjac commented 1 year ago

That is indeed weird. Could it be that you're building for ARM or somehow have an ARM version of the .Net SDK installed?

deMD commented 1 year ago

I have the same issue. And am not building an ARM version nor have an ARM version of .Net SDK installed.

Bas-kolthof-triple commented 1 year ago

It seems like the TypeFinder is for some reason scanning the directory contents of every loaded dll for things Umbraco might enjoy, which causes problems when certain test runner dll's from certain IDE get's loaded, and Umbraco goes checking the IDE's dll's for goodies. There's a extensive built in list of dll's that have triggered this unusual feature, and also a nice TODO comment recommending deleting the TypeFinder altogether.

Fortunately, it looks like the blacklist can be extended via configuration, https://docs.umbraco.com/umbraco-cms/reference/configuration/typefindersettings So adding ReSharperTestRunnerArm32 and ReSharperTestRunnerArm64 to the AdditionalAssemblyExclusionEntries should work as a workaround till someone gets around to that TODO.

kjac commented 1 year ago

Thank you for chipping in on this, all 🚀

I see no problem adding another few entries to the KnownAssemblyExclusionFilter in TypeFinder as a fix for this issue.

I'm putting this up for grabs for anyone interested in fixing 😄

github-actions[bot] commented 1 year ago

Hi @laputaworkuk,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post.

Thanks muchly, from your friendly Umbraco GitHub bot :-)