Removing PoweredByAttribute
![Eaton](https://us.v-cdn.net/6029854/uploads/defaultavatar/nZUSABQN8JEE0.jpg)
How do I prevent this from being added to my assembly? A third party component I use usually reports the file version, but for some reason, it reports the version of SA that was used to protect my assembly... So I open my exe in a hex editor and do a search for the string.
It found an instance: http://img571.imageshack.us/img571/1732/pbafrg.png
When I modify that string, it the 3rd party component reflects the change! I would just edit it there, but sadly, my version is one byte longer and adding that will break the application.
Please tell me how to remove the attribute.
It found an instance: http://img571.imageshack.us/img571/1732/pbafrg.png
When I modify that string, it the 3rd party component reflects the change! I would just edit it there, but sadly, my version is one byte longer and adding that will break the application.
Please tell me how to remove the attribute.
Comments
Add a node called "DoNotAddPoweredByAttribute" in the "Options" section of the SmartAssembly.settings file.
However, you should really log a bug with the third party component as it is picking up the version number of a reference assembly, which is just wrong (it may as well just always return 2.0.0.0 - which could be the version of the .NET Framework core libraries).
Also, I can't get your workaround to work. Is this correct? Because that is not working.
Also, why is it not recommended to do that?
http://img641.imageshack.us/img641/5119/errorgj.png
I backed up my old project file so I tried that and I still got the error. So I am guessing it is a recent change in my application that is causing this.
However, in the EAP forum, which doesn't appear to be here anymore, I recall someone having this error. He had two versions of mscorlib referenced. I open my application in Reflector and I have two referenced! .NET 2 and 4.
Any idea on how to remove that reference? It isn't in the References in the project itself in VS.
I'm also getting a similar error. Reflector also shows that mscorlib is referenced twice for version 4.0 and 2.0. Depending on which settings I choose in SmartAssembly, I can get the error to refer to either System.Tuple, Action(T1, T2) or Func<T, TResult>, etc. It always seems to be a construct that has been introduced since .Net 2.0. This makes me think that SmartAssembly is getting confused as to which version of .net it is meant to be building against. Haven't worked out a way of getting it to work yet.
SmartAssembly should look at the version of mscorlib referenced and from that and a few other hints link against the correct version of the framework.
// Assembly Reference mscorlib
Version: 2.0.0.0
Name: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly Reference mscorlib
Version: 4.0.0.0
Name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
That is what I am doing, I open my unprotected assembly in Reflector and there are two references. I can't look at a protected version because it gives me a build error every time.
Sorry yes.
OK, well that narrows down the problem slightly. If you have a look in the *.csproj (or *.vbproj) in notepad or similar does it mention both versions of mscorlib?
I have done some very intensive research on this matter. I have checked my project file for references to mscorlib, but none exist. All of the other references are there, but none to mscorlib at all.
I then proceeded to start a new project and put all of my classes and forms into it. Still the same issue.
Let me know if you need anything else. I am more than happy to help you make SmartAssembly a better product.
If you pass a non-primitive core framework object to a method in a reference assembly which depends on a different version of the .NET framework then it will automatically add a reference to this different version.
For instance in the code you sent Eaton, there was a call to because the DevExpress dll was linked against the CLR 2.0 the System.EventHandler that had to be passed was the one in mscorlib 2.0 rather than the one in mscorlib 4.0 (which to the .NET framework is completely different although implicitly cast-able), so the reference was automatically added.
The developers will fix SmartAssembly so that it copes with this situation, now we know what the problem is.
Thank you very much for all your help.
Glad you guys found out what was happening. Looking forward to the next release.