Sharepoint–File Not Found
If you have created your custom ASPX and getting “File Not Found” exception; here are few possible reasons and solutions
Place the assembly (DLL) containing the code behind code into the sharepoint web application’s bin folder. If it resolves the issue but you don’t want to keep the DLL into web application’s bin folder and instead want to have it in Global Assembly Cache (GAC) only then you need to make sure that in the @Page directive you are giving the full name including its public key of your assembly. More details are on my earlier post.
The other reason can be that you are using some third party assembly; either using some third party control or have dependency on some assembly which is not registered as “SafeControl”. Make sure that all such referenced assemblies are added into the sharepoint web site’ web.config file.
If you need to troubleshoot or need to find out which assembly you are getting error with; you can do two things; simplest is that you set CallStack to true in sharepoint web application’ web.config file. Its in configuration\Sharepoint\SafeMode section in that file. Setting this to true and also setting the famous customErrors mode to Off (configuration\system.web\customErrors section in web.config) you will get the complete details of the exception including the call stack. This can help you understand where this error is getting generated. The second thing you can try is FUSLOGVW tool which is in %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bin. This tool shows the Fusion logs. You can copy this tool from the development machine to the server. You need to be careful; if you try to use v7.0 exe; it shows .NET v4 FUSLOGs. You might also need to forcefully enable the Fusion logs by issuing the following command
>reg add HKLM\Software\Microsoft\Fusion /v EnableLog /t REG_DRWORD /d 1
More details about Assembly Probing, Fusion and FUSLOGVW can be found here.