Microsoft .NET - Tips and Tricks



Monday, January 28, 2008
Signing a 3rd party DLL
Why?

A few days ago I got a question that I was asked a few months ago and the same thing I needed a few times already by myself. The thing is that we often get a 3rd party DLL/assembly that is not signed and we have to use it from a signed DLL/assembly.
In most cases it would be a copyright issue to disassemble someone’s work/dll and modify it but in some cases you are either allowed to do that or you will get a signed version from the owner sooner or later but you need to start with development immediately and not to lose valuable time.

If you are allowed to do that then this is the solution you may use.

How?

The idea I found some time ago goes like this:
1. Use disassembler to generate the MSIL code
2. Use the assembler to reassemble the MSIL code into the binary assembly and sign it at the same time

Here is an example of how to do that:
1. ildasm /tokens /out=TempUnsignedAssembly.il A3rdPartyAssembly.dll
2. ilasm /dll /key=TemporaryKey.snk TempUnsignedAssembly.il /out=A3rdPartySignedAssembly.dll

Here are a few comments on commands above:
- A3rdPartyAssembly.dll should be replaced with the name of 3rd party DLL/assembly you want to sign
- TemporaryKey.snk is strong name key that you will need to generate and use for 3rd party DLL/assembly signing
- A3rdPartySignedAssembly.dll should be replaced with the name of DLL that you want to get as result of these operations (it will be a signed version of original 3rd party DLL).

NB: don’t forget to check the license agreement and to ask for a signed DLL from the 3rd party before you deliver your product or before you go to production with it.

posted by Popovic Sasa
+ Read comments 2 comments
 

Saturday, January 05, 2008
Custom paging SPGridView control


Why new grid?
I needed a paged grid control on one of the projects I was involved in recently. It was a MOSS 2007 project, I wanted the grid to look similar to MOSS 2007 grids so my first choice was SPGridView control. When I tried the control I saw its built-in paging functionality is not suitable for my needs because SPGridView expects the whole result set and then it does the paging automatically. Because of very large result set that my grid should show in MOSS that was not a solution for me.

Therefore I started looking for a solution that will allow me a kind of custom paging where only results that should be shown on a current page are retrieved from data store and assigned to grid control.

The solution
I couldn't find one but I remembered that I read once about a similar grid control for ASP.NET published on CodeProject by Fadrian Sudaman (http://www.codeproject.com/KB/aspnet/GridViewNeatPaging.aspx). I used similar idea, created my own control that inherits from SPGridView and decided to share that with Microsoft community. I created a project on CodePlex and published my code there: http://www.codeplex.com/aspnetlibrary

I also created a sample project that demonstrates the usage of my grid control. The project consists of a sample web part, some SQL to generate sample database with a stored procedure that retrieves paged data and configuration files to allow automated deployment of sample web part to MOSS 2007.

posted by Popovic Sasa
+ Read comments 0 comments
 

 

Links

Get the Levi9 RSS Feed
Levi9 Global Sourcing

Previous Posts

Web Parts generator tool
Unit testing internal units/methods - Friend Assem...
Signing a 3rd party DLL
Custom paging SPGridView control
Serving files from server
Configuring CruiseControl .Net to work with multip...
Sharing cookies between sub-domains

Archives

February 2007
March 2007
April 2007
January 2008
February 2008
Current Posts

Powered by Blogger
Levi9 Global Sourcing | Jan van Goyenkade 8 | 1075 HP Amsterdam | The Netherlands | +31(0)72 58 210 55 | info@levi9.com
Copyright © Levi 9 | Design by A36