Red Gate forums :: View topic - SA 6.7 with simple Wcf Service
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

SA 6.7 with simple Wcf Service

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Chris Gorringe



Joined: 10 Nov 2010
Posts: 7

PostPosted: Thu Feb 14, 2013 3:51 pm    Post subject: SA 6.7 with simple Wcf Service Reply with quote

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?


Last edited by Chris Gorringe on Thu Feb 14, 2013 4:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
Chris Gorringe



Joined: 10 Nov 2010
Posts: 7

PostPosted: Thu Feb 14, 2013 4:24 pm    Post subject: SA 6.7 with simple Wcf Service Reply with quote

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?
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 586

PostPosted: Fri Feb 15, 2013 4:27 pm    Post subject: Reply with quote

Quote:
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]
Back to top
View user's profile Send private message
Chris Gorringe



Joined: 10 Nov 2010
Posts: 7

PostPosted: Fri Feb 15, 2013 4:38 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group