I've been working on a project plugin, and I define the plugin in the
dashboard's config file like so:
<projectPlugins>
...
<propertiesPlugin />
</projectPlugins>
Where my custom plugin is named "propertiesPlugin".
When I include this xml element definition, I receive a
NullReferenceException being reported from the asp.net app through the
web browser. If I omit the declaration, the dashboard works as
expected, but without the benefit of my plugin(obviously).
I downloaded the source for 1.2.1, and I found the problem. The
SetupObjectSourceForRequest method of the
CruiseObjectSourceInitializer object(in the dashboard project) is
looping through all of the
named actions in the plugin, via the following line of code:
foreach (INamedAction action in plugin.NamedActions)
However, the plugin object is null. Upon further inspection, it
appears that the plugins collection has the correct number of
elements, but the last element is null. I traced code execution back
into the Load method of the DashboardConfigurationLoader class. The
line of code in this method that seems to be the root cause is as
follows:
typeTable.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Locatio n),
"ccnet.*.plugin.dll");
It appears that the type table is attempting to load all of the types
decorated with the ReflectorType attribute from all ccnet.*.plugin.dll
assemblies, located in the same folder as the executing assembly. That
makes sense; and is what I expected from the documentation.
However, Assembly.GetExecutingAssembly().Location does not return the
result that I was expecting. The result is some long path buried deep
somewhere in the windows temp folder. I assume that this is due to
asp.net's shadow copying.
So - the point? What's the solution? Can shadow-copying be disabled
only for the ccnet dashboard app? I rather think this behavior is a
defect, and would be difficult to reproduce within an nunit test
case.
trey writes: >I traced code execution back >into the Load method of the DashboardConfigurationLoader class. The >line of code in this method that seems to be the root cause is as >follows: >typeTable.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly() >.Location),"ccnet.*.plugin.dll");
Ticket CCNET-1130 has been opened and resolved for this.
Ross ________________________________
Ross A. Patterson, CISSP Sr. Director, Development Tel: +1 703-390-0865 RPatter...@QKnow.com
Q.Know Technologies, Inc. 11600 Sunrise Valley Drive, Suite 300 Reston, VA 20191 www.QKnow.com
Ignorant question re: the license; can I modify that in my own copy of
the 1.2.1 source and redeploy the dashboard assembly to my private
build environment without breaking the license?
On Apr 18, 1:19 pm, "Ross Patterson" <RPatter...@qknow.com> wrote:
> trey writes:
> >I traced code execution back
> >into the Load method of the DashboardConfigurationLoader class. The
> >line of code in this method that seems to be the root cause is as
> >follows:
> >typeTable.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly()
> >.Location),"ccnet.*.plugin.dll");
> Ticket CCNET-1130 has been opened and resolved for this.
> Ross
> ________________________________
> Ross A. Patterson, CISSP
> Sr. Director, Development
> Tel: +1 703-390-0865
> RPatter...@QKnow.com
> Q.Know Technologies, Inc.
> 11600 Sunrise Valley Drive, Suite 300
> Reston, VA 20191www.QKnow.com
trey writes: >Ignorant question re: the license; can I modify that in my own copy of >the 1.2.1 source and redeploy the dashboard assembly to my private >build environment without breaking the license?
I Am Not A Lawyer, but I understand the answer to be "yes". There is nothing in the ThoughtWorks Open Source Software License (http://confluence.public.thoughtworks.org/display/CCNET/License) that limits how you use CCNet, only how you "redistribute" it. Redistribution is commonly understood in the Open Source community as the GNU General Public License 3 (http://www.gnu.org/licenses/gpl.html) defines "propagate":
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
Ross ________________________________
Ross A. Patterson, CISSP Sr. Director, Development Tel: +1 703-390-0865 RPatter...@QKnow.com
Q.Know Technologies, Inc. 11600 Sunrise Valley Drive, Suite 300 Reston, VA 20191 www.QKnow.com
BTW - I made the change locally, and ran into one more issue. The
CodeBase property of the assembly returns the full path in the form of
a file uri("file:///", for example). The Path.GetDirectoryName method
fails on receiving this text.
So the proper code should look something like this:
Uri uri = Assembly.GetExecutingAssembly().CodeBase;
...Path.Combine( Path.GetDirectoryName( uri.AbsolutePath ) ,
"ccnet.*.plugin.dll" )
I apologize for the ellipses; trying to recall the code off the top of
my head.