简体   繁体   中英

visual studio extensibilty - How can I check if Silverlight debugging is enabled in an ASP.NET Web Site?

How can I programatically check whether a Web Site has Silverlight debugging enabled (ie, whether the "Silverlight" checkbox under "Property Pages->Start Options" is checked)?

I know that for a Web Application (WAP), I can check this via EnvDTE ( by checking project.Properties.Item("WebApplication.SilverlightDebugging").Value ), but for a Web Site , I can't find an equivalent property.

For a Web Site project, there are properties named EnableASPXDebugging, EnableUnmanagedDebugging, and EnableSQLServerDebugging, but strangely there is no EnableSilverlightDebugging property. This might be a bug in Visual Studio.

Properties for Web Site projects are saved to the following file:

C:\\Users\\username\\AppData\\Local\\Microsoft\\WebsiteCache\\Websites.xml

As a last resort, you can parse the file and read the value of the enablesilverlightdebugging attribute for your particular <Website> . Unfortunately, it seems that this file does not get updated until the project is closed, so the file may be out of sync with the actual setting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM