Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Could not load type 'SharpDX.Bool' from assembly 'SharpDX, Version=3.1.1.0 #448

Closed
przemo1983 opened this issue Feb 21, 2017 · 10 comments
Closed

Comments

@przemo1983
Copy link

There is no SharpDX.Bool in SharpDX, Version=3.1.1.0.
Accord.DirectShow version 3.4.0.

Is this issue in Accord lib or SharpDX?

@blaisexen
Copy link

There is a SharpDX.Bool in 3.4.0

@przemo1983
Copy link
Author

This is very strange.
I get following exception for these assemblies:

An unhandled exception of type 'System.TypeLoadException' occurred in mscorlib.dll

Additional information: Could not load type 'SharpDX.Bool' from assembly 'SharpDX, Version=3.1.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1'.

From

Source "Accord.Audio.DirectSound"

  StackTrace	"   at Accord.DirectSound.AudioCaptureDevice.WorkerThread()\r\n   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.ThreadHelper.ThreadStart()"	

I will try to reinstall all Accord libs.
Please note that I am trying to migrate Audio Recorder sample to my code. Audio recorder sample is run with other versions of assemblies (SharpDX version 2.6).

@przemo1983
Copy link
Author

przemo1983 commented Feb 22, 2017

I updated SharpDX assemblies in original Audio Recorder sample and in my case I have same exception at attempt to run app:

Additional information: Could not load type 'SharpDX.Bool' from assembly 'SharpDX, Version=3.1.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1'.

Could you please to install the latest libraries SharpDX and try to run Audio Recorder sample app?
Unfortunately this does not work either.

@przemo1983
Copy link
Author

Could you please give me any clue how to resolve this?
If there is an issue with SharpDX library itself I will create issue in that project.

When I reverted SharpDX and SharpDX.DirectSound versions to 2.6 an Audio Recorder sample started to work again (this sample uses 3.4.1-alpha Accord libraries).

Please see attached screenshots.
There is no SharpDX.Bool for 3.1.1.
sharpdx_3 1 1

There is a SharpDx.Bool for SharpDX 2.6.
sharpdx_2 6 0

@blaisexen
Copy link

blaisexen commented Feb 23, 2017

Hi,
Stay at the same version,
Accord.Net compiled with .Net4.0 and SharpDX compiled with .Net4.0

So don't use different version on each framework.

I hope you catch-up that now,
that should resolved your problem.

if you want .Net4.6 then use in both.

Good Luck!

@przemo1983
Copy link
Author

Thanks. For your help.

@fsteveb
Copy link

fsteveb commented Feb 23, 2017 via email

@blaisexen
Copy link

That's right too, nice to know Accord.Net users help each other.

@cesarsouza
Copy link
Member

Hi @przemo1983,

After some testing, I've found that the issue you are experiencing happens because the framework was so far targeting SharpDX 2.6.x. Between 2.x and their new 3.x there were some significant changes, including the removal of the SharpDX.Bool struct that has popped up in your error message.

The framework was targeting 2.6 because this was the last version of SharpDX that was still compatible with the CLR 2 (and therefore C# 3.5). Since I would still like the framework to support 3.5, I hadn't updated SharpDX yet.

However, after some testing, I realized that it is possible to link to different versions of SharpDX using some conditions in the .csproj project definition. So the next release will target SharpDX version 3.1.1 for the net40, net45 and net46 releases and SharpDX 2.6.3 for net35.

Sorry for the late response. So in short, if you would like to use the framework right now, you might have to revert back to an older version of SharpDX from the 2.6 branch.

Regards,
Cesar

@cesarsouza cesarsouza reopened this Feb 23, 2017
cesarsouza added a commit that referenced this issue Feb 23, 2017
…rsion=3.1.1.0

Updating SharpDX to 3.1.1 for CLR 4.0 builds, and 2.6.3 for CLR 2.0 builds.
@cesarsouza
Copy link
Member

Fixed in 3.5.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants