Comments
Sort by recent activity
I tried both, like the following:
[DoNotPruneType]
public static class X
{
[DoNotPrune]
public static IY Y { get { return new Y(); }
}
This didn't help.
Only by excluding it through the configuration, would it go.
To be honest, I've given up applying "pruning" to anything in the project. The risk of instability it creates by taking something out that really is used has turned into a much bigger risk of just leaving any unused code in the project. / comments
I tried both, like the following:
[DoNotPruneType]
public static class X
{
[DoNotPrune]
public static IY Y { get { return new Y(); }
}
This didn't help.
Only by excluding it through the configurati...
I figured out what went wrong. Or at least what I needed to fix it.
I followed the instructions on this page about attributes: http://www.red-gate.com/supportcenter/c ... Attributes
I started w/ the first option listed on the page, and added a reference to SmartAssembly.Attributes.dll, and then later used the 2nd option.
Even though the app no longer actually needed the reference to the S/A dll, it was still being referenced. And when deployed, insisted it couldn't run w/out the S/A being in the GAC.
I removed the reference, built, and deployed, and the problem went away.
Still weird that option #1 would cause this though.
Seems #2 would've been listed first. / comments
I figured out what went wrong. Or at least what I needed to fix it.
I followed the instructions on this page about attributes:http://www.red-gate.com/supportcenter/c ... Attributes
I started w/ th...
Unfortunately, your link indicates it requires a Mono dll library attached to work.
I found I could do it by the following:
Using the Assembly object from the .exe, get referenced assemblies via:
assembly.GetReferencedAssemblies()
Then w/in one of my library .dll's that I know will be merged via S/A, I get it's assembly name:
Assembly.GetExecutingAssembly().GetName().FullName
I have noticed that this name will show up in the reference list when the app has NOT been obfuscated. But this name will disappear AFTER obfuscation (because it's no longer an external library, it's been merged w/ the .exe).
I use this fact to differentiate between the two states. / comments
Unfortunately, your link indicates it requires a Mono dll library attached to work.
I found I could do it by the following:
Using the Assembly object from the .exe, get referenced assemblies via:
a...
I've since discovered that this only seems to be happening when errors are occuring w/in one set of class libraries. (In my case, classes close to Prism libraries).
Other code tends to pop up the error dialog generally in 5 seconds. / comments
I've since discovered that this only seems to be happening when errors are occuring w/in one set of class libraries. (In my case, classes close to Prism libraries).
Other code tends to pop up the ...
I've been painfully determining what can and what cannot be pruned in our WPF type application. I had narrowed down a set of problems to a namespace full of interfaces, but that namespace also included the equivalent of implementation classes.
In the end, it turns out a few implementation classes had some methods that weren't part of their parent interfaces that were being cut out.
Anyway, got me wondering if I ever have to worry about [DoNotPruneType] on an interface.
So far, anything remotely behaving like a View Model in the MVVM pattern cannot be pruned. S/A doesn't check for property usage w/in XAML. And since WPF binds everything as "object", I doubt it could anyway. / comments
I've been painfully determining what can and what cannot be pruned in our WPF type application. I had narrowed down a set of problems to a namespace full of interfaces, but that namespace also inc...
It turns out that checkbox is important for S/A to work properly. I remember now I had turned that option off because I have a 3rd party .dll that wasn't signed, so I couldn't check it.
Fortunately, great article here shows how to fix that problem:
Signing an Unsigned Assembly http://buffered.io/posts/net-fu-signing ... y-signing/
Now, w/ all .dlls signed, I could check the box, sign the assembly, and run S/A, and run the program. / comments
It turns out that checkbox is important for S/A to work properly. I remember now I had turned that option off because I have a 3rd party .dll that wasn't signed, so I couldn't check it.
Fortunatel...
In my "real" project, the original output is strong-named signed, yes. In the "test" project, no.
I'm using the same .PFX file for all three cases. (Original signed + post-signed for the "real", post-signed for the "test") / comments
In my "real" project, the original output is strong-named signed, yes. In the "test" project, no.
I'm using the same .PFX file for all three cases. (Original signed + post-signed for the "real", ...
Well, I have an update. I started a brand new project (again) for more experimenting. This time however, I checked the project property Signing >> [X] Sign the assembly, and pointed it to the PFX file.
This time the project worked. Uncheck the option and it breaks again.
Seems S/A should warn against this situation, but at least I have something to focus on now on my "real" project. / comments
Well, I have an update. I started a brand new project (again) for more experimenting. This time however, I checked the project property Signing >> [X] Sign the assembly, and pointed it to the PFX...
When you try to run the obfuscated version, does the .config file exist in the same folder as the .exe?
This has caught me a few times. / comments
When you try to run the obfuscated version, does the .config file exist in the same folder as the .exe?
This has caught me a few times.
I had this problem too. My workaround is to add some code that directly references the .dll, even though the method that does so is never called in my code. [DoNotPrune]
public static class SmartAssemblyFix
{
public static Type ForceReferenceMethod()
{
return typeof([Namespace.Of.Library].[SomeClassInLibrary]);
}
}
/ comments
I had this problem too. My workaround is to add some code that directly references the .dll, even though the method that does so is never called in my code.[DoNotPrune]
public static class...