I am new to web devlopment and working on one issue faced by one of our customer.
We have one SDK DLL which is build into VC++ and is Win32 DLL. We have one WPF application (Targeet platoform x86) which uses it and working fine.
Now customer is trying to use that SDL DLL with MVC 3 application which is working ok if they run under builtin VisualStudio WebServer, but fails when run under IIS _without_ any debugger being attached.
When it run under IIS the application, configured with ASP.NET v4.0 application pool with INTEGRATED pipeline with Enable 32bit applications set to TRUE, since they are working on a 64bit machine. To reproduce the problem we just open the view and click
on the link which calls the SDK API. As soon as we click on the link it crash. I have also attached a stack trace if it is of any help.
The configuration of machine: Windows 7 64bit, IIS 7.1, .NET Framework 4.0
I found
this link which is discussing very similar problem. I dont have the customer code but tried reproducing by creating from a default template and embedding my code.
Below is the stack trace of the crash and entry from application event viewer of the system,
I am new to this and using inetmgr to test. I tried searching the option you told but failed. Can you please tell me in detail steps if possible so I can try?
One more thing I suspect is in the event viewer log that I attached shows a ntdll.dll from SysWOW64 folder means it is trying to load 64-bit instead it should be under System32\ntdll. Is my thinking right?
I tried setting it LocalSystem, LocalService but it didn't work. The visual studio is running under domain user, I didn't find way to change to the domain user in Identity option.
I tried setting it LocalSystem, LocalService but it didn't work. The visual studio is running under domain user, I didn't find way to change to the domain user in Identity option.
If you want to use a custom identity, select the Custom account option and click
Set to open the Set Credentials dialog box. Then type the custom account name in the
User name text box, type a password in the Password text box, retype the password in the
Confirm password text box, and then click OK.
Ohk, I just tried that way to but still fail with the same error.
More to that I removed that VC++ API call and checked it and it worked fine. Now It looks to me some platform specific issue but am failing to find it.
I am trying to embed a manifest file into that application but the manifest combobox under the project properties->application tab is not enabled. Do you think that way can help me resoving this? The snapshot of the manifest is as below,
Did you have try to put your IIS mode in this website to Classic ?
You can't set a manifest in a Web application, because it's runtime is embedded in a pool application, running in a curtain user, not like a win application where you directly run the app under your rights.
MVP Client Operating System
Please Mark as Answer if it helps :)
I tried the way you suggested but it is giving below error. I set the Managed pipeline mode attribute to Classic for the Application Pool.
HTTP Error 404.2 - Not Found
The page you are requested can not be served because of ISAPI and CGI restriction list setting on the webserver.
More to that I am using the below code to import the function from unmanaged c++ dll. Is it playing any role this?
[DllImport("MySDK.dll")]
private static extern int PerformOperation(CompletedCallback pFunPtr, IntPtr arg);//I'm passing Zero in arg and a callback function to the first one
Finally I resolved the issue, below is the root cause of the problem.
My SDK DLL was using a GlobalFree() function which was causing a Heap corruption issue specifically on 64-bit machine. It was working fine on 32-bit machines. I replaced it with free() function and it is working fine on 64-bit machines too.
Thanks,
Marked as answer by jdp12383 on Feb 27, 2012 11:00 AM
jdp12383
Member
10 Points
6 Posts
Crash when deployed on IIS
Feb 23, 2012 06:40 AM|LINK
Hi,
I am new to web devlopment and working on one issue faced by one of our customer.
We have one SDK DLL which is build into VC++ and is Win32 DLL. We have one WPF application (Targeet platoform x86) which uses it and working fine.
Now customer is trying to use that SDL DLL with MVC 3 application which is working ok if they run under builtin VisualStudio WebServer, but fails when run under IIS _without_ any debugger being attached.
When it run under IIS the application, configured with ASP.NET v4.0 application pool with INTEGRATED pipeline with Enable 32bit applications set to TRUE, since they are working on a 64bit machine. To reproduce the problem we just open the view and click on the link which calls the SDK API. As soon as we click on the link it crash. I have also attached a stack trace if it is of any help.
The configuration of machine: Windows 7 64bit, IIS 7.1, .NET Framework 4.0
I found this link which is discussing very similar problem. I dont have the customer code but tried reproducing by creating from a default template and embedding my code.
Below is the stack trace of the crash and entry from application event viewer of the system,
I appreciate your help in resolving this problem.
Thanks,
Jigs
ignatandrei
All-Star
135148 Points
21679 Posts
Moderator
MVP
Re: Crash when deployed on IIS
Feb 23, 2012 07:03 AM|LINK
Put the app pool under the same user as the user that run VS.
jdp12383
Member
10 Points
6 Posts
Re: Crash when deployed on IIS
Feb 23, 2012 07:44 AM|LINK
Thanks ignatandrei for your interest.
I am new to this and using inetmgr to test. I tried searching the option you told but failed. Can you please tell me in detail steps if possible so I can try?
One more thing I suspect is in the event viewer log that I attached shows a ntdll.dll from SysWOW64 folder means it is trying to load 64-bit instead it should be under System32\ntdll. Is my thinking right?
ignatandrei
All-Star
135148 Points
21679 Posts
Moderator
MVP
Re: Crash when deployed on IIS
Feb 23, 2012 08:02 AM|LINK
http://technet.microsoft.com/en-us/library/cc771170%28v=ws.10%29.aspx
jdp12383
Member
10 Points
6 Posts
Re: Crash when deployed on IIS
Feb 23, 2012 08:35 AM|LINK
Thanks ignatandrei for your reply,
I tried setting it LocalSystem, LocalService but it didn't work. The visual studio is running under domain user, I didn't find way to change to the domain user in Identity option.
ignatandrei
All-Star
135148 Points
21679 Posts
Moderator
MVP
Re: Crash when deployed on IIS
Feb 23, 2012 08:59 AM|LINK
Quoting from
jdp12383
Member
10 Points
6 Posts
Re: Crash when deployed on IIS
Feb 23, 2012 09:38 AM|LINK
Ohk, I just tried that way to but still fail with the same error.
More to that I removed that VC++ API call and checked it and it worked fine. Now It looks to me some platform specific issue but am failing to find it.
I am trying to embed a manifest file into that application but the manifest combobox under the project properties->application tab is not enabled. Do you think that way can help me resoving this? The snapshot of the manifest is as below,
<?xml version="1.0" encoding="utf-8"?> <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <assemblyIdentity type="win32" name="TestApp" version="1.0.0.0" processorArchitecture="X86" /> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" xsi:type="win32" /> </requestedPrivileges> </security> </trustInfo> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application xsi:type="win32"> </application> </compatibility> <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) --> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </asmv1:assembly>giop
Member
378 Points
81 Posts
Re: Crash when deployed on IIS
Feb 24, 2012 08:20 AM|LINK
Did you have try to put your IIS mode in this website to Classic ?
You can't set a manifest in a Web application, because it's runtime is embedded in a pool application, running in a curtain user, not like a win application where you directly run the app under your rights.
Please Mark as Answer if it helps :)
jdp12383
Member
10 Points
6 Posts
Re: Crash when deployed on IIS
Feb 24, 2012 11:33 AM|LINK
Thanks giop for your inputs,
I tried the way you suggested but it is giving below error. I set the Managed pipeline mode attribute to Classic for the Application Pool.
More to that I am using the below code to import the function from unmanaged c++ dll. Is it playing any role this?
[DllImport("MySDK.dll")] private static extern int PerformOperation(CompletedCallback pFunPtr, IntPtr arg);//I'm passing Zero in arg and a callback function to the first onejdp12383
Member
10 Points
6 Posts
Re: Crash when deployed on IIS
Feb 27, 2012 11:00 AM|LINK
Hi All, Thanks for your inputs and guidance,
Finally I resolved the issue, below is the root cause of the problem.
My SDK DLL was using a GlobalFree() function which was causing a Heap corruption issue specifically on 64-bit machine. It was working fine on 32-bit machines. I replaced it with free() function and it is working fine on 64-bit machines too.
Thanks,