Silverlight control-how to improve application trust and solve problems, silverlight Control

Source: Internet
Author: User

Silverlight control-how to improve application trust and solve problems, silverlight Control

From silverlight5, you can select "enhance trust when running in the browser" in the project settings to run the Elevation of Privilege silverlight client in the browser, which is very useful in a feature.

However, I encountered a strange fault when using this function: I used visual studio 2010 to develop a silverlight5 project and found that the above setting item did not work, whether or not I checked it or not, the App in the code. current. hasElevatedPermissions always returns false, and operations that require permission escalation will naturally fail. After several thousands of brain cells are exhausted, the cause of the fault is discovered.

When you select "enhance trust when running in a browser", visual studio will do the following:

1. Add the following content to the silverlight project file (. csproj): <RequireInBrowserElevation> true </RequireInBrowserElevation>

2. Add InBrowserSettings. xml to the Properties folder of the project.

3. Add the following content to the silverlight project file (. csproj): <InBrowserSettingsFile> Properties \ InBrowserSettings. xml </InBrowserSettingsFile>

If the above steps are successfully completed, there will be no problem. However, if the Properties folder of the project has a file named InBrowserSettings. xml, the following faults may occur:

1. This file is only in a folder and is not included in the project. Therefore, adding InBrowserSettings. xml to visual studio will fail, but will not prompt you. The result is that it seems that the "trust that needs to be improved when running in the browser" has been checked, but the silverlight operation permission has not been successfully upgraded, code that requires elevation of permission to run will fail, and I am overwhelmed by this inexplicable failure. To solve this problem, you can view all the files in Solution Explorer and set InBrowserSettings. xml is manually included in the project, and you can use NotePad to open the project file and manually add <InBrowserSettingsFile> Properties \ InBrowserSettings. xml </InBrowserSettingsFile>. If visual studio does not add the InBrowserSettings. xml file in the Properties folder after selecting "enhance trust when running in the browser", you can determine that the fault has been triggered.

2. This file is already in this folder and included in the project. Visual studio will try to change InBrowserSettings according to your check box. content in xml, if InBrowserSettings. the xml file is in the read-only status (for example, it is checked in). When visual studio changes the file content, an error occurs. The result is that visual studio simply crashes and exits, no prompt will be given to you before exiting. Therefore, before you change the check box of "trust to be improved when running in the browser", if. the xml file has been checked in or is read-only for other reasons. Check it out or remove the read-only attribute in advance.

Among the above two faults, the 1st fault causes are very hidden. I used to wonder why it happened to have a file named InBrowserSettings. xml IN THE Properties folder. Later, I asked my colleagues to find out the reason. This is not a coincidence. My colleague once tried to check "the trust that needs to be elevated when running in a browser", and visual studio added InBrowserSettings in his project. xml. After the test, he canceled his operations by revoking the checked-out project. He thinks that this will completely roll back his action, but in fact it is not. to undo the check-out, it is just to undo the project that contains InBrowserSettings. the xml file is not deleted in the project folder, so when the project is checked in again, InBrowserSettings. xml will be checked in to TFS. When a new version is obtained, another colleague will include InBrowserSettings in the project. the xml file is concealed in the Properties folder, causing this fault.

I hope this will help you. Don't step on this mine.


How can enterprise website construction improve website trust?

1. Copyright Notice the copyright notice is very important in website design. A website without a copyright notice is not trustworthy.
No one in detail (About US) is willing to do business with "unknown objects. In online transaction behavior, the Company Introduction (About us) page of the website undertakes

The customer's task of "Constructing the local transaction entity. The clearer you describe, the easier it is to win the customer's trust. The common technique is to specify the company's establishment time and scale.

, Business scope, purpose, company address, contact number, contact person, email address, route, etc. You can use pictures to show your company's specific location and facade,

Office environment.
Contact information such as phone number, email address, and company address. These contact information should not only exist on the "Company Introduction" page, but also appear on every page.

2 can often be added to the copyright statement at the top or bottom of the page.
The appearance of industry or professional terms in the webpage text helps improve the trust level of the website.
This section lists the company's business or cooperation cases on the website to help increase the trust level of the website.
Customer feedback (messages) valuable and relevant customer feedback (emails, messages) helps improve the trust of the website.
Adding links to the same series, region, or well-known websites on the partner's website helps improve the trust of the website.
News is a website with a dedicated area on the homepage to publish the latest company information. The website with product information has a higher level of trust.
Exquisite pictures, flash, and rounded corners can reflect the company's technical strength and the importance it attaches to Internet customers. Websites with exquisite web pages are more credible than those with blurred images and poor typography.
Updating the website in a timely manner based on the festival or customs of the region object can narrow the distance between visitors and the website, and make visitors feel strongly that the website is specially cared, it is updated at any time.
Other user-friendly designs, such as introducing relevant knowledge and minimizing the number of forms (content) filled by customers

3. It is best to use the official language when you officially promote a website or product to the customer via email. Do not speak out. Unless it is for special groups or for special purposes.
If you use authoritative media to promote a website by advertising on a well-known website, you 'd better choose an authoritative website as a partner based on your own economic strength.

To increase trust, you must first trust you by others.

How does Silverlight add controls to the toolbox?

Use third-party Silverlight controls in applications
1. Open the XAML file in the main window of the project in the Silverlight designer. For example, you can open MainPage. xaml or UserControl1.xaml.
2. In the toolbox, select the tab to add the control.
3. Right-click the toolbox and select an item from the shortcut menu.
The Select toolbox dialog box is displayed. The Select toolbox option dialog box is displayed.
4. Click the Silverlight component tab.
5. In the list, find the control you want to use.
6. If no control is displayed in the list, Click Browse. In the displayed dialog box, navigate to the Assembly that contains the control to be used. Select the Assembly and click open.
Note: The Assembly and executable files must be Silverlight assembly and executable files. If you try to add a control contained in a dataset that is not a Silverlight assembly or executable file, a dialog box is displayed indicating that the component to be added to the toolkit is not present.
7. All controls contained in the dataset are displayed in the select toolbox items dialog box.
8. Add a check mark next to the control to be added, and click OK.
The selected control is displayed at the bottom of the Selected tab in the toolbox.
9. Drag the control from the toolbox to the design surface.
The selected widget appears on the design surface.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.