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