public bool Execute()
        {
            Log.Configure("LINQBridgeVs","SinjectionBuildTask");

            try
            {
                var snkCertificate = File.Exists(Snk) ? Snk : null;
                var sInjection = new SInjection(Assembly, mode: PatchMode.Debug, snkCertificatePath: snkCertificate);
                sInjection.Patch(SerializationTypes.BinarySerialization);
            }
            catch (Exception e)
            {
                Log.Write(e, @"Error Executing MSBuild Task SInjectionBuildTask ");
            }

            return true;
        }
Example #2
0
        private void InjectAssemblyReferences()
        {
            var currentPath = Path.GetDirectoryName(_assemblyLocation);

            _assemblyDefinition.MainModule.AssemblyReferences.Where(reference => !IsSystemAssembly(reference.FullName)).ToList().ForEach(
                reference =>
                {
                    if (currentPath == null) return;
                    var fileName = Path.Combine(currentPath, reference.Name + ".dll");
                    if (!File.Exists(fileName)) return;
                    var sinjection = new SInjection(fileName);
                    sinjection.Patch(SerializationTypes.BinarySerialization);
                });
        }