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