Home Dashboard Directory Help
Search

Not can used DirectX with VisualStudio 2010 (VB) under Windows 7 by Chris69


Status: 

Closed
 as Won't Fix Help for as Won't Fix


3
0
Sign in
to vote
Type: Bug
ID: 519801
Opened: 12/11/2009 6:58:58 AM
Access Restriction: Public
2
Workaround(s)
view
1
User(s) can reproduce this bug

Description

Visual Studio 2010 (VB) and DirectX under Windows 7 Framework 4 Beta 2

I will set under Project referencing Microsoft.DirectX Assembl.
under VisualStudio 2008 DirectX is in the List of .Net Assemblys.
under VisualStudio 2010 not.

i go to the page Search and then i get the Assemblys from C:\Windows\Microsoft.net\ManagedDirectX
now all ok.

then i will create a Device Object. then comes a Error
FileLoadExeption

The assembly in mixed mode was created during the lifetime version v1.1.4322 and can not be loaded during the 4.0-duration without additional configuration information.

Details
Sign in to post a comment.
Posted by Michael Klucher on 1/8/2010 at 9:21 AM
Hello, I'm a Program Manager from the XNA Game Studio team. To answer some of your questions:

Much of the Managed DirectX work went into the XNA Framework (Part of XNA Game Studio) as there is no longer any active work going into the Managed DirectX Product.

While XNA Game Studio can be used for applications, it is focused mainly on games, there is some information on using XNA Game Studio with Windows Forms at http://creators.xna.com that you could look at.

XNA Game Studio only supports the C# language at this time, you can use VB.NET on Windows, but you may run into unforeseen problems and issues because the product has not been tested with any other language.

XNA Game Studio is only available in English and Japanese at this time.

I would encourage you to visit our website at http://creators.xna.com where you can get much more information on the XNA Framework and XNA Game Studio, you can also visit our forums at http://forums.xna.com where other users may be able to tell you if what you want is possible with our tools.

Thanks,
Michael
Posted by Noah Falk - MSFT on 1/7/2010 at 1:34 PM
I assume you can use VB.NET just fine with XNA on windows. You are correct that XNA is geared towards games, though it may be applicable to non-gaming scenarios as well. I am trying to get someone from the XNA team to assist you with these questions because I am not as up-to-date in those technologies. I am still awaiting a response from them. Thanks,
-Noah
.Net CLR
Posted by Chris69 on 1/4/2010 at 10:35 PM
Thanks for your Help Noah Falk,
- is XNA the official successor from DirectX ?
- we are not write Games. We are create Graphic-Applications.
- can i used XNA with VB.net? All descriptions are in C#
- how gives a german SDK?

Christian
Posted by Noah Falk - MSFT on 1/4/2010 at 2:45 PM
Hello again Chris69,
I followed up with the XNA team and they said MDX was officially deprecated and that XNA is best thing to use for creating games. If you try out XNA the experience should be a lot better, but of course if you do run into trouble please let us know and we will see what we can do. Hope that helps,
-Noah Falk
.Net Framework CLR
Posted by Noah Falk - MSFT on 12/29/2009 at 5:34 PM
Hello Chris69,
The managed DirectX 1.1 assembly is a mixed managed/native assembly and as of CLR v4, these assemblies no longer automatically load. There was a long standing issue with these assemblies described here,
http://msdn.microsoft.com/en-us/library/aa290048(VS.71).aspx , that causes them to sometimes deadlock the process. In order to avoid this the v4 CLR requires that explicitly opt in to this risky back compat behavior by modifying your config file like this:

<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>


However once you do this it is quite likely that you will then deadlock your process during debugging. You may be able to work around that issue as well by following some of the advice here:
http://www.thezbuffer.com/articles/304.aspx

Your mileage may vary, in some cases this has worked around the problem and in other cases it has not. I am following up with the Managed DirectX / XNA team and I am anticipating their guidance will be to use XNA Framework. It is likely the XNA Framework doesn't suffer from the same LoaderLock issue present in MDX 1.1.

Because of the holidays many people are not in the office but I will update you once I have gotten in touch with someone. In the meantime I hope these suggestions are helpful for you and we really appreciate you taking the time to use the Beta and give us your feedback. Thanks!

-Noah Falk
.Net Framework CLR
Posted by Microsoft on 12/20/2009 at 2:46 AM
We were able to reproduce the issue you are seeing. We are routing 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.
Thanks again for your efforts!
Posted by Chris69 on 12/16/2009 at 11:25 PM
ok. I have upload a smal Zip Project.
when the programm comes to the first element from the Assembly
then hang it on.
my DirectX and Direct3D assembly is in the project include.

Greatings
Christian

Posted by Microsoft on 12/16/2009 at 6:55 PM
Hi,

We were still unable to reproduce the issue as you said.Colud you please attach a zipped project file?

Thanks!
Posted by Microsoft on 12/16/2009 at 6:55 PM
Hi,

We were still unable to reproduce the issue as you said.Colud you please attach a zipped project file?

Thanks!
Posted by Chris69 on 12/16/2009 at 8:09 AM
// Under Framework 4

'// Set Presentparameters
dim PP as new PresentParameters()
pp.AutoDepthStencilFormat = DepthFormat.D16
pp.EnableAutoDepthStencil = True
pp.SwapEffect = SwapEffect.Discard
pp.Windowed = true
pp.PresentationInterval = PresentInterval.one

'// Create 3D Device Object (hwnd is a Handle from Drawing Surface (PictureBox.Handle))
dim mDevice as Direct3D.Device(0,Direct3D.DeviceType.Hardware, hwnd,Direct3D.CreateFlags.SoftwareVertexProcessing,pp)


From Framework 2 to Framework 3.5 is all OK !
When i write this code with Framework 4 Beta 2 then the Device Object can't create.
then comes follow Exeption Message

The assembly in mixed mode was created during the lifetime version v1.1.4322 and can not be loaded during the 4.0-duration without additional configuration information.
Posted by Microsoft on 12/16/2009 at 5:59 AM
Hi,

To help us better understand the scenario, Could you please attach your code?

Thanks!
Posted by Chris69 on 12/14/2009 at 9:35 AM
Yes i now. Under Framework 3.5 is all OK but under Framework 4 not.

Has Framework 4 no DirectX compatibility ?
or come it in the release Version?

Greatings
Christian
Posted by Microsoft on 12/14/2009 at 3:58 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Posted by jdraughn on 12/12/2009 at 1:26 AM
If you go into your project properties, click on the "Compile" option, click the "Advanced Compile Options" button on the bottom of that page, you can change the .Net version. Going from 4.0 to 3.5 allows my project to compile without that error.
Posted by jdraughn on 12/12/2009 at 1:21 AM
I'm stuck at this point too, still searching for a solution. I'm trying to learn how to use directx to create a simple game like Tetris and would prefer to learn with the newest software (Windows 7, VS 2010 Beta 2, ect...) possible.
Sign in to post a workaround.
Posted by androidi on 1/29/2011 at 3:26 PM
I need to add that incase
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>

works for you then in Debug mode you may start getting Loader lock error. It can be disabled from Debug/Exceptions/Managed debugging assistants.
Posted by androidi on 1/29/2011 at 3:11 PM
I haven't tested this but it's worth trying: create app.config with:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>

Found this suggestion from
http://stackoverflow.com/questions/1751179/managed-directx-running-from-net-framework-4-0-app-dont-hunt
as my non-game app use managed directx.
File Name Submitted By Submitted On File Size  
DX9Net4Beta2Test.zip (restricted) 12/16/2009 -