HttpVPN™ - The only technology for secure hosting
of web applications at home.

Welcome Guest Search | Active Topics | Members | Log In | Register

Error happened when ran UltiDev Cassini Web server with web app on 64 bit machine Options
taxnic
Posted: Sunday, February 08, 2009 2:37:17 PM
Rank: Newbie
Groups: Member

Joined: 2/6/2009
Posts: 5
Points: 15
Location: canadna
Hi,

We tested our web application with UltiDev Cassini Web Server in Windows XP and Vista 32 bit systems, they all work fine. But when we tested in Vista 64 bit machine, I got some errors.

Here is the background:
We use Visual Studio 2005 Professional and Sql mobile 3.0 database. I guess Sql mobile 3.0 dlls were built with x86 mode.

When we built our components with "AnyCPU", installation of UltiDev Cassini Web Server and our web application was working fine. This installation actually includes creation of metadata that created a Sql mobile 3.0 database. That means in this installation, Installer has called Sql mobile 3.0 dlls. They work just fine. But when we ran our application, we got "Internet Explorer cannot display the web page" error. This url address displays "http://localhost:7756/GoToApplication.aspx?AppID=990D7173-61BB-46ED-B497-773CE2147658". I checked UltiDev Cassini Web Server Explorer, it displays " is loading application information...". I checked Windows service the UltiDev Cassini Web Serverf or ASP.NET 2.0 is stopped. I started it manually, it worked, but when I ran our application, it stopped again. I tried several time, the error repeated again. I checked the even viewer, I got the error message "System.BadImageFormatException Message: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) StackTrace: at System.Data.SqlServerCe.NativeMethods.SafeRelease(IntPtr& ppUnknown) at System.Data.SqlServerCe.SqlCeCommand.ReleaseNativeInter"

After read a thread in this forum, I changed build platform target to "X86". I reinstalled our application in Vista 64bit machine. Installation was fine, no error. But when we ran our application, we got a different error this time. I checked Windows service the UltiDev Cassini Web Serverf or ASP.NET 2.0 is still running. The error message is "Could not load file or assembly 'our assembly' or one of its dependencies. An attempt was made to load a program with an incorrect format." I googled this error message, it says it usually caused by run ASP.NET 2.0 app in ASP.NET 1.1 framework in IIS.

I searched this forum, there was some similar issue reported, but no solution reported. Anybody has solutions now?

Really appreciated

Ultidev Team
Posted: Sunday, February 08, 2009 7:48:59 PM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Hi there.

First, thank you much for researching the issue before posting. You saved hours of back-and-forth!

It appears that it's not possible to load 32-bit assembly (built with x86 target setting) into a 64-bit process, which is what UltiDev Cassini service is when running on x64 OS. Since current version of UltiDev Cassini has no Application Pool feature found in IIS, the general workaround would be to move the application logic that needs to load 32-bit DLLs (usually COM components) into a separate 32-bit process, and call that logic using .NET Remoting. The most straightforward way to do that is to move the logic in question into a ServicedComponent (of a Server type) living in a separate assembly. This will guarantee transparent instantiation of your 32-bit component in a separate process with remoting interface up & running when you simply do "new MyServicedComponent()" invocation from 64-bit (AnyCPU) code.

ServicedComponent has its own Installer class in .NET framework which makes it relatively painless to deploy. Also, since by default Visual Studio Setup project is configured to run as 32-bit app, it will always register COM+ component(s) (ServicedComponents in .NET lingo) with 32-bit version of the surrogate process (dllhost.exe), ensuring that your 32-bit logic will always run inside 32-bit process on either 64- or 32-bit systems.

ServicedComponents are also great for the logic that requires security context different from the of ASP.NET process. We highly recommend figuring ServicedComponents - it's one of the underrated and underappreciated features, which thanks to .NET is way easier to implement than it was during pure COM times. We encourage you to spend a few hours on building a mock-up solution with a ServicedComponent DLL to figure out this treasure trove.

Please let us know this information has helped.

Best regards
UltiDev Team.
taxnic
Posted: Sunday, February 15, 2009 1:58:34 PM
Rank: Newbie
Groups: Member

Joined: 2/6/2009
Posts: 5
Points: 15
Location: canadna
Is it possible to make UltiDev Cassini service run on x32 mode on x64 OS? If yes, how to set?

Thanks
Ultidev Team
Posted: Monday, February 16, 2009 12:07:04 AM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Hi again!

It probably is possible for us to convert current service EXE into 32-bit, but it will not be a part of the redistributable package. Please let us know if you would be interested to get the modified service EXE.

Best regards,
UltiDev Team.
taxnic
Posted: Wednesday, February 18, 2009 7:22:57 PM
Rank: Newbie
Groups: Member

Joined: 2/6/2009
Posts: 5
Points: 15
Location: canadna
Hi UltiDev Team,

Thanks for your reply.

Yes, I'm very interested to get the modified service EXE. If you can give me some instruction of how to deploy the service EXE with Window's Installer, it will be really appreciated.

