Include_file_not_found error running classic ASP on IIS 8.5 - asp-classic

I have a frustratingly simple problem. I've migrated a classic ASP site from a Windows Server 2003 IIS site to a shiny new 2012 R2 Server running IIS 8.5.
When I navigate to the home page (http://mydns/default.asp), I get a 500 error. The IIS logs show me this error:
GET /default.asp |4|ASP_0126|Include_file_not_found
Looking at the default.asp page, I see the following code at the top of the file:
<%# Language=VBScript %>
<!-- #include file="Include/common.asp" -->
<%
dim EMAIL_ID
if Request.QueryString = "" then
...
So, my assumption is that the error is being thrown due to the second line. In the website directory, the Include directory does exist, and there is a common.asp file inside of it.
# the default.asp page that I'm loading...
E:\websites\mywebsite>dir | findstr default
09/29/2015 10:30 AM 3,237 default.asp
# the common.asp page within the Include folder...
E:\websites\mywebsite>dir Include | findstr common
06/30/2015 10:27 AM 546 common.asp
Any idea why I would be getting an error about a file not found when I do see it in that directory?
Update 1: By navigating to the common.asp page in a browser, I get the following error in IIS:
GET /Include/common.asp |42|800a01ad|ActiveX_component_can't_create_object:_'Domain.clsAuth'
I found this article which helped me confirm that a DLL is missing so I am pursuing installing it on the new server.
Update 2: I was able to find the required Domain.dll on the old server. I used Dependency Walker to determine that Domain.dll depended on MSVBVM60.DLL so I grabbed both of these and moved them to the new server. I registered MSVBVM60.DLL successfully using C:\WINDOWS\system32>regsvr32.exe MSVBVM60.DLL, but registering Domain.dll failed. I got the following error message:
It turns out that this is the same error that you get if you try to register a file that doesn't exist. For instance, I tried to register "dummy.dll" and got the same error. It's like the system doesn't see the file. It autocompletes at the command line, but I can't register it. I also can't open it in Dependency Walker... the application says file not found. But I know it's there...
C:\WINDOWS\system32>dir | findstr Domain
04/27/2006 02:57 PM 24,576 Domain.dll
Update 3: The issue about registering the DLL was a 32 vs 64 bit thing. I had a 32 bit DLL in the system32 folder which is a 64 bit only folder. Once I moved it to the SysWOW64 folder (which is a 32 bit folder, go figure) I was able to register it. I also unregistered MSVBVM60.DLL from system32 and found that it was already available in SysWOW64.
So, this DLL issue is solved! But I'm getting the same error again due to a different include file. To be continued...
Update 4: The final include file error was indeed a missing include file.

Answering my own question... In my case, the issue was that the include file in question was throwing errors. I guess the fact that the ASP engine couldn't render the ASP include file resulted in the parent page throwing a "not found" error. By installing and registering a missing DLL, I was able to resolve my issue. Checkout the updates in the question for details.

Related

Mono Site Failed to map path '/App_WebReferences/.... Error

I have an open source asp.net site that is meant to run under apache/mono. I have a new version I am all ready to release but it has a problem running under linux. Everything works great on windows.
The first time I load the page I get:
System.InvalidOperationException Failed to map path '/App_WebReferences/MythContent/ContentServices.wsdl'
The file is there:
-rw-r--r-- 1 www-data www-data 37K Nov 20 2013 mobilemyth/App_WebReferences/MythContent/ContentServices.wsdl
Refresh the page again and you get:
System.IO.IOException
Sharing violation on path /tmp/www-data-temp-aspnet-0/9e3969b/Resources.frontendsettings.aspx.resources
And that is all you get from them on. Any ideas?
In Mono, the best solution for this issue is using the wsdl2 command line and generate the class an put it in the App_Cod. So you can use the WebService client in your app.
Sample:
$ wsdl2 http://< your url of wsdl >?WSDL

Symfony 2 Missing File Error When They're Not

I got my Symfony 2.3 project working through app.php in development. I then did a complete copy to my shared host sever (goDaddy). So far, all I get are blank pages. I've been working my way through the errors. My lastest execution generates 100+ errors in the php log of this type:
[09-Jul-2013 12:52:56 America/Los_Angeles] PHP Warning: file_get_contents(/Volumes/Data RAID/htdocs/Symfony/src/Zetcho/AmColAnBundle/Resources/views/User/userSubNav.html.twig) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /home/content/.../Symfony/vendor/symfony/symfony/src/Symfony/Component/Templating/Storage/FileStorage.php on line 32
Then I get one of theses
[09-Jul-2013 12:52:56 America/Los_Angeles] PHP Warning: file_get_contents(/Volumes/Data RAID/htdocs/Symfony/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /home/content/.../Symfony/vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 127
The ellipses are mine. I verified that the file that both files were was at the locations specified and that I could read it. The permissions on the files are 644. Could this be a permission problem? If so, what should they be set to?
Update: I set the permissions to 755 and got the same errors.
Update 2: I just noticed that the error is giving my development server directory path. Now I just have to figure out where to change it.
Update 3: It appears to be the cache. There is not command access to a goDaddy shared server that I know of so I just deleted all the files in app/cache/prod. I now get my html, but no css. I use Assetic for images and css. I get the images.
Update 4: When I clicked on a link, the next page used the css file. When I went back to the first page, it used it as well. As I check out the pages, some of the images are missing. Could this be because the cache wasn't rebuilt correctly or completely?
Update 5: Fixed the last problem with missing images. There was a case mismatch between the reference and the image. I think I'm good now.

Mono random CS0006 compilation errors w/ fastcgi-mono-server4

I'm trying to deploy an ASP MVC project developed on Mono/OSX on my Linux server using mono 2.10.8.1 w/ fastcgi-mono-server4
The webapp always starts fine, but then I start getting random CS0006 compilation errors for various URIs, and once they break, they remain broken until I restart the server application.
An example error:
Server Error in '/' Application
Compilation Error
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Compiler Error Message: CS0006: Metadata file `/tmp/root-temp-aspnet-0/ed68754/App_global.asax_40e709ea.dll' could not be found
~/Views/Order/Download.aspx
There is a related thread from January, but both the question and the answer seem to be mod_mono specific and rather hand-wavy. Anyone have any advice on what to try to debug/solve/work around this issue? It's getting very frustrating. In particular, is there any "unsupported" workaround where I can copy something from my Windows Server machines to use an MS implementation instead of the buggy mono one?
(I've filed a bug report too.)
Since the errors appear to be issue with the Mono JIT attempting to compile temporary files that don't exist, I spent a few days trying different methods of working around this issue (vs solving it). One solution that worked was using aspnet_compiler on Windows to create a binary version that could be copied and run as-is on Linux/Mono (as the latest versions of Mono now support precompiled ASP.NET applications).
However, I was looking for a native Linux solution, and I don't want to have to compile and sync binaries (vs syncing a GIT repo of code) to the server, so I was looking for another solution when I came across Mono ahead of time compilation, which is pretty much the equivalent of ngen.exe on Windows.
While it doesn't precompile everything, it seems to have done the trick. For me, this deployment script does the job without any runtime build failures:
xbuild SystemDiscs.sln
mono --aot -O=all SystemDiscs/bin/SystemDiscs*.dll
killall -9 mono
nohup fastcgi-mono-server4 /socket=tcp:127.0.0.1:8000 /applications=/:/var/asp/S
ystemDiscs/SystemDiscs/ > /var/log/systemdiscs.log &
Where SystemDiscs*.dll is the output of the solution compiled with xbuild in the first step. I don't think this precompiles the ASP pages (and --aot=full isn't supported on x86, as far as I can tell), but somehow it did the job. I was waiting to see whether or not that was just a fluke, but it's been going fine with maybe a dozen commits/deploys since I asked this ten days ago, so I reckon its safe to say it works.
I had a similiar problem:
Compilation Error
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Compiler Error Message: CS0006: Metadata file `/tmp/<DOMAIN/>/<username/>-temp-aspnet-0/5ed74d00/App_global.asax_34cccb99.dll' could not be found
/Default.aspx
But it didn't have anything to do with precompiling but with a backslash in my username. I use likewise-open to login to a windows domain, so my username is <DOMAIN/>\<username/> while my home-directory is without a backslash: /home/likewise-open/<DOMAIN/>/<username/>. This difference or just the backslash itself caused mono not finding the compiled global.asax in the temp directory. If you look closely to the detailed output you see that the backslash \ in the out parameter is changed to a forward slash /:
dmcs /target:library /lib:"/home/likewise-open/<DOMAIN/>/<username/>/Documents/test9999/test9999/bin" /debug+ /optimize- /warn:4 /out:"/tmp/<DOMAIN/>\<username/>-temp-aspnet-0/5ed74d00/App_Web_17ca7bdd.dll" /r:"/usr/lib/mono/4.0/mscorlib.dll" /r:"/usr/lib/mono/gac/Microsoft.CSharp/4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll" /r:"/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll" /r:"/usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll" /r:"/usr/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll" /r:"/usr/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll" /r:"/usr/lib/mono/gac/System.Web.Services/4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll" /r:"/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll" /r:"/usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll" /r:"/usr/lib/mono/gac/System.EnterpriseServices/4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll" /r:"/usr/lib/mono/gac/System.IdentityModel/4.0.0.0__b77a5c561934e089/System.IdentityModel.dll" /r:"/usr/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll" /r:"/usr/lib/mono/gac/System.Xaml/4.0.0.0__b77a5c561934e089/System.Xaml.dll" /r:"/usr/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll" /r:"/usr/lib/mono/gac/System.ServiceModel.Web/4.0.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll" /r:"/usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll" /r:"/usr/lib/mono/gac/System.Web.Extensions/4.0.0.0__31bf3856ad364e35/System.Web.Extensions.dll" /r:"/usr/lib/mono/gac/System.Data.DataSetExtensions/4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll" /r:"/usr/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll" /r:"/usr/lib/mono/gac/System.ComponentModel.DataAnnotations/4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll" /r:"/usr/lib/mono/gac/System.Web.DynamicData/4.0.0.0__31bf3856ad364e35/System.Web.DynamicData.dll" /r:"/usr/lib/mono/gac/System.Data.Linq/4.0.0.0__b77a5c561934e089/System.Data.Linq.dll" /r:"/usr/lib/mono/gac/System.Web.ApplicationServices/4.0.0.0__31bf3856ad364e35/System.Web.ApplicationServices.dll" /r:"/home/likewise-open/<DOMAIN/>/<username/>/Documents/test9999/test9999/bin/test9999.dll" /r:"/tmp/<domain/>/<username/>-temp-aspnet-0/5ed74d00/App_global.asax_34cccb99.dll" /nowarn:0169 /d:DEBUG -- "/tmp/<DOMAIN/>\<username/>-temp-aspnet-0/5ed74d00/App_Web_17ca7bdd_0.cs"
So:
/out:"/tmp/<DOMAIN/>\<username/>-temp-aspnet-0/5ed74d00/App_Web_17ca7bdd.dll
becomes
/tmp/<DOMAIN/>/<username/>-temp-aspnet-0/5ed74d00/App_global.asax_34cccb99.dll
If I copy the directory 5ed74d00 to /tmp/<DOMAIN/>/<username/>-temp-aspnet-0/ the application works as expected.
It took me almost 2 days to see this, so hopefully I can help others with this answer.

Error Loading Zend Gdata framework into Wordpress

I am trying to use the Zend Gdata framework with wordpress but I am having some issues.
Now everything works perfectly fine when I test on localhost with XAMPP. However on my web server my code breaks down.
Here is my code to include the framework.
`set_include_path(TEMPLATEPATH . '/includes/');
require_once ('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata_Youtube');`
That code produces the following error.
Warning: Zend_Loader::include_once(Zend/Gdata/Youtube.php) [zend-loader.include-once]: failed to open stream: No such file or directory in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'Zend/Gdata/Youtube.php' for inclusion (include_path='/home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/') in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Zend/Gdata/Youtube.php" does not exist or class "Zend_Gdata_Youtube" was not found in the file' in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php:99 Stack trace: #0 /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/modules/yt_link_checker.php(19): Zend_Loader::loadClass('Zend_Gdata_Yout...') #1 /home/damain/public_html/mysite.com/wp-includes/plugin.php(405): load_zend_gdata('') #2 /home/damain/public_html/mysite.com/wp-admin/admin.php(111): do_action('load_zend_gdata', Array) #3 /home/damain/public_html/mysite.com/wp-admin/index.php(10): require_once('/home/damain/...') #4 {main} thrown in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 99
I cannot seem to figure this issue out. Can anyone help?
The best solution in this case is to run the script requiring the Zend Loader and use var_dump(get_include_path()) to see what the server says the path is. Then keep modifying the php.ini include_path until the script finds it.
In your case, I'm not sure if 'damain' is supposed to be 'domain'. My include path which finally worked was:
/home2/thelove6/public_html/zf/ZendGdata/library" thelove6 being the username.
Did you look to see if those files exist in those directories? (/mysite/includes/Zend/Loader.php) and they have the correct permissions? It sounds like that could very well be the issue. The other thing to check with a simple phpinfo() would be that you have all of the libraries install on the live server.
Ok, the possible reason is: You're not using the proper case for the classname. For the version 1.11.11, it will be Zend_Gdata_YouTube rather than Zend_Gdata_Youtube.
Windows OS is ignoring the case, whereas the Linux server does not. Hope this will solve your problem, just look at the proper case of the Class or filenames.

BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'

When I compiled my latest asp.net program and trying to run on the test server, I am getting this error
Line 46: Dim dependencies() As String
Line 47: CType(Me,Global.System.Web.UI.Page).AppRelativeVirtualPath = "~/default.aspx"
Line 48: If (Global.ASP.default_aspx.__initialized = false) Then
Line 49: dependencies = New String(0) {}
Line 50: dependencies(0) = "~/default.aspx"
Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb Line: 48
Detailed errors when I expand the compiler output...
Microsoft (R) Visual Basic Compiler version 8.0.50727.3053
for Microsoft (R) .NET Framework version 2.0.50727.3053
Copyright (c) Microsoft Corporation. All rights reserved.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(48) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.
If (Global.ASP.default_aspx.__initialized = false) Then
~~~~~~~~~~~~~~~~~~~~~~~
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(51) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.
Global.ASP.default_aspx.__fileDependencies = Me.GetWrappedFileDependencies(dependencies)
~~~~~~~~~~~~~~~~~~~~~~~
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(52) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.
Global.ASP.default_aspx.__initialized = true
~~~~~~~~~~~~~~~~~~~~~~~
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(76) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.
Private Sub __BuildControlTree(ByVal __ctrl As default_aspx)
~~~~~~~~~~~~
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(100) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.
Me.AddWrappedFileDependencies(Global.ASP.default_aspx.__fileDependencies)
~~~~~~~~~~~~~~~~~~~~~~~
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web_default.aspx.cdcab7d2.4ubu1wgu.1.vb(31) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.
Return New ASP.default_aspx
~~~~~~~~~~~~~~~~
I checked a few things and all of them turned out to be okay:
[*] Default is not defined twice
anywhere
[*] Everything was working
on the last release 1 week back
[*] There are no old files that are
still staying with the compiled
files. Also I cleared the temporary
files many times.
[*] I have tried
with other aspx files and all of
them is giving ambiguous error
(error in different source files...)
[*] The original source works just
fine! only the error shows up on the
compiled code.
Any ideas or any clues on how to resolve this ambiguity.
Thanks
SK
I just solved this problem with the assistance following link: http://www.netomatix.com/development/usercontrols2.aspx
Add this on aspx or ascx page ClassName="MyModule"
<%# Control Language="vb" AutoEventWireup="false" CodeBehind="MyModule.ascx.vb" ClassName="MyModule" %>
Okay here is what I found after spending three days on this problem.
Finally I figured that if I removed all the projects from the solution except one (that was causing problem) I could isolated it to default.skin. The problem seemed to be very erratic because it started going away if I deleted certain lines from this file. However, this was not consistent and the problem came and went at random.
So after losing all hopes of fixing it in the code, I decided to try it another way. I changed the option of aspnet_compiler command from -prefix switch (a dll is created for each folder) to -o (all compiled ui is put in one dll), the problem went away!!!
It seems that the problem is due to some bug in the aspnet_compiler. It got triggered in this version somehow that I could not figure out.
I am thinking of moving to more stable asp.net 3.5SP1 (or maybe wait for asp.net 4.0) any suggestions?
I ran into this issue in consuming project when changing name/namespace of a library that consuming project referenced.
Issue is consuming project Bin folder has copy of DLL with each name/namespace name.
Deleting the consuming project Bin folder and rebuilding solved.
I've found that mixing Namespaces can really confuse things.
The best way to clean it up is to remove all the namespace declarations in your web project, and make sure that they're consistent in dependent projects. Don't forget to check the project properties, and the generated .designer.vb files.
Also, it sounds like you have a top-level directory named ASP - that's probably not helping things either. I'd get rid of that directory entirely, and see if that helps the problem. I did report this as a bug to MS a while back, and even provided them with a reproducible example, but never heard anything back from them.
I solved this problem by putting the namespace above the class
Namespace yournamespace
Public Class yourclass name
end class
end Namespace
You need to make sure that the user control is also copied across with the page to your test server.
We had the same problem on out test servers. We found a duplicate of our application dll in the bin file. It's name was slightly different (missing a single "." in it) than the original dll but it contained the same types. We removed it and everything started working again.
After I checked the same items as Samuel:
[*] Default is not defined twice anywhere
[*] Everything was working on other computer 1 week back
[*] There are no old files that are still staying with the compiled files. Also I cleared the temporary files many times.
[*] I have tried with other aspx files and all of them is giving ambiguous error (error in different source files...)
[*] The original source works just fine! only the error shows up on the compiled code.
(...)
I just let my code as originaly in VS-2015 and in CMD window I executed:
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_compiler -v / -p "C:\inetpub\wwwroot\projectFolder"
And every thing was running Ok without any error.
Subsequents compilations in VS-2015 environment were also Ok.

Resources