BadImageFormatException, but not when debugging

View: New views
5 Messages — Rating Filter:   Alert me  

BadImageFormatException, but not when debugging

by yesthatmcgurk :: Rate this Message:

| View Threaded | Show Only this Message


I'm using the MoQ framework which uses castle to proxy types.  I'm
getting a BadImageFormatException when attempting to proxy the
IUnityContainer interface of the Enterprise Library's Unity block.

The odd thing is that the exception is thrown when I'm running my
tests, but when I switch to debug in order to examine the exception,
the exception isn't thrown and the tests pass.

I've been scanning related posts, but I haven't found any information
to help me out.  I also can't find out what version of Castle is being
used, but I believe it is the latest stable build.

TIA


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: BadImageFormatException, but not when debugging

by Ayende Rahien-2 :: Rate this Message:

| View Threaded | Show Only this Message

Please contact Kzu to see what he can do about that.

On Wed, Jul 30, 2008 at 11:47 PM, yesthatmcgurk <yesthatmcgurk@...> wrote:

I'm using the MoQ framework which uses castle to proxy types.  I'm
getting a BadImageFormatException when attempting to proxy the
IUnityContainer interface of the Enterprise Library's Unity block.

The odd thing is that the exception is thrown when I'm running my
tests, but when I switch to debug in order to examine the exception,
the exception isn't thrown and the tests pass.

I've been scanning related posts, but I haven't found any information
to help me out.  I also can't find out what version of Castle is being
used, but I believe it is the latest stable build.

TIA





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: BadImageFormatException, but not when debugging

by josh robb :: Rate this Message:

| View Threaded | Show Only this Message


On Thu, Jul 31, 2008 at 6:47 AM, yesthatmcgurk <yesthatmcgurk@...> wrote:
> I'm using the MoQ framework which uses castle to proxy types.  I'm
> getting a BadImageFormatException when attempting to proxy the
> IUnityContainer interface of the Enterprise Library's Unity block.

As an aside - you probably don't want to be mocking the container
interface - this is probably a sign that you've got some design
problems elsewhere. (Or that you just have very esoteric
requirements).

j.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: BadImageFormatException, but not when debugging

by yesthatmcgurk :: Rate this Message:

| View Threaded | Show Only this Message


Well, I figured because it was happening down in the Castle I'd see if
you guys have encountered this.

The fact that it's only thrown when NOT debugging is the thing that's
throwing me the most.

On Jul 30, 4:54 pm, "Ayende Rahien" <aye...@...> wrote:

> Please contact Kzu to see what he can do about that.
>
> On Wed, Jul 30, 2008 at 11:47 PM, yesthatmcgurk <yesthatmcg...@...>wrote:
>
>
>
>
>
> > I'm using the MoQ framework which uses castle to proxy types.  I'm
> > getting a BadImageFormatException when attempting to proxy the
> > IUnityContainer interface of the Enterprise Library's Unity block.
>
> > The odd thing is that the exception is thrown when I'm running my
> > tests, but when I switch to debug in order to examine the exception,
> > the exception isn't thrown and the tests pass.
>
> > I've been scanning related posts, but I haven't found any information
> > to help me out.  I also can't find out what version of Castle is being
> > used, but I believe it is the latest stable build.
>
> > TIA- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: BadImageFormatException, but not when debugging

by yesthatmcgurk :: Rate this Message:

| View Threaded | Show Only this Message


Actually, that's exactly what I want to do.  I want to test a single
method; if that method uses Unity to inject other objects, I want to
make sure it performs its task properly.  I don't want to test Unity;
that's the job of the P&P group.  So I mock their container and set
expectations on what it will be asked to do.  I then execute the
method under test and verify my expectations on the unity mock have
been met.

On Jul 31, 2:14 am, "josh robb" <josh_r...@...> wrote:

> On Thu, Jul 31, 2008 at 6:47 AM, yesthatmcgurk <yesthatmcg...@...> wrote:
> > I'm using the MoQ framework which uses castle to proxy types.  I'm
> > getting a BadImageFormatException when attempting to proxy the
> > IUnityContainer interface of the Enterprise Library's Unity block.
>
> As an aside - you probably don't want to be mocking the container
> interface - this is probably a sign that you've got some design
> problems elsewhere. (Or that you just have very esoteric
> requirements).
>
> j.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---