TechnicalArchitectureWorx

The (Unofficial) ITWorx Technical Architecture Blog

Archive for March, 2007

How to add Microsoft Enterprise Library (June 2005) to GAC?

Posted by archworx on March 28, 2007

You may need to add the enterprise library to GAC in case that you want to share it across more than one application in a production server, the enterprise library is a set of dlls, you should sign all those dlls in order to be added to the GAC. So, you should follow the following steps:

1- open the command prompt and type “sn -k c:\mykey.snk” to generate key file which will be used to sign the assemblies.

2- Open the enterprise library solution in the Visual Studio.

3- Open the Caching Project.

4- Open the GlobalAssemblyInfo.cs shortcut in the Caching project.

5- Add the following line [assembly: AssemblyKeyFile(“c:\\mykey.snk”)]

6- Make sure that you don’t have any “AssemblyKeyFile” attributes in the assemblyinfo.cs of each project, other wise you will get a compilation errors.

7- copy \Program Files\Common Files\System\Ole DB\oledb32.dll to c:\

8- generate the signed interop assembly using the following command: tlbimp /keyfile:c:\mykey.snk c:\oledb32.dll

9- the above command will generate “MSDASC.dll” which is the primary interop assembly for the oledb32 com

10- open the Configuration.Design Project

11- delete “MSDASC” from the references

12- add new reference to the generated signed MSDASC.dll

13- You must Compile the project with reference of the signed enterprise library dll’s in order to make your application can access the signed library from GAC.

NOTE: You must add the public key token used to sign the Library in the configuration file as dataconfiguration.config or the exceptionhandlingconfiguration.config or else you will get a security exception thrown in the log file and application will not work

Advertisements

Posted in Bubly, Configuration Management | 3 Comments »

What is an NP-Complete problem?

Posted by archworx on March 15, 2007

So,  you must have heard this term before. I had heard it before and was really looking forward to know it. Yesterday I learnt it in my algorithms class.  Basically, computer scientists have considered algorithms that execute in polynomial time (n^k) (where n is the size of the problem k is a constant and  ^ denotes power)  better than those solved in exponential time (k^n) (where k is a constant and n is the size of the problem ^ denotes power). This is a bit intuitive because exponential time algorithms have a tremendous growth rate (as the problem size increases, the time needed to solve it increases exponentially). After this quick introduction lets turn back to NP-complete problems. Strictly, NP-complete problems are defined as a class of problems/algorithms which if one can be solved in polynomial time then all others can be solved in polynomial time, and since people have been unable to prove for more than thirty years that even one of these problems can be solved in polynomial time, it is unlikely (to our current knowledge) that they can be solved in polynomial time. In other words (from my understanding) if a problem is NP-complete then we cannot  (to our current knowledge) solve it using an efficient algorithm (one that takes polynomial time).  This is because the problem grows very rapidly with increase in input, and is practically unsolvable for large values of n. An example of an NP-complete problem is the well known traveling salesman problem . For more on the issue of NP-completeness read the wikipedia article.

Posted in AFathalla, Algorithms | 2 Comments »

Do you know TED?

Posted by archworx on March 9, 2007

There is something called the TED conference, held annually in Monterey, California, which brings together a very high-powered audience of technology big shots and an amazingly diverse set of speakers. Check it out, they have a blog and usually have clips of the talks. I have heard it described as the single most interesting way that a smart and curious person could spend a week.

Posted in Nader, Rant | Leave a Comment »