Jump to content

  • Log In with Google      Sign In   
  • Create Account


SlimDX for .NET 4


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 Barguast   Members   -  Reputation: 181

Like
0Likes
Like

Posted 20 September 2010 - 10:00 PM

I'm currently testing distribute of a .NET 4.0 application which uses SlimDX. It works on my machine, but not on another.

I'm installing the June 2010 '.NET 2.0 End User Runtime' and I suspect this is the problem - mine is a .NET 4.0 application. Is there a .NET 4.0 End User Runtime, or am I barking up the wrong tree?

The error certainly looks like there is an assembly missing - I used to get a 'FileNotFoundException' but now am getting the following (from Event Viewer) after copying the SlimDX DLLs from the developer SDK.
Quote:
Exception Info: System.BadImageFormatException
Stack:
at TestApp01.Program.Main()


Just so I can rule it out, what pre-requisite steps do I need to do perform on other machines in order to prepare for .NET 4 / SlimDX applications?

Thanks.

Sponsor:

#2 Barguast   Members   -  Reputation: 181

Like
0Likes
Like

Posted 21 September 2010 - 02:18 AM

I just installed the Developer SDK on the target machine, and this caused the program to start working. I think this confirms that the End-User Runtime isn't sufficient, nor is including the .NET 4.0 / x86 SlimDX.dll with the executable.

Hopefully someone can let me know the file to distribute?

Thanks

#3 Mike.Popoloski   Crossbones+   -  Reputation: 2893

Like
0Likes
Like

Posted 21 September 2010 - 02:21 AM

We have plans to release a .NET 4 end user runtime, but they've been delayed thus far because the new VC redists for VS2010 have been separated into discrete x86 and x64 versions, making it impossible to use both together in a single installer.

We were looking for workarounds for this, but it doesn't look like we'll be able to avoid producing two separate installers.

Until such time, you'll need to distribute the .NET 4 DLLs alongside your app. You're getting a BadImageFormatException because you're referencing the wrong one for the given platform (x86 or x64).
Mike Popoloski | Journal | SlimDX

#4 Barguast   Members   -  Reputation: 181

Like
0Likes
Like

Posted 21 September 2010 - 02:33 AM

So I'll need to include the x86 or x64 DLL in with the executable, depending on whether they are using 32- or 64-bit Windows? That's doable.

Or will I need to build a separate 32- and 64-bit version of my application (each using the corresponding SlimDX version)? That's less doable! :p

Thanks for your reply.

#5 Mike.Popoloski   Crossbones+   -  Reputation: 2893

Like
0Likes
Like

Posted 21 September 2010 - 09:20 AM

I believe it should work to just include the DLL without having to rebuild the app, but I'm not 100% positive. Try it out and see [grin]
Mike Popoloski | Journal | SlimDX

#6 Barguast   Members   -  Reputation: 181

Like
0Likes
Like

Posted 07 October 2010 - 05:40 AM

Sorry to bump and basically repeat my question, but I've now gotten to the point where I want to get my application working on another machine.

Again, it's a .NET 4.0 application which uses the June 2010 distribution of SlimDX. So far, I've only been able to get it working on another (non-developer) machine by installing the full SDK, since there is no .NET 4.0 runtime.

Are there certain files within the SDK which I can distribute to get it working? I'm happy to detect whether the target machine is x86 or x64 if that's the complication.

Any help would be greatly appreciated.

Thanks.

#7 Mike.Popoloski   Crossbones+   -  Reputation: 2893

Like
0Likes
Like

Posted 07 October 2010 - 05:51 AM

You need four things installed in order to run a SlimDX application:

  • The .NET Framework.

  • The current DirectX runtime.

  • The Visual Studio 2010 runtime.

  • The SlimDX DLL.


The SlimDX runtime installer takes care of making sure that all but the first item are installed. For .NET 4, we don't provide an installer yet, so you'll have to make sure it's all there on your own.

The VC10 and the SlimDX DLL both have separate versions for x86 and x64. Make sure you include the correct version for your target platform.
Mike Popoloski | Journal | SlimDX

#8 Barguast   Members   -  Reputation: 181

Like
0Likes
Like

Posted 07 October 2010 - 12:39 PM

Thanks - I'll try this first thing tomorrow. :)

I'm assuming you meant to say 'Visual C++ Runtime' in your checklist? So I don't need SlimDX installed at all, I just need to drop the SlimDX.dll (from the net40 folder in the SDK) into the same application folder?

#9 Mike.Popoloski   Crossbones+   -  Reputation: 2893

Like
0Likes
Like

Posted 07 October 2010 - 12:42 PM

Quote:
Original post by Barguast
Thanks - I'll try this first thing tomorrow. :)

I'm assuming you meant to say 'Visual C++ Runtime' in your checklist? So I don't need SlimDX installed at all, I just need to drop the SlimDX.dll (from the net40 folder in the SDK) into the same application folder?


Correct.
Mike Popoloski | Journal | SlimDX

#10 Barguast   Members   -  Reputation: 181

Like
0Likes
Like

Posted 07 October 2010 - 10:19 PM

OK, I got it working on a x86 machine by installing the Visual C++ Runtime, and .NET 4.0. Easy. :)

However, my x64 test machine is still complaining with the 'BadImageFormatException' which I assume it because it doesn't like me dropping in the x64 SlimDX DLL to replace the x86 one it's built against.

Is there any way I can build my application to allow the appropriate SlimDX DLL to be dropped in? I've tried settings 'Specific Version' of the DLL reference to false, but this doesn't seem to have any effect.

#11 Mike.Popoloski   Crossbones+   -  Reputation: 2893

Like
0Likes
Like

Posted 08 October 2010 - 04:25 AM

How are you building the application? As AnyCPU, x86, x64, etc? Also, have you installed the x64 version of the VC++ Runtime? Starting with VS 2010 there are separate versions of that runtime.
Mike Popoloski | Journal | SlimDX

#12 Barguast   Members   -  Reputation: 181

Like
0Likes
Like

Posted 08 October 2010 - 04:49 AM

I -think- it was due to the Platform being 'Mixed Platform'. I altered this to 'Any CPU' and it seems to do the trick, however it also seems to have broken Visual Studio a bit - 'Build' > 'Rebuild' has no effect, but right-clicking a project and 'Rebuild' does..!

I can live with that though. Hopefully the Platform setting was the problem - I'm going to test it on some more machines to find out.

Thanks again.

#13 Mike.Popoloski   Crossbones+   -  Reputation: 2893

Like
0Likes
Like

Posted 08 October 2010 - 05:20 AM

The project is probably not set to build in that configuration. Open up the configuration manager and make sure the project is checked off as being included.
Mike Popoloski | Journal | SlimDX




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS