3

my name is samy and im going insane!

i got this problem that my class's in app_code are no visible afther im uploading them to the server. localy every thing work fine.

i read some other qustions on this when a lot of answer were like this:

"Right-click on the item in the solution explorer, and select Properties. In the properties window, there is a Build Action option."

 *when i right click i cant see any proprty button so i used F4 but then i cant see any build option only "Custom Tool", "File Name" , "Full Path".

and "you need to publish your website first." *this didnt work either.

or "your class are not compiled. *i tried to build solution and that didnt work either.

please help me becuse im starting read/see tutorials on how to make a good rope knots (this will probly fails too so dont worry to much lol)

this is the error im getting (its look like this becuse im using iframe) http://img14.imageshack.us/img14/11/theerrorb.png

this is error i get if i publish the site and upload it to the server all the app_code files are compiled in the bin folder as you said.

http://img193.imageshack.us/img193/4436/errorifipublish.png

2
  • when you compile, build and publish code app_code folder is compiled into a dll file and not as a folder. Check your bin folder and see if you see that dll on server.
    – rs.
    Commented Feb 29, 2012 at 0:00
  • cant see any dll in my bin other that what i put there. any other idea? what can block me for getting to my class proprties?
    – samy
    Commented Feb 29, 2012 at 0:09

1 Answer 1

8

Possible Solution 1

I have seen this before when working with ASP.NET Web Sites. If my memory serves me right, you should make sure that the paths to your references are wired up correctly.

i.e. if you added a custom DLL to your project

C:\My References\Some3rdParty.dll

and you moved the DLL to another folder/location. Or you could simply have a reference to a DLL that cannot be found.

If you resolve these reference problems you could find that your App_Code gets compiled all of a sudden.

Possible Solution 2

Right click and go to the properties of each of the .cs files in your App_Code directory in the Visual Studio Solution Explorer and make sure that the Build Action is set to Compile.

Possible Solution 3

If you have your .cs files in sub-folders within the App_Code directory you should add the following to your web.config file:

<configuration>
    <system.web>
      <compilation>
         <codeSubDirectories>
           <add directoryName="MySubAppCodeFolderName"/>
         </codeSubDirectories>
      </compilation>
   </system.web>
</configuration>

Possible Solution 4

  1. In Visual Studio, right-click on your Web Site in the Solution Explorer and click Publish Web Site. Make sure that the Target Location is a folder on your machine.
  2. Log-in you your web-server and go to the BIN folder there. In the BIN folder on your web site delete all of the App_Web_.dll and App_Web_.dll.compiled files.
  3. From your machine, copy your web site (including the App_Web_*.dll's in the BIN) to your web server where your web site is located. The only file you should probably not copy across is your Web.config file.
17
  • @samy If any of these solutions work for you can you let us know for future reference. Thanks
    – Seany84
    Commented Feb 29, 2012 at 10:26
  • 1.i got 1 dll file in the bin "Flicker.dll" 2. i cant see any option to get in the class proprties :( 3.i got only 2 .cs file in app_code and thay are not in sub folder. any other idea?
    – samy
    Commented Feb 29, 2012 at 10:38
  • 1
    1. Have you tried running Visual Studio with administrator privileges? 2. Is this a new Web Site or an old one that has stopped working? 3. Was this working before? Have you made any changes such as changing the .NET framework version etc..?
    – Seany84
    Commented Feb 29, 2012 at 10:54
  • 1.i just tried that and cant see any diffrents. 2.is a website i made about 1 month ago but just now add a server side code 3.the site is working localy, but when i upload it to a server some pages who use some of the .cs in the app_code give me errors 4.thank you for your help :)
    – samy
    Commented Feb 29, 2012 at 11:00
  • No problem, can you edit your original post and put the exact errors that you are getting? You may need to set customErrors off in your Web.config i.e. <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration>
    – Seany84
    Commented Feb 29, 2012 at 11:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.