Why isn't one c# class in one file not finding another one defined in another file/folder?

848 Views Asked by At

I’m working with a new ASP.Net project in Visual Studio 2019. I’ve imported two files that play nicely together in another project, but not in this one.

One file lives in the root folder and references a class that’s defined in another file, one that lives in a subfolder off of the root, App_Code. The problem is in the file off of the root – the reference to that other class has a red line under it. It says, “The name ‘blah-blah’ does not exist in the current context.” It’s not picking up the class defined in the App_Code folder.

Neither file has any namespace declared – they both just define their respective classes… Again, these two files play nicely in an older project, but not in this new one.

Any thoughts? Thanks for the help!

1

There are 1 best solutions below

0
On

You might have space in folder name, that causes Visual Studio not to find the referenced file.