It's been a long time since I did any asp.net...

But AFAIK the app_code is for code supposed to be used by view code,
so kinda of ephemeral in a way (although the official guideline dont
state this https://msdn.microsoft.com/en-us/library/ex526337.aspx).

What you have is a domain type, that gets bound to IRepository<T>.
When you change, and trigger a recompilation (but not a restart for
some reason) the Windsor instance will hold a reference to the old
Type, and then you'll have the headaches of failing casts or can't
find type, and similar errors, since now there are two different model
types.

That's why restarting the app make it work.


On Mon, May 16, 2016 at 11:56 AM, John Strzempa <john.st...@gmail.com> wrote:
> Reading that any change in App_Code, bin, or web.config will force an app
> recycle. The weird thing is that when I change the web.config and it
> recompiles I don't get the error. When I change any App_Code file, I get the
> error until I re-save windor.config, or if I change the App_Code file the
> error appears but then change web.config, the error goes away.
>
> On Monday, May 16, 2016 at 9:17:06 AM UTC-5, hammett wrote:
>>
>> Changing the config or anything in the bin folder, restarts the app.
>> That's why it works.
>>
>> On Mon, May 16, 2016 at 11:11 AM, John Strzempa <john....@gmail.com>
>> wrote:
>> > It probably doesn't force the app-pool to recycle but then why does it
>> > work
>> > when I re-save the .config file?
>> >
>> > On Friday, May 13, 2016 at 2:28:01 PM UTC-5, hammett wrote:
>> >>
>> >> Does the recompilation force a recycle of the appdomain? given the
>> >> error you posted, looks like it doesnt, hence the problem.
>> >>
>> >> On Fri, May 13, 2016 at 4:25 PM, John Strzempa <john....@gmail.com>
>> >> wrote:
>> >> > I'm working on a site that is an ASP.net webforms site and I have my
>> >> > service
>> >> > code in App_Code. When editing the XML in windsor.config and then
>> >> > saving
>> >> > the
>> >> > file, my code works. However, if I make a change to that class file
>> >> > and
>> >> > save
>> >> > then I get this error
>> >> >
>> >> >     [ConverterException: Could not convert from
>> >> > 'MyNamespace.IRepository`1[[MyClass, __Code]], __Code' to
>> >> > System.Type.]
>> >> >
>> >> >
>> >> >
>> >> > Castle.MicroKernel.SubSystems.Conversion.TypeNameConverter.PerformConversion(String
>> >> > value, Type targetType) +335
>> >> >
>> >> >
>> >> >
>> >> > If I then save the windsor.config file again, the error goes away.
>> >> > So, basically if I change a class in App_Code forcing a recompile, I
>> >> > have to
>> >> > resave the windsor.config file again for it to work.
>> >> >
>> >> > I'd like to be able to recompile without having to re-save the
>> >> > windsor.config file. Has anyone seen this before and have a solution
>> >> > without
>> >> > having me add another assembly? I want to keep the code in App_Code
>> >> >
>> >> > Here is my XML
>> >> >
>> >> >
>> >> >    <?xml version="1.0" encoding="utf-8"?>
>> >> >     <configuration>
>> >> >       <components>
>> >> >         <component id="MyComponent"
>> >> > service="MyNamespace.IRepository`1[[MyClass, __Code]], __Code"
>> >> > type="MyClassRepository, __Code" />
>> >> >       </components>
>> >> >
>> >> >
>> >> >
>> >> >     </configuration>
>> >> >
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "Castle Project Users" group.
>> >> > To unsubscribe from this group and stop receiving emails from it,
>> >> > send
>> >> > an
>> >> > email to castle-project-users+unsubscr...@googlegroups.com.
>> >> > To post to this group, send email to castle-pro...@googlegroups.com.
>> >> > Visit this group at
>> >> > https://groups.google.com/group/castle-project-users.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >>
>> >>
>> >>
>> >> --
>> >> Cheers,
>> >> hammett
>> >> http://www.d-collab.com/
>> >> http://www.hammettblog.com/
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Castle Project Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to castle-project-users+unsubscr...@googlegroups.com.
>> > To post to this group, send email to castle-pro...@googlegroups.com.
>> > Visit this group at
>> > https://groups.google.com/group/castle-project-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Cheers,
>> hammett
>> http://www.d-collab.com/
>> http://www.hammettblog.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to castle-project-users+unsubscr...@googlegroups.com.
> To post to this group, send email to castle-project-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/castle-project-users.
> For more options, visit https://groups.google.com/d/optout.



-- 
Cheers,
hammett
http://www.d-collab.com/
http://www.hammettblog.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at https://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to