Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

11 Pages123>»
Error happened when ran UltiDev Cassini Web server with web app on 64 bit machine
taxnic
#1 Posted : Sunday, February 8, 2009 9:37:17 AM(UTC)
Groups: Member
Joined: 2/6/2009(UTC)
Posts: 5
Location: canadna

Quote:

Moderator edit: the best way fix the problem of running 32-bit web applications on 64-bit systems is to get UltiDev Web Server Pro.


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
#2 Posted : Sunday, February 8, 2009 2:48:59 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
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.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
taxnic
#3 Posted : Sunday, February 15, 2009 8:58:34 AM(UTC)
Groups: Member
Joined: 2/6/2009(UTC)
Posts: 5
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
#4 Posted : Sunday, February 15, 2009 7:07:04 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
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.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
taxnic
#5 Posted : Wednesday, February 18, 2009 2:22:57 PM(UTC)
Groups: Member
Joined: 2/6/2009(UTC)
Posts: 5
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
#6 Posted : Thursday, February 19, 2009 4:45:07 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
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.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
taxnic
#7 Posted : Thursday, February 19, 2009 7:18:35 AM(UTC)
Groups: Member
Joined: 2/6/2009(UTC)
Posts: 5
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
#8 Posted : Thursday, February 19, 2009 10:49:41 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
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.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
mike
#9 Posted : Sunday, February 22, 2009 12:40:28 PM(UTC)
Groups: Member
Joined: 2/22/2009(UTC)
Posts: 1

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
#10 Posted : Sunday, February 22, 2009 1:20:04 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
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.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
taxnic
#11 Posted : Monday, February 23, 2009 8:44:08 PM(UTC)
Groups: Member
Joined: 2/6/2009(UTC)
Posts: 5
Location: canadna

Hi UltiDev Team,

The x32 EXE files do resolve the issue.

Thanks so much
Ultidev Team
#12 Posted : Tuesday, February 24, 2009 4:19:43 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Always happy to help!

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
nickexe
#13 Posted : Wednesday, April 1, 2009 1:33:29 AM(UTC)
Groups: Member
Joined: 4/1/2009(UTC)
Posts: 1
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
#14 Posted : Wednesday, April 1, 2009 8:48:23 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Done.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
devuser
#15 Posted : Thursday, April 2, 2009 12:33:32 AM(UTC)
Groups: Member
Joined: 4/2/2009(UTC)
Posts: 3

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
#16 Posted : Thursday, April 2, 2009 7:49:56 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Done.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
devuser
#17 Posted : Friday, April 10, 2009 2:24:40 AM(UTC)
Groups: Member
Joined: 4/2/2009(UTC)
Posts: 3

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
#18 Posted : Friday, April 10, 2009 5:29:13 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
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.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
devuser
#19 Posted : Wednesday, April 15, 2009 12:09:45 AM(UTC)
Groups: Member
Joined: 4/2/2009(UTC)
Posts: 3

Thanks a lot for your help.

It works now.

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

Thanks
Ultidev Team
#20 Posted : Wednesday, April 15, 2009 6:57:14 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
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.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
1 user thanked Ultidev Team for this useful post.
fotso on 9/7/2019(UTC)
Rss Feed  Atom Feed
Users browsing this topic
Guest (44)
11 Pages123>»
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 can vote in polls in this forum.