I have a Fixed Point type by subclassing Type (refer to this post). I could build this project name it a.dll.
namespace System
{
public class FixedPointDataType : Type
{
public Boolean Signed { get; set; }
public int Width { get; set; }
public int IntegerWidth { get; set; }
public FixedPointDataType(Boolean signed = false, int width = 16, int integerWidth = 8)
{
Signed = signed;
Width = width;
IntegerWidth = integerWidth;
}
...
I have another project b.dll that uses the System.FixedPointDataType that is in a.dll.
After referencing a.dll in project b, when I tried to compile the file abc.cs in project b, I got this error.
Error 2 'System.FixedPointDataType' is inaccessible due to its protection level
abc.cs
What might be wrong?
ADDED
I needed to add public and give the full name with namespaces – System.FixedPointDataType. I got error even after the modification, but when I rebuilt the whole solution, and the error is removed. Thanks for the comments and answers.
Your class is not declared
public; or it was before you changed your post and rebuilt the project.But I stand by the earlier comments that you should not subclass
Typeor add members to namespaceSystem.If the two projects are in the same solution, make sure you add a reference to the project, not just to the DLL that is the output of the project. If you don’t add a reference to the project, VS won’t know what order to build your solution in, and you may be referencing outdated versions.