.NET and Activator.CreateInstance on x64 - by M. Schwarz

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 467474 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 6/16/2009 2:15:08 AM
Access Restriction Public

Description

My old C++ application has created an instance of the VBScript (or JScript) script hosting interface IActiveScriptParse32. Using the GUID BB1A2AE2-A4F9-11CF-8F20-00805F2CD064 I could get the interface and work with the instance. I compiled the C++ application using to a x64 application and it is till working.

Now, I ported the application to .NET C#, using the code in "Steps to Reproduce". When compiled with "Any Cpu" it is working on x86 but not on x64. To get it working on systems with x64 .NET I have to use corflags.exe to set the compiled EXE to 32bit or to use x86 in the compile options in VS.
Sign in to post a comment.
Posted by M. Schwarz on 6/19/2009 at 3:44 AM
Well, I have uploaded a C++ project where I have tested x86 and x64 outputs, both working on my x64 machine.

At http://www.koders.com/csharp/fidFE726C3F9EFE93E72AF241DBD7A6970345AE0835.aspx?s=C7EF7658-E1EE-480E-97EA-D52CB4D76D17 I found that there is a source file for JScript scripting support. The wrapper is what we need. I didn't realized that there is a x64 version of IActiveScriptParse64.

Michael
Posted by Microsoft on 6/17/2009 at 2:21 PM
I've downloaded and tried your repro and it looks to me like the behavior between the managed app and native apps are consistent when running in both x86 and x64 processes. It seems that that interface is not supported by the 64-bit version of the native library. I get E_NOINTERFACE when I try to get it from and x64 native C++ exe as well. When I do the same thing from a 32 bit native C++ exe everything works great.

Any CPU is fine for managed applications that don't have any architecture specific dependencies: it will run on 32 bit processes in a 32bit a OS and in 64 bit processes on 64 bit processes in a 64 bit OS. If your application has a architecture specific dependency, as your application seems to, you need to use that specific architecture when compiling your application (in this case x86).

Does that help?

Thank you,
The CLR Team
Posted by Microsoft on 6/17/2009 at 1:56 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you,
Visual Studio Product Team
Posted by M. Schwarz on 6/16/2009 at 11:26 PM
I have attached my simple demo project. You'll find a screenshot in the project, too.
Posted by Microsoft on 6/16/2009 at 11:07 PM
Thanks for reporting this issue. In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided. If possible, could you please give us a demo project to demonstrate this issue so that we can conduct further research?

It is very important for us to resolve the issue more efficiently. Thanks for your cooperation and patience. Please rest assured that it is for test purpose only. I have created a Workspace for you. Please upload the project file to it. Thanks for your time.