Odd_Dev_404
C#.NET Core Console Application with Xunit not detecting the console project as a project reference.
Error was intellisense not working inside the unit test when I was trying to use the console app's namespace, and when I was trying to create a new class object it wasn't detecting/intellisense inside the unit test class.
But I found the solution now.
By default when I was creating a console application, it creates the Program class with main method as an internal class Program. So, since unit test project is outside the console app's project assembly, it blocks accessing it.
I created a new class with a public class, instead of internal class, and now it works!!
13 replies
C#.NET Core Console Application with Xunit not detecting the console project as a project reference.
I noticed that somehwere on Stackoverflow had mentioned that creating a public class in a console app does the trick.
I tried that, but even intellisense not working for the namespace of the console app, and cannot instantiate a new class object.
13 replies
I cant figure out constructor inheritance
@SyncRооt - Got it thanks! I was aware about that "No constructor, so the compiler places an implicit public empty constructor"
But wasn't aware constructor inheritance is not supported within C# at this moment until you mentioned that.
In this link's first example - https://www.geeksforgeeks.org/c-sharp-inheritance-in-constructors/ isn't an example related to constructor inheritance?
6 replies
I cant figure out constructor inheritance
@SyncRооt - I have a question. In the first code it has just inherited from the base class.
public class SubClass : Superclass {
}
I'm bit confused why it's giving an error as 'SuperClass' does not contain a constructor that takes 0 arguments
Any idea?6 replies