Comments
Sort by recent activity
I have to admit that was really fast of you to deliver a fix within one working day, well done! [image]
Patch works nicely, thanks for your help!:D
Best Regards,
John / comments
I have to admit that was really fast of you to deliver a fix within one working day, well done!
Patch works nicely, thanks for your help!:D
Best Regards,
John
Jasonauk,
I also noticed that the latest version (6.6.2.35) seems to have re-introduced it so my latest release of my software was, well, not as good as it was meant to be. I actually trusted SmartAssembly and didn't test my obfuscated release thoroughly. My bad. :oops:
I found out that you now at least could get it to work by adding the DoNotPrune attribute, that didn't work before. I've added that to all my flags-enums (which I use ToString() on) and is as happy as a bird.
Best Regards,
John / comments
Jasonauk,
I also noticed that the latest version (6.6.2.35) seems to have re-introduced it so my latest release of my software was, well, not as good as it was meant to be. I actually trusted Smart...
I'm using version 6.6.0.144, which I don't think qualify for "older version". :-)
You did however put me on the right track, it's the pruning the creates the issue. Enabling pruning creates the issue, disabling it removes the issue.
In SA I can add pruning exception on the "Flags" attribute which makes me able to enable pruning without creating the issue. However, programmaticly adding DoNotPrune or DoNotPruneType doesn't remove the issue.
I think that removing the Flags attribute when both DoNotPruneAttribute and DoNotPruneTypeAttribute are set is an error. What do you think?
SA automaticly detect the ToString() being used on the enum and do not obfuscate the names but still prune the FlagsAttribute. I think that is an error. What do you think?
Best Regards,
John / comments
I'm using version 6.6.0.144, which I don't think qualify for "older version". :-)
You did however put me on the right track, it's the pruning the creates the issue. Enabling pruning creates the iss...
Hi!
Just wanted to say that using a SerializationBinder worked perfectly. class LicenseInfoDeserializationBinder : SerializationBinder
{
public override Type BindToType(string assemblyName, string typeName)
{
if (assemblyName.StartsWith("OriginalFilenameWithoutExtension"))
{
// When the type being deserialized originates from original assembly
// redirect do current assembly, since it is the same
// but obfuscated
assemblyName = Assembly.GetExecutingAssembly().FullName;
}
// For each assemblyName/typeName that you want to deserialize to
// a different type, set typeToDeserialize to the desired type.
var typeToDeserialize = Type.GetType(String.Format("{0}, {1}",
typeName, assemblyName));
return typeToDeserialize;
}
}
Thank you for your help!
Best Regards,
John / comments
Hi!
Just wanted to say that using a SerializationBinder worked perfectly.class LicenseInfoDeserializationBinder : SerializationBinder
{
public override Type BindToType(string assemblyName...
Hi Brian,
All classes serialized are marked with the Serializable attribute already and when we created the serialized data the assemblies were strong signed.
When I use reflector on the merged assembly I can see all the classes with the Serializable attribute. When I'm testing they are unobfuscated and there is no control flow obfuscation.
Is there a "redirection functionality" which is supposed to handle redirection from the original filename and public key to the new assembly?
Best Regards,
John / comments
Hi Brian,
All classes serialized are marked with the Serializable attribute already and when we created the serialized data the assemblies were strong signed.
When I use reflector on the merged ass...
I added more logging and realized the exception occurs during deserialization of an object. I have (with your help) solved the issue: http://www.red-gate.com/messageboard/vi ... hp?t=14511
which means I can now merge the deseralization issue into the main assembly and this problem goes away.
Thanks for your help!
Best Regards,
John / comments
I added more logging and realized the exception occurs during deserialization of an object. I have (with your help) solved the issue:http://www.red-gate.com/messageboard/vi ... hp?t=14511
which mea...
Have you tried this with embedded assemblies (not merged)? I can't get that to work without adding the SA assemblies to the directory.
When the ReportException get called from the embedded assembly, it failes with
"Could not load file or assembly 'SmartAssembly.ReportException, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7f465a1c156d4d57' or one of its dependencies. The system cannot find the file specified."
Best regards,
John / comments
Have you tried this with embedded assemblies (not merged)? I can't get that to work without adding the SA assemblies to the directory.
When the ReportException get called from the embedded assembly...
Yes, removing the SmartAssemblyReportUsage registry entry on the other two assemblies makes the dialog re-appear, but not this one.
Is there any logging that can be enabled for the feature usage within the merged assembly?
I suppose the default template is the one included in SA. If you look on line 21 it sets the registry value to false and AskUserForReportUsageConfirm(). If something happens there it will have the exact same behavior that I'm experiencing. I think I'll try with a custom template (based on this) with more error handling.
Best Regards,
John / comments
Yes, removing the SmartAssemblyReportUsage registry entry on the other two assemblies makes the dialog re-appear, but not this one.
Is there any logging that can be enabled for the feature usage wi...
By adding message boxes in the UsageReporterWithUI sample I realized that the thread used for displaying the dialog for user permission is run on a background thread.
This means that when the console app is done on it's thread, all background threads are simply dismissed.
I added a Thread.Sleep in the console application and the dialog for the user pops up nicely. I can wait and then see it disappear once the application ends.
:idea: Perhaps there could be a checkbox to NOT make the thread a background thread in the saproj settings would be a good thing?
:idea: I note that once the reporting is added, the application takes another half second (roughly) to end and I suppose this is because of the actual reporting. During that time, you could also check if the reporting thread you spawned which is waiting for the user input has ended. Perhaps a Thread.Join would be a good thing at that point?
Best Regards,
John / comments
By adding message boxes in the UsageReporterWithUI sample I realized that the thread used for displaying the dialog for user permission is run on a background thread.
This means that when the conso...
Hi Brian!
Yes, I'm trying to handle feature usage in the common dlls for the three projects. However, since I read somewhere that to get the feature usage template working I need to set the ReportUsage on the entry method, which I've done for both the console apps: internal class Program
{
[ReportUsage("ApduScriptPlayer")]
[STAThread]
private static void Main(string[] args)
{
I'd be happy do upload the obfuscated assembly, project file or even the input assemblies to you, if you think it can help.
John / comments
Hi Brian!
Yes, I'm trying to handle feature usage in the common dlls for the three projects. However, since I read somewhere that to get the feature usage template working I need to set the ReportU...