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