Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear All,
I have created one strongly named assembly and I installed in global assembly cache.
Then I added as a reference in my application. That results successful. After that I have created one assembly with same name and without strong name and manually deleted existing assembly from global cache and replaced with newly created assembly(without strong name). After I replaced application working fine.

My Question:
Application won't allow other assembly. if some one replaced with other assembly application should not run, how can I achieve that?
Posted
Comments
PIEBALDconsult 22-Oct-14 13:40pm    
That seems like an unreasonable level of paranoia.
Member 8310151 22-Oct-14 13:49pm    
if you don't know then please keep quit. Anything is possible.
Sergey Alexandrovich Kryukov 22-Oct-14 14:47pm    
"Anything is possible" is the most illiterate statement. Aha, and energy conservation law can be violated. Everything.

Now, please stop shutting up anyone. All people a free, no less free than you are, who allows yourself such rudeness. If you want to be rude, you can be reported and eventually loose your account. Please remember that.

As to your question, I can only repeat: this seems to be an unreasonable level of paranoia. (It means, some levels of paranoia can be considered reasonable, but this is well too much.)

Please take this reasonable advice and don't care about such thing. This advice will greatly help you in your work.

Good luck.
—SA
BillWoodruff 22-Oct-14 14:02pm    
Can't you test somehow when your app starts if the assembly has a strong name ?
Member 8310151 22-Oct-14 14:07pm    
is there any other way?

In addition to the valueable comments you got - but ignored - it maybe interests you what's the problem in your conception of this "strong name thing" is.
The strong name stops you from having name collisions in the GAC - nothing more.
If you deleted it manually you must have seen what happens in this special "folder" - a directory with the strong name is created and your dll is put into it.
So a strong name is not a "security mechanism" in any way regarding the GAC.
(you can even replace .NET dll's - much fun if you replace mscorlib.dll on your coworkers computer).

Conclusion: Protect your Windows-System - if someone can replace dll's in your GAC you are allready vulnerable to all kind of "bad things"...

just my 2cents...
 
Share this answer
 
Easy, monitor the GAC directory(yes there is one), if any files change, throw an error.

That being said, this is a waste of programming, use domain policy instead.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900