Regards
Ultidev Team
Posted: Thursday, February 19, 2009 9:45:07 AM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Well, hands-off deployment of this modified EXE could be tricky. You would have to stop the service in you installer code, replace the EXE programmatically, and then restart the service. We can provide the code that starts/stops the service, but you would need to program the logic that replaces service exe. If you don't mind doing that, please let us know and we'll make the 32-bit EXE for you.

Best regards,
UltiDev Team.
taxnic
Posted: Thursday, February 19, 2009 12:18:35 PM
Rank: Newbie
Groups: Member

Joined: 2/6/2009
Posts: 5
Points: 15
Location: canadna
Hi UltiDev Team,

I would like to have a try. Our product hasn't been released yet, but it's going to release in next week. So maybe it's easy just copy over exe file and use InstallUtil tool to install it, right?

Could you send the EXE file now?
Ultidev Team
Posted: Thursday, February 19, 2009 3:49:41 PM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Hello!

We have sent 32-bit EXEs along with code snippets to the email address associated with your forum account.

Please let us know if provided solution has helped to solve your problem.

Best regards,
UltiDev Team.
mike
Posted: Sunday, February 22, 2009 5:40:28 PM
Rank: Newbie
Groups: Member

Joined: 2/22/2009
Posts: 1
Points: 3
Hi,

I have a similar problem. My little asp.net application uses some dll which can only run on Windows 64bit as a WOW Application. Now I have to compile my project for X86 instead of Any CPU.

Could you send me the 32 bit EXE file to the email address associated with my forum account to ?

Many thanks

regards
Ultidev Team
Posted: Sunday, February 22, 2009 6:20:04 PM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Hello, Mike.

We have sent the files you asked for. Please let us know if you were able to resolve the issue.

Best regards,
UltiDev Team.
taxnic
Posted: Tuesday, February 24, 2009 1:44:08 AM
Rank: Newbie
Groups: Member

Joined: 2/6/2009
Posts: 5
Points: 15
Location: canadna
Hi UltiDev Team,

The x32 EXE files do resolve the issue.

Thanks so much
Ultidev Team
Posted: Tuesday, February 24, 2009 9:19:43 AM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Always happy to help!

Best regards,
UltiDev Team.
nickexe
Posted: Wednesday, April 01, 2009 6:33:29 AM
Rank: Newbie
Groups: Member

Joined: 4/1/2009
Posts: 1
Points: 3
Location: Taipei
Hi UltiDev Team,

I have a similar problem.
Could you send me the 32 bit EXE file to the email address associated with my forum account to?

Thanks so much
Ultidev Team
Posted: Wednesday, April 01, 2009 1:48:23 PM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Done.

Best regards,
UltiDev Team.
devuser
Posted: Thursday, April 02, 2009 5:33:32 AM
Rank: Newbie
Groups: Member

Joined: 4/2/2009
Posts: 3
Points: 9
Hii there,

I am also facing a similar problem.

Could you send me the 32 bit EXE file to the email address associated with my forum account ?

Thanks a ton in advance.
Ultidev Team
Posted: Thursday, April 02, 2009 12:49:56 PM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Done.

Best regards,
UltiDev Team.
devuser
Posted: Friday, April 10, 2009 7:24:40 AM
Rank: Newbie
Groups: Member

Joined: 4/2/2009
Posts: 3
Points: 9
Hi there,

Thanks for the exes that you sent.

I implemented the code to replace the exe in the commit function

They exes are getting replaced and now the application is working fine.

But sometimes I am getting error for "UltiDevCassinWebServer2a.exe "
"That it is being used by another process." hence in this case the above exe is not getting replaced by the one you sent.

I have also tried using sleep to make sure that the rest of the code executes only after the service is stopped properly.
But it didn't help.

Please let me know if you can help me on this?
Ultidev Team
Posted: Friday, April 10, 2009 10:29:13 AM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Hi there!

It's hard to come with a definitive cause, but in order to find the reason we would pay special attention to whether the service has actually stopped after the StopService() call. The StopService() sample we have provided can be easily modified to either return boolean value telling if the service has stopped - so the call could be repeated if not, or to wait indefinitely for the service to stop before attempting to replace the EXE.

Best regards,
UltiDev Team.
devuser
Posted: Wednesday, April 15, 2009 5:09:45 AM
Rank: Newbie
Groups: Member

Joined: 4/2/2009
Posts: 3
Points: 9
Thanks a lot for your help.

It works now.

However I am not waiting indefinitely till the service is stopped.

Thanks
Ultidev Team
Posted: Wednesday, April 15, 2009 11:57:14 AM

Rank: Administration
Groups: Administration

Joined: 11/3/2005
Posts: 1,143
Points: 1,636
Hi again!

It's great there is no problem anymore. If you have made any changes to the issue go away, could you please share here?

All the best,
UltiDev Team.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

SoClean Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.0 (NET v2.0) - 10/10/2006
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in -6.291 seconds.