Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
359 views
in Technique[技术] by (71.8m points)

c# - App_Code folder issues

So I'm having a really weird issue with my App_Code folder on a new website I'm designing.

I have a basic class inside of a namespace in the App_Code folder. Everything works fine in the IDE when I setup the namespace and make an object from the class. It brings up the class summary on hover, and when you click on "go to deffinition" it goes to the class file. And it also works fine localy.

However, when I load the site onto my server, I get this error message when I access that page:

Line 10: using System.Web.UI.WebControls;
Line 11: using System.Web.UI.WebControls.WebParts;
Line 12: using xxxx.xxxx

Compiler Error Message: CS0246: The type or namespace name 'xxxxxx' could not be found (are you missing a using directive or an assembly reference?)

I know for a fact that the class file is there. Anyone have any idea of whats going on?

Edits:

John, yes it is a 2.0 site.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem that your classes are not compiled, You'll solve this issue simply by going to the properties of any class in the App_Code folder and change it's 'Build Action' property from "Content" to "Compile"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...