Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add debug assemblies to my Silverlight 2 application?

So I know now that the debug assemblies have been intentionally left out of the Silverlight runtime to save space. For that reason I get good detailed error messages on my local machine that has the Silverlight SDK on it, but I don't on a computer with the runtime only. I get the ubiquitous, "Debugging resource strings are unavailable."

Unfortunately my requirements are a bit unique. I need to include the debug assembly (not sure which one yet) that will give me details of a regular expression error. And so essentially I want to include the dll in the xap if I can.

The problem is that I can't seem to do this. I've tried adding the debug dll's as references and setting them to "copy local." And I've tried adding them into the project as content. But in fact, with either method the xap hardly grows in size and the error message doesn't change.

Any ideas?

like image 927
Steve Wortham Avatar asked Jan 26 '26 22:01

Steve Wortham


2 Answers

You'll still need the actual Silverlight Developer Runtime to be installed (thus you get the errors etc on the machine you had the SDK installed on). Adding the debug assembly into a production solution and accessing it via the non-developer runtime isn't possible.

Scott Barnes / Rich Platforms Product Manager / Microsoft.

like image 151
Scott Barnes Avatar answered Jan 28 '26 19:01

Scott Barnes


So my solution to the problem was essentially to give up on what I was trying to do. Instead, I'm now calling a web service whenever an exception occurs around the regex. That web service has a function I made called GetRegexError.

Here's the code for it:

<WebMethod()> _
Public Function GetRegexError(ByVal strRegex As String, ByVal _regexOptions As RegexOptions) As String
    Try
        Dim _regex As New Regex(strRegex, _regexOptions)
    Catch ex As Exception
        Return ex.Message
    End Try

    Return ""
End Function

This is now implemented in Regex Hero. Thank you Scott for the help.

like image 37
Steve Wortham Avatar answered Jan 28 '26 20:01

Steve Wortham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!