Home - Forums-.NET - Spices.Net - Obfuscator: LINQ2SQL problem

Spices.Net

NET code security, tools to protect, obfuscate, tamper defense, code and data safety, recover, convert, optimize, explore, browse and analyze .Net software.

This forum related to following products: Spices.Net Suite, Spices.Net Obfuscator, Spices.Net Decompiler

Obfuscator: LINQ2SQL problem
Link Posted: 19-Dec-2011 04:43
The program crashes if I use LINQ2SQL.
I have a classes linked to DB via LINQ2SQL. Visual Studio generates code for this classes, so I cannot mark it with attribute [NotObfuscate].
Here is example (from file *.designer.cs):

[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.DataCrew")]
public partial class DataCrew : INotifyPropertyChanging, INotifyPropertyChanged
{
     private System.Guid _Id;
     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     public System.Guid Id
     {
        get { return this._Id; }
        set { ... }
     }
     ...
}

Any ideas to solve problem?
Link Posted: 19-Dec-2011 11:45
You can use Spices.Project's ExclusionPatterns collection of regular expressions to exclude the namespace with autogenerated classes from obfuscation, for example: MyCompany.MyNamespace.DataCrew* or if you would like to exclude just a member from this class:
MyCompany.MyNamespace.DataCrew._ld
or if you would like to exclude all members of this class: MyCompany.MyNamespace.DataCrew.*