silverlight 5 signing xap file

2019-02-11 11:34发布

I'm facing trouble with signing my Silverlight file (.xap) in a website. We're deploying this website in an intranet and, since we're accessing the usb port on the client, we definitely need to have elevated rights on the client machine.

I've read that it can be done by creating a certificate and install it on the client machine, and I followed the following article : http://msdn.microsoft.com/en-us/gg315158 . For tests purpose, I created a basic Silverlight control that display "You are elevated" or "You are not elevated" depending on the client configuration.

Now my problem is, I signed my xap file with my .pfx file, into Visual Studio, but I still don't have the elevated rights on the client machine. On my development machine, I receive the "You are elevated" message because of some dev configuration I guess...

I tried to install my certificate manually on my client machine but it still doesn't work.

When accessing my website, the silverlight control starts but display that I'm not in an elevated mode. It doesn't pop any message to ask the user to get the certificate or anything...

What am I missing ?

1条回答
Root(大扎)
2楼-- · 2019-02-11 11:41

Go to your Certificates and find the tab Trusted Publishers, your certificate should be there

Every client should have the certificate there.

Once you checked this and can confirm that everyone has this certificate, you should run this registry (64bit):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Silverlight]
"AllowElevatedTrustAppsInBrowser"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Silverlight\Components]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Silverlight\Components\Debugging]

(32bit)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Silverlight]
"AllowElevatedTrustAppsInBrowser"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Silverlight\Components]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Silverlight\Components\Debugging]

Just save this into a .txt file and rename it to .reg and run it. This should fix your problem.

查看更多
登录 后发表回答