What are the challenges you face when working across database platforms? Take the survey
Options

SA 6.7 with simple Wcf Service

Chris GorringeChris Gorringe Posts: 20 Bronze 2
edited February 15, 2013 10:38AM in SmartAssembly
I have a fairly simple Wcf service that performs some logic and interacts with a SQL database etc. This Wcf service is called by a number of SQL CLR triggers. If I obfuscate everything other than the Wcf service, it all works fine (I was surprised that the SQL CLR Triggers worked without extra fiddling). As soon as I obfuscate the Wcf service, the Wcf service starts to throw exceptions regarding security access to the Windows Event log. Although my service is capable of writing to the the Windows Event log, the functionality is switched off. If I turn of SA within MSBuild for the Wcf Service, it works correctly and does not attempt to write to the event log.

I have checked that all the service contract interfaces and classes are not obfuscated but it would appear that that is what SA does anyway.

I am only doing obfuscation with none of the other fancy SA tricks.

Any ideas why it might be going wrong?

Comments

  • Options
    I have solved my own problem but it does raise another question. The problem with the event log security was because the service did not have admin rights to create the event log source and the reason why it was creating an event log entry because it had escalated an error that it could not report on regarding Linq-to-SQL error.

    So my problem was Linq-to-SQL which I have now solved by excluding the data objects from obfuscation but because these objects are created by a designer rather than code, how can I decorate the classes with the DoNotObfuscate attribute and is it possible to change the Linq-to-SQL templates so that they are always decorated?
  • Options
    how can I decorate the classes with the DoNotObfuscate attribute and is it possible to change the Linq-to-SQL templates so that they are always decorated?

    I think you'll need to do this from the GUI. When you select an assembly to be obfuscated (or pruned) you get the option to Exclude any namespace, class, method or field.

    Can you please try this and see how it goes?[/quote]
  • Options
    I am already doing this as this is how I discovered to solution to my problem.

    What I want to do is to decorate the classes in code so that I do not have to go into the SA GUI to exclude the classes. As the code is generated by a designer in VS2010, I wanted to know how to decorate them without losing the information if the designer rebuilds the classes.

    Ideally, I want to amend the VS2010 templates so that all Linq-to-SQL code generated by VS is automatically decorated with the necessary information to prevent it from being obfuscated
Sign In or Register to comment.