Visual Studio 2013 is not able to recognise the class file added as Add > Existing Item > File "Add as link"

StackOverflow https://stackoverflow.com/questions/22130140

Question

I am trying to add an external C# file. It's added to the project but the IDE is not able to recognize the class, even the class name is not reflected into the intellisence option. I am working on a c# desktop application on VS2013.

What am I missing here?

Was it helpful?

Solution

i suspect that the newly added class is inside the different namespace than from where you are trying to access it.

if that is the case just try to access the newly added class using its namespace asbelow:

namespace newlyaddednamespace
{
  class newclass
  {
     //this is the class added newly
  }
}

namespace mynamespace
{

 class myclass
 {
   //access the newly added class from its namespace
   newlyaddednamespace.newclass newclassObj=new newlyaddednamespace.newclass();
 }

}

OTHER TIPS

Set the Build Action for that file to Compile.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top