Thursday, December 27, 2007

WSPBuilder 0.9.7.1227. From Mono.Cecil to LoadFrom

It have been a long way to the next version. I have been looking into other ways to reflect on Assemblies, but I ended up using the technique I was using from the start however just with better assembly resolvement.

My goal was to avoid to resolve referenced assemblies when getting the class types from a loaded assembly.

I started looking into Mono.Cecil that looked very promising at first, but there was very little documentation on it and little on how to use it on the Internet. However I was successful nearly to the end but it stranded on SecurityAttributes. It was not able to read them when the attributes had parameters.

Now I turned my focus on to the Assembly.ReflectionOnlyLoadFrom method. This also stranded because it was not able to read the SecurityAttributes (this is actually by design from Microsoft).

So now I had no other options than go back to Assembly.LoadFrom method. I have then improved the resolvement of assemblies, so there will be a good error message when a referenced assembly fails to resolve. Then use the -DLLReferencePath argument to resolve the assembly.

Download: WSPBuilder

Versions
---------------------
0.9.7.1227
-BuildSolution is now fixed. This enables you to build multiple projects into one WSP file.
Multiple files with the same name (location) in CAB file have been solved.
Assembly resolve now outputs better error description - bin\debug and bin\release is now supported.
Bug fixed with ProjectDLLPath argument.
Feature warning corrected.

3 comments:

Mikhail Dikov said...

Carsten,

How do you use -BuildSolution? I did not find any specific instruction in the help and it looks like I am not doing it right...

Thanks
MD

Carsten Keutmann said...

The -BuildSolution is misleading and will be named -BuildMultipleProjects in the next version of WSPBuilder. Its a argument that enables you to build more than one project into one WSP package. However you have run the WSPBuilder at your "solution" folder, with multiple project folders under it and add the -Buildsolution argument to the call, in order to make it work.

Anonymous said...

WSPBuilder is excellent - does exactly what it says on the tin!

What I'm now trying to do is build my VS Solution's projects into one WSP. '-BuildSolution' sounds like the go - could you give an example?

Currently I use WSPBuilder in post build events, to create a WSP per project. My VS solution and it's projects are all in disparate folders.

Once again thanks for the great tool.

MOSSuMS (Mike S)