The type or namespace name 'FactAttribute' could not be found

Hi everyone,
I’m getting an error when trying to solve the “Log Analysis” exercise. The error occurs when trying to test the code. Here is the error:

LogAnalysisTests.cs(5,6): error CS0246: The type or namespace name 'FactAttribute' could not be found (are you missing a using directive or an assembly reference?)
LogAnalysisTests.cs(5,6): error CS0246: The type or namespace name 'Fact' could not be found (are you missing a using directive or an assembly reference?)

Here is my code:

public static class LogAnalysis 
{
    public static string SubstringAfter(this string str, string delimeter)
    {
        return str.Substring(str.IndexOf(delimeter),str.Length-1); 
    }
 
    public static string SubstringBetween(this string str, string start, string end)
    {
        return str.Substring(str.IndexOf(start),str.IndexOf(end)); 
    }
    
    public static string Message(this string str)
    {
        return SubstringAfter(str, ": ");
    }

    public static string LogLevel(this string str)
    {
        return SubstringBetween(str, "[", "]");
    }
}

Any idea why this happens?

2 Likes

+cc @ErikSchierboom
Seem to be the problem after a recent update

I’m also experiencing this error on even the “Hello, World!” exercise. I think it has something to do with the test file being written with “implicit using” statements in the project file.

I’ve had the exact same issue occur with the “Football Match Reports”, and apparently it affects “Hello World” too.

Nice to know i’m not the only one experiencing test issues

It’s reverted. You should get a prompt to update your exercises I think (or it might just auto-work)

2 Likes

Actually, they should auto-update due to internal magic. So it should just work now via the Exercism editor. If you’ve downloaded via the CLI, you might need to redownload the exercise.

2 Likes

I can confirm that the tests work again with your magic! Thank you!!

1 Like

Great to hear. Thanks for confirming!