简体   繁体   中英

app_code files not found by the project

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

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.

ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM