WavPlayer.dll error PublicKeyToken

Merlot2309

Active Member
Licensed User
Longtime User
Hello,

Thanks to the info I found here I finally tried to make a .dll and it works partly in B4P, on my PC.
Trying to compile it for the device I keep on getting the CS0012 error.

The type System.Media.SoundPlayer is defined in an assembly without a reference. You have to add a reference to the assembly System, Version=2.0.0.0, Culture=neutral, PublicKeyToken= bla, bla, bla.

After searching, reading and trying for 3 days I give up :BangHead:

It would be great if someone can tell me what is wrong.

Thanks in advance,
Helen.
 

Attachments

  • Wavje.sbp
    789 bytes · Views: 186

agraham

Expert
Licensed User
Longtime User
I can't open that project as I use VS2005 and the project was created by a later version. However looking at the source my guess is that you do not have the Compact Framework SDK 3.5 installed on your system or if you do you are not targetting that version. As far as I can see System.Media.SoundPlayer does not exist on earlier versions of the CF than 3.5. It also means that the dll will only work on devices with CF3.5 installed.
 

Merlot2309

Active Member
Licensed User
Longtime User
Hello Andrew,

Thank you very much for your reply.
In the Properties the Target Framework is: .NET Framework 3.5

At Solution Platforms in VS2008 the only option is: any CPU

The .NET CF 3.5 is installed and so is WM 6 Pro SDK + WM 6.5 Pro Dev.Tool Kit.

Does that give any clues?

Thanks and regards,
Helen
 

agraham

Expert
Licensed User
Longtime User
I don't know about VS2008 but in VS2005 you don't "compile for the device", you specify the target when you generate the project. In your csproj there is no mention of the Compact Framework (there would be in a VS2005 device project) it is targetting "Microsoft.CSharp.targets" and not "Microsoft.CompactFramework.CSharp.targets" which I would expect. This may be a red herring as I don't know VS2008 but otherwise the csproj contents look like I would expect. Are you sure you have got your configuration right?

Normally Basic4ppc libraries are compiled for the device and will run on the desktop because they are marked ""Retargetable" by the compiler. Only when the functionality is not identical between the Compact and full Framework are two separate libraries required, one each compiled for device and desktop.
 

Merlot2309

Active Member
Licensed User
Longtime User
Great (, ) Andrew,

You pointed me in the right direction.
I used a Windows class as project. The mobile class was somewhat hidden in VS 2008.

Added the new dll for device in B4P and ..........
ran into the fact that B4P is running with NET framework 2.0

So I guess that I'am blocked ?!?

Regards,
Helen.
 

agraham

Expert
Licensed User
Longtime User
So I guess that I'am blocked ?!?
Are you running a compiled exe? Does a program using that dll run on the device in the device IDE? If so try finding Basic4ppc.exe.config in the Basic4ppc program folder. Copy it to where your compiled exe and dll are located and rename it whatevermyexenameiscalled.exe.config and see if that works.
 

Merlot2309

Active Member
Licensed User
Longtime User
Hello Andrew and others,

Since I don't get the dll working in a VS 2008 mobile appl. (due to ?? the properties, events and methods don't show up) I decided to leave it for the moment.
Maybe I should start an action "Let's get Andrew VS 2008 or 2010" in the meantime (how selfish can I be, although I expect it's for everybodies benefit).

So: thank you for now and regards,
Helen.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…