CD Burning within an XBAP

284 views Asked by At

I have an XBAP that needs to be able to burn cd's. When running from inside Visual Studio, everything works okay. However when running from a browser, the IMAPI dll reports that the environment is not supported as soon as it tries to access the drive.

I am assuming this is coming down to permissioning. I have a signed certificate which I have installed and the xbap is set to run as a full trust application (although I'm guessing that it can't be or I wouldn't be having this problem).

Currently this is all running on my local machine, however eventually I want this to be deployed to a web server (all users will already have the certificate installed on their clients).

Does anyone have any ideas as to what I've missed / done wrong?

Update:

I have tried creating a new, test certificate which I've installed in my certificate store and then signed the XBAP against it, but it makes no difference.

Really could do with some ideas if anyone has any?

Further Update:

I have created a console application which is able to burn cd's. Shelling out to this console application allows me to burn the cd from my xbap, but not from inside the xbap itself.

However, this is really not what I want. Ideally I want to have all this contained within the xbap. Failing that, is there a way to include the console application in the xbap's one click deployment?

Thanks

2

There are 2 answers

0
Judah Gabriel Himango On

I believe this is not possible to do with XBAP. According to MS documentation on XBAPs,

Examples of permissions not available in the Internet zone:

  • FileIOPermission - This permission controls the ability to read and write files on disk. Consequently, applications in the Internet zone cannot read files on the user's hard disk.

  • RegistryPermission - This permission controls the ability to read/write to the registry. Consequently, applications in the Internet zone cannot access or control state in the user's registry.

  • SecurityPermission.UnmanagedCode - This permission controls the ability to call native Win32 functions.

When you run your XBAP over the internet, you'll hit issue #3: trying to interop with unmanaged code.

I would recommend deploying your app as a stand-alone app with ClickOnce. That way, you can have full access to the system, but still get easy deployment and upgrades like you do with XBAP.


*edit*

One thing you could try -- and I can't guarantee it will work -- but you could have your users go into IE Internet Options, add your site to the trusted sites list. I'm betting then your CD burning code will work because it will be in the trusted zone, rather than the Internet Zone.

0
Krill On

Try going to

HKLM\SOFTWARE\Microsoft.NETFramework\Windows Presentation Foundation\Hosting

in the registry

create a new DWORD named RunUnrestricted with value 1.