Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compiling for 'AnyCPU' through errors
Message
From
07/04/2011 04:10:35
 
 
To
06/04/2011 17:47:47
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01506035
Message ID:
01506336
Views:
54
>no need to appologize - I am the one with pretty much no knowledge :-)
>
>As a console app it get 4 and 8 respectivly for x86 and AnyCPU - no error

If that's true on both the development machine and the XP 64-bit box it would seem to rule out problems with access to the System.Linq namespace. But if your app runs OK as 64bit on the development machine but not when installed on the XP box the next step would probably be to, as mentioned before, trap globbaly for unhandled exceptions and hopefully get fuller information on what goes wrong. But if you are sure that the exception occurs on the line which enumerates the combobox.Items you could just temporarily wrap that in a try/catch and log it there.....

>
>
>
>
>>The code I gave was for a Console application (sorry, I should have been more explicit). At a guess,although I've not seen the error you are getting, you were trying to it in a WinForms app ?
>>
>>>Ok - now I am realy getting confused.
>>>
>>>I create a blank project, added a blank .vb file and inserted your one liner and the try catch (seperatly). I did not add any imports (specificly for the linq) or any references.
>>>
>>>The output looks ok
>>>8
>>>The thread 'vshost.RunParkingWindow' (0xff0) has exited with code 0 (0x0).
>>>The thread '<No Name>' (0x1290) has exited with code 0 (0x0).
>>>The program '[3156] Project1.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
>>>This is on the development machine (Win2003, 64-bit).
>>>
>>>On that same machine i ran my full app (no more linq code as far as I can tell - converted it all, and no more references to linq), but I am getting the error with System.Windows.Forms.dll when running this on the DevMachine in AnyCPU mode.
>>>
>>>
>>>
>>>
>>>
>>>>To be clear - did this occur when running the skeletal project I suggested. If not then try that. Is so try this:
Module Module1
>>>>    Sub Main()
>>>>        Console.WriteLine(IntPtr.Size.ToString())
>>>>        Try
>>>>            Dim em As System.Linq.ParallelExecutionMode = System.Linq.ParallelExecutionMode.Default
>>>>        Catch ex As Exception
>>>>            System.Diagnostics.Debugger.Break()
>>>>        End Try
>>>>        Console.ReadLine()
>>>>    End Sub
>>>>End Module
Console write should be '4' if running in a 32-bit environment, '8' for 64-bit. The catch may give you a bit more information on the exact nature of the problem if in the IDE (check for inner exceptions)
>>>>
>>>>FWIW I think the path you mention is normal for the framework DLL's - but if the exception occurs in the line that uses System.Linq I don't know there System.Windows.Forms.dll comes into it ?
>>>>Also, FWIW, I ran the above code on a 64-bit WIN7 machine in both 32 and 64 bit modes with no problem.
>>>>Where did you find any references to problems with System.Windows.Forms.dll on 64-bit ?
>>>>
>>>>
>>>>>Before I do that it occured to me that i am developing this on a win2003 64-bit machine. So instead of just building and then installing on another pc i run it right out of VS2010.
>>>>>
>>>>>There i get the following error running as AnyCPU:
>>>>>A first chance exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll
>>>>>'DMS DataEntry.exe': Loaded 'C:\Windows\System32\version.dll', Cannot find or open the PDB file
>>>>>An unhandled exception of type 'System.InvalidOperationException' occurred in DMS DataEntry.exe
>>>>>some research suggests that there is an issue with 64-bit version of System.Windows.Forms.dll. I looked where the file is comming from (in the properties) and it comes from "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll" - notice the "x86" - but so do most of the other dlls listed in the references.
>>>>>
>>>>>I also tried to add an exeption routine to my app - ran into problems. But I think i start a seperate thread for that.
>>>>>
>>>>>Thanks.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>As per the namespace the ParallelExecutionMode enum *needs* System.Linq. The question was whether use of just that line also causes an exception on the XP/64 machine. See if this one-line project will run:
Module Module1
>>>>>>    Sub Main()
>>>>>>        Dim em As System.Linq.ParallelExecutionMode = System.Linq.ParallelExecutionMode.Default
>>>>>>    End Sub
>>>>>>End Module
Also, as mentioned earlier, look at catching unhandled exceptions in code - that will give you more information on the exception details.
>>>>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform