Visual studio problem with obfuscated libraries!

  • Thread starter Bob Powell [MVP]
  • Start date
B

Bob Powell [MVP]

K

+-={K-SoL}=-+

I'm really sorry for the incontinence, I have already changed my system's
date and I hope you understand that I had no intention on changing the
system date, it was put back because I was testing a piece of code and
forgot to fix it after!
 
N

Niki Estner

There is a trivial solution to your problem.
I assume you don't need it before 04/18 (the date of your post).
Otherwise, please change your system time.

Niki
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

So, the problem is basically this. The idiots who created the obfuscated
control don't understand that you are not supposed to obfuscate public
stuff, like methods, namespaces, et al. I would write a rather nasty email
and let them hear my two cents, as obfuscation is for the white box code
only.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************************************************
Think outside the box!
***************************************************************
 
J

Jon Skeet [C# MVP]

Cowboy (Gregory A. Beamer) said:
So, the problem is basically this. The idiots who created the obfuscated
control don't understand that you are not supposed to obfuscate public
stuff, like methods, namespaces, et al. I would write a rather nasty email
and let them hear my two cents, as obfuscation is for the white box code
only.

No, I don't believe that *is* the problem.

The problem is that the SandBar library has an internal class named
"a", and the SharpLibrary library has a namespace named "a". Nothing
public about either of them - but they still clash as far as the CLR
(or C# compiler) is concerned.

Where obfuscators are to blame here is in not maintaining some degree
of uniqueness by using *some* unique namespace to ensure things won't
clash. Alternatively, possibly the CLR (or its specifications, or the
C# compiler) are at fault for not allowing different assemblies to
clash in this way for internal classes and namespaces containing only
internal classes.
 
S

skc

I assume you don't need it before 04/18 (the date of your post).
Otherwise, please change your system time.

I thought what did K-sol do to make his thread appear always at the top of
all threads :).
Perhaps all postings should use the date of the server rather than our PC.
 
C

C# Learner

skc said:
I thought what did K-sol do to make his thread appear always at the top of
all threads :).
Perhaps all postings should use the date of the server rather than our PC.

I believe that Thunderbird, here, is sorting the initial thread posts by
the order that they were received by the server, not by the alleged date
specified by the sender. The original post in this thread isn't at the
top of the list at all, here.

Other good newsreaders have this ability too.
 
N

Niki Estner

C# Learner said:
PC.

I believe that Thunderbird, here, is sorting the initial thread posts by
the order that they were received by the server, not by the alleged date
specified by the sender. The original post in this thread isn't at the
top of the list at all, here.

Other good newsreaders have this ability too.

Unfortunately Outlook Express - which K-Sol, skc and myself use - doesn't
(or I don't know how to configure it).
It's quite annoying to have an old post on top of the list on almost every
dotnet ng for two weeks, so I guess k-sol can also wait for an answer.
Moral: If you're asking other people for help, being rude won't help!

Niki
 
S

skc

Unfortunately Outlook Express - which K-Sol, skc and myself use - doesn't
(or I don't know how to configure it).
It's quite annoying to have an old post on top of the list on almost every
dotnet ng for two weeks, so I guess k-sol can also wait for an answer.
Moral: If you're asking other people for help, being rude won't help!

I don't think he was rude, just that it was a mistake. It's fortunate his
Year is 2004 - what if it was 2044? :)
 
N

Niki Estner

I don't think he was rude, just that it was a mistake.

You think so?
He posted his request titled "Cannot declare a namespace and a type both
named 'a' " on Apr/05/04, didn't get an answer for one day, so he posted the
same question again, this time with his system time set to Apr/18/04.
Pretty strange coincidence, isn't it?
It's fortunate his Year is 2004 - what if it was 2044? :)

I'm pretty sure MS would have killed the thread then.

Niki
 
N

news

The problem is that the SandBar library has an internal class named
"a", and the SharpLibrary library has a namespace named "a". Nothing
public about either of them - but they still clash as far as the CLR
(or C# compiler) is concerned.

Internal classes can have the same namespace and type names. Try it
yourself. As far as the runtime is concerned the true identity of a type
includes the assembly identity - so A.A.A in foo.dll is a different type
than A.A.A in bar.dll. Actually, A.A.A in two different strong name versions
of foo.dll are different types. This enables a scenario like:
- I buy the FooMenu control.
- I buy the BarImage control.

Each of these controls use different versions of the BazFlooble component,
which is strong named and stored in the GAC. As you would expect, when a
component is versioned, many of the types appear to have the same text
names - but the runtime will enable FooMenu and BarImage to bind to the
proper versions of BazFlooble.

Here's the code that demonstrates duplicate internal type names:

//In assembly foo.bar:
namespace A
{
public class BB
{
public int C;
public static int GetD()
{
D d = new D();
d.E = 42;
return d.E;
}
}

internal class D
{
internal int E;
}
}
===================
//In assembly bar.dll:
namespace A
{
public class BA
{
public int C;
public static int GetD()
{
D d = new D();
d.E = 42;
return d.E;
}
}

internal class D
{
internal int E;
}
}

========
// In your main method:
Console.WriteLine(A.BA.GetD());
Console.WriteLine(A.BB.GetD());
 
J

J.Marsch

Can you suggest any good Newsreaders? I'm fed up with OE -- has some kind
of bug where it doesn't always download updates to threads that I have
posted on -- I have to reset the folders every couple of weeks (and thereby
lose all of my watches)
 
C

C# Learner

J.Marsch said:
Can you suggest any good Newsreaders? I'm fed up with OE -- has some kind
of bug where it doesn't always download updates to threads that I have
posted on -- I have to reset the folders every couple of weeks (and thereby
lose all of my watches)

Okay, here's a list of newsreaders that I've tried and consider
worthwhile (all don't require cost of money to use unless otherwise
mentioned):

Windows:

o Mozilla Thunderbird - http://www.mozilla.org/products/thunderbird/
o XanaNews - http://www.wilsonc.demon.co.uk/d7xananews.htm
o Forté Agent (payware, but Free Agent is freeware) -
http://www.forteinc.com/main/homepage.php
o MicroPlanet Gravity - http://mpgravity.sourceforge.net/
o Xnews - (can't find the official homepage...)

GNU/Linux:

o KNode - http://knode.sourceforge.net/
o Pan - http://pan.rebelbase.com/

Perhaps some others can add to this list.
 
J

Jeff Gaines

Okay, here's a list of newsreaders that I've tried and consider
worthwhile (all don't require cost of money to use unless otherwise
mentioned):

Windows:

o Mozilla Thunderbird - http://www.mozilla.org/products/thunderbird/
o XanaNews - http://www.wilsonc.demon.co.uk/d7xananews.htm
o Forté Agent (payware, but Free Agent is freeware) -
http://www.forteinc.com/main/homepage.php
o MicroPlanet Gravity - http://mpgravity.sourceforge.net/
o Xnews - (can't find the official homepage...)

GNU/Linux:

o KNode - http://knode.sourceforge.net/
o Pan - http://pan.rebelbase.com/

Perhaps some others can add to this list.

Have a look at:

http://email.about.com/cs/winclientreviews/
and
http://cws.internet.com/mail.html

for reviews.

I have tried half a dozen in the last month but I always seem to
end up back with Agent - it's useful to have mail/news together.

If I changed I think it would be to Eudora - it works well, it
seems to follow the standards and it has very good support
newsgroup.
 
C

C# Learner

Jeff said:
[...]
I have tried half a dozen in the last month but I always seem to
end up back with Agent - it's useful to have mail/news together.

I think I can understand that -- I used Agent for years... until
recently when I moved to Thunderbird :)

Agent was fine apart from one problem: reading groups on more than one
news server required opening several instances of it.
 
M

Mark Schmidt

I use NewsGator which integrates newsgroups into Outlook. It?s also an RSS reader. Nice app.
-Mark?

nntp://msnews.microsoft.com/microsoft.public.dotnet.languages.csharp/
J.Marsch said:
Can you suggest any good Newsreaders? I'm fed up with OE -- has some kind
of bug where it doesn't always download updates to threads that I have
posted on -- I have to reset the folders every couple of weeks (and thereby
lose all of my watches)

Okay, here's a list of newsreaders that I've tried and consider
worthwhile (all don't require cost of money to use unless otherwise
mentioned):

Windows:

o Mozilla Thunderbird - http://www.mozilla.org/products/thunderbird/
o XanaNews - http://www.wilsonc.demon.co.uk/d7xananews.htm
o Fort? Agent (payware, but Free Agent is freeware) -
http://www.forteinc.com/main/homepage.php
o MicroPlanet Gravity - http://mpgravity.sourceforge.net/
o Xnews - (can't find the official homepage...)

GNU/Linux:

o KNode - http://knode.sourceforge.net/
o Pan - http://pan.rebelbase.com/

Perhaps some others can add to this list.

[microsoft.public.dotnet.languages.csharp]
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

The Namespaces are public, as you use them for shortcutting. The only way I
know of to get around this is to explicitly set the full path to the object
for instantiation.

MyLibrary.Foo.a.SomeObject so = new MyLibrary.Foo.a.SomeObject();
MyLibrary.Bar.a.SomeOtherObject soo = new MyLibrary.Bar.a.SomeOtherObject();

You can shortcut this with your using statement (alias):

using foo = MyLibrary.Foo.a;
using bar = MyLibrary.Bar.a;

Bad example of naming, but it will shorten like so:

fooSomeObject so = new MyLibrary.Foo.a.SomeObject();
bar.SomeOtherObject soo = new bar.SomeOtherObject();

If we are talking about a, it is a common method of naming in an obfuscator.
Namespaces should not be obfuscated. There is no reason to keep the
namespace secret as it compromises nothing. Except, perhaps, if you name
your namespace something like:

namespace useRegisterWith_A_ForArgToGetAroundPayingMe

As I have never seen anyone do this, I do not see a need to ever obfuscate
the namespaces. I can see the internal class argument, but I still do not
see that obfuscating the namespace helps that much.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************************************************
Think outside the box!
***************************************************************
 
M

Michael Giagnocavo [MVP]

Well,the current version of OE allows me to delete posts locally. Nice
feature.
-mike
MVP
 
T

test

...

J.Marsch said:
Can you suggest any good Newsreaders? I'm fed up with OE -- has some kind
of bug where it doesn't always download updates to threads that I have
posted on -- I have to reset the folders every couple of weeks (and thereby
lose all of my watches)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top