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

سؤال

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?

هل كانت مفيدة؟

المحلول

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();
 }

}

نصائح أخرى

Set the Build Action for that file to Compile.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top