Can't run Lightswitch 2012 Programm under Windows XP
Asked Answered
P

2

5

I've migrated a Lightswitch 2011 project to LS 2012. I start the compiled application by running "vslshost.exe". This works well using Windows 7 (32 and 64 Bit, but when I use Windows XP starting the application fails (vslshost.exe ist not a valid Win32-Application). Before switching to LS 2012 everything went fine.

The application is compiled as desktop application, it depends on a SQL Database which is avaiable and doesn't use the internal ApplicationData database. I can reproduce this on 2 PCs, both having Windows XP up to date.

After looking at vslshosts.exe with ildasm, I'm shure the project was compiled targeting .NET 4.0. So the Framework didn't change with migrating the project to LS 2012.

I wasn't able to find any information regarding this problem. I only came across some issues regarding Windows XP and C++ using VS 2012.

Do you have any information on this?

Thanks in advance!

Psoriasis answered 27/8, 2012 at 10:55 Comment(3)
Lightswitch uses .NET, right? What version of .NET are you targeting?Alkalize
thats a good question, as I'm not shure. I haven't found any options to change the target or to see what I'm targeting. It must be at least .NET 4.0, it may also be 4.5Psoriasis
it is .NET 4.0 - I'm shure now ;)Psoriasis
S
7

I had the same problem, managed to get it working by doing the following. I started up a Visual Studio Command Prompt and ran dumpbin on the executable:

dumpbin  /headers vslshost.exe

dumpbin showed that the sub system version was set to 6 (Vista). Strangely the OS version was set to 4. Following the instructions on this page http://supportxp.com/2012/03/30/editbins-dirty-little-secret/ I used editbin to set the version numbers to 5.1 (XP)

editbin vslshost.exe /SUBSYSTEM:WINDOWS,5.01 /OSVERSION:5.1

Tested it out and my application it working fine on XP so far. I also tried getting the generated installer to work but it failed on a function call to InitializeCriticalSectionEx which doesn't exist in XP.

Or you can deploy it as a desktop application with the services deployed to IIS. That method seems to support XP just fine.

Subirrigate answered 31/8, 2012 at 20:41 Comment(2)
Neil, you totally saved my day! thanks a lot! guy's, vote this up! i can't, thanks to reputation m(Psoriasis
We also had to run the following update for VS2012 (KB270250 from VS2012 Update 1 CTP 4) so that the ClickOnce bootstrapper would work for us: download.microsoft.com/download/1/D/4/…Thekla
A
0

The .NET Framework 4.5 requires at least Windows Vista. See the official system requirements.

When using Visual Studio 2012, you have to be careful to target .NET 4.0 if you want the application to run on Windows XP, and some features will not be available (for example, C# 5.0 await/async require runtime support only available in .NET 4.5).

Alkalize answered 28/8, 2012 at 15:39 Comment(2)
I had a look at the vslshost.exe using ildasm - the project was compiled using .NET 4.0. So the problem is another one :(Psoriasis
.NET 4.5 did not increment the version number of system assemblies, their versions remained at 4.0. Because ildasm looks only at managed metadata and code, it will not show any obvious differences between assemblies compiled with TargetFrameworkVersion V4.0 and V4.5. However, the native exe header is different, which can be seen using dumpbin (as Neil wrote in his answer).Sudduth

© 2022 - 2024 — McMap. All rights reserved.