How come classes in subfolders in my App_Code folder are not being found correctly?

后端 未结 6 1484
野性不改
野性不改 2020-12-15 00:47

I am getting the following error when I put class files in subfolders of my App_Code folder:

errorCS0246: The type or namespace name \'MyClassName\' could not be fou

6条回答
  •  一向
    一向 (楼主)
    2020-12-15 01:21

    In Visual Studio (2010 at least, but I recall past versions too), you can right click on the folder, within Solution Explorer, and then choose "Include in Project".

    Then on the properties tab for each file (or select them all at once), you choose "Compile" for the "Build Action" property.

    This worked for me.

提交回复
热议问题