an.c.
an.c.
CC#
Created by an.c. on 12/16/2022 in #help
✅ Mono.Cecil.ParameterDefinition.HasDefault
in mono.cecil in a ParameterDefinition, what does HasDefault mean? I was hoping for it to be that if a method signature looks like MyMethod(bool x = false) x was left to its default or not. That isn't the case. I'm asking this because I need to know if a param of a MethodSpecification, say MyMethod, has a param assigned or left to its default. Is it even possible?
9 replies
CC#
Created by an.c. on 12/6/2022 in #help
✅ Can't get `InternalsVisibleTo` to work
From assembly (project) A.B I added the following in a file
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("A.B.Tests")]

namespace MyNamespace
{
internal class MyClass {}
}
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("A.B.Tests")]

namespace MyNamespace
{
internal class MyClass {}
}
But the assembly A.B.Test can't see MyClass. Is there something extra that I should do?
74 replies
CC#
Created by an.c. on 8/18/2022 in #help
Suppress CS0618 for entire file [Answered]
Can I suppress CS0618 for an entire file? I tried with [System.Diagnostics.CodeAnalysis.SuppressMessage("Warning", "CS0618: Type or member is obsolete", Justification = "Some reason")] but it doesn't look correct. How can I achieve this? I want to avoid to #pragma warning disable CS0618 // Type or member is obsolete on each single occurrence. And I want to avoid a global setting.
27 replies