CpBT & PostSharp

60 views
Skip to first unread message

Luigi Clemente

unread,
Mar 7, 2011, 2:39:18 PM3/7/11
to uNhAddIns
Hello at all!

I'm trying to setup a project using the CpBT pattern with PostSharp,
Ninject and .NetFramework 4 but i always get the "No current
conversation available. Create a conversation and bind it to the
container." error message.

This is my Ninject configuration
var _kernel = new StandardKernel();
_kernel.Bind<ISessionFactoryProvider>().To<SessionFactoryProvider>().InSingletonScope();
_kernel.Bind<ISessionFactory>().ToMethod(ctx =>
ctx.Kernel.Get<ISessionFactoryProvider>().GetFactory(null));
_kernel.Bind<ISessionWrapper>().To<FakeSessionWrapper>().InSingletonScope();
_kernel.Bind<IConversationsContainerAccessor>().To<NhConversationsContainerAccessor>().InSingletonScope();
_kernel.Bind(typeof(IDao<>)).To(typeof(Dao<>));
_kernel.Bind<IEditMovieModel>().To<EditMovieModel>();

I have tried the tips found in this post (http://groups.google.com/
group/unhaddins/browse_thread/thread/316907285270b577) unsuccessfully :
(

Where i'm wrong?

Is there an example where can i see the right way to implement with
ninject and postsharp?

How should I use the NinjectAdapters and the PostSharpAdapters?

Any help would be very appreciated :)

José F. Romaniello

unread,
Mar 7, 2011, 3:28:30 PM3/7/11
to unha...@googlegroups.com
1-Do you have postsharp installed?
2-Are you sure you are using the attributes in uNhAddins.PostSharp (instead of the ones in uNhAddins.Adapter)?



2011/3/7 Luigi Clemente <gigit...@gmail.com>

Luigi Clemente

unread,
Mar 7, 2011, 3:35:27 PM3/7/11
to uNhAddIns
Yes i have the PostSharp community edition installed but i'm using the
attributes in uNHaddins.Adapters, i will fix this as soon as possible

On 7 Mar, 21:28, José F. Romaniello <jfromanie...@gmail.com> wrote:
> 1-Do you have postsharp installed?
> 2-Are you sure you are using the attributes in uNhAddins.PostSharp (instead
> of the ones in uNhAddins.Adapter)?
>
> 2011/3/7 Luigi Clemente <gigitsu...@gmail.com>
>
>
>
>
>
>
>
> > Hello at all!
>
> > I'm trying to setup a project using the CpBT pattern with PostSharp,
> > Ninject and .NetFramework 4 but i always get the "No current
> > conversation available. Create a conversation and bind it to the
> > container." error message.
>
> > This is my Ninject configuration
> > var _kernel = new StandardKernel();
>
> > _kernel.Bind<ISessionFactoryProvider>().To<SessionFactoryProvider>().InSing letonScope();
> > _kernel.Bind<ISessionFactory>().ToMethod(ctx =>
> > ctx.Kernel.Get<ISessionFactoryProvider>().GetFactory(null));
>
> > _kernel.Bind<ISessionWrapper>().To<FakeSessionWrapper>().InSingletonScope() ;
>
> > _kernel.Bind<IConversationsContainerAccessor>().To<NhConversationsContainer Accessor>().InSingletonScope();

Luigi Clemente

unread,
Mar 8, 2011, 3:28:01 AM3/8/11
to uNhAddIns
I can't find the PersistenceConversational or
PsPersistenceConversational attribute in the
uNHaddins.PostSharpAdapters namespace :(

Luigi Clemente

unread,
Mar 8, 2011, 3:34:44 AM3/8/11
to uNhAddIns
Visual Studio say me that
uNHaddins.PostSharpAdapters.PersistenceConversational is not an
attribute class

Luigi Clemente

unread,
Mar 8, 2011, 3:44:12 AM3/8/11
to uNhAddIns
Ok i'v fixed that, i've forgotten to put a reference to postsharp.dll
but now I can't continue for this error:
The aspect
'uNhAddIns.PostSharpAdapters.PersistenceConversationalAttribute' uses
non-licensed features (CommunityFeatures). Please visit http://www.sharpcrafters.com/
to acquire a license of PostSharp.

José F. Romaniello

unread,
Mar 8, 2011, 5:29:01 AM3/8/11
to unha...@googlegroups.com
Yes, the aspect uses PRO features. 
-You can use PRO for 45 to see if the addin fit your requirements, then buy
-You can ask for discounts or even giveaways, if you are in any of these categories: http://www.sharpcrafters.com/postsharp/purchase/discounts
-I can sign the assembly and ask SharpCrafters for a full license for the unhaddins, as explained here:

For Open-Source Projects
We allow selected open-source projects to use and redistribute PostSharp for free, even the features of the professional edition. People using the project will not be required to register and acquire a license as long as they use PostSharp jointly with this project.

I want to be clear on this, i was working on this last option, but i lost interest because:
  • Low interest; uNhAddins.Postsharp is used only by me.
  • I am not sure if sharpCrafters will be interested in give us this license, i think the current structure of unhaddins wouldn't be appealing for them because it is not for me. Id prefer to have the whole CpBT outside uNhAddins in a different OSS project. 


2011/3/8 Luigi Clemente <gigit...@gmail.com>

Luigi Clemente

unread,
Mar 8, 2011, 7:37:53 AM3/8/11
to uNhAddIns
Yes would be very nice to have the whole CpBT in an individual OSS
project.

I'm working on a project for the company where i work, it's a small
company (I'm the only programmer) and I want to do this project in the
best way i can do!

I've learned a lot from your Chinook Media Manager and from Fabio
Maulo's blog and i like very much the CpBT pattern but i can't find
enough documentation about its implementation in the uNHaddins
project.

I followed the recipe found in the "NHibernate 3.0 Cookbook" but it
seemed too load of dependencies and to slow to start ( it takes too
much time to resolve all dependencies and return me a model) I'm doing
somethings wrong?

Finally how can i use another DI framework instead of castle?

I really want to learn as much as possible from this project and any
help will be greatly appreciated.
Of course I will share everything I learn from this project.
Thanks

On 8 Mar, 11:29, José F. Romaniello <jfromanie...@gmail.com> wrote:
> Yes, the aspect uses PRO features.
> -You can use PRO for 45 to see if the addin fit your requirements, then buy
> -You can ask for discounts or even giveaways, if you are in any of these
> categories:http://www.sharpcrafters.com/postsharp/purchase/discounts
> -I can sign the assembly and ask SharpCrafters for a full license for the
> unhaddins, as explained here:
>
> For Open-Source Projects
>
> > We allow selected open-source projects to use and redistribute PostSharp
> > for free, even the features of the professional edition. People using the
> > project will not be required to register and acquire a license as long as
> > they use PostSharp jointly with this project.
>
> I want to be clear on this, i was working on this last option, but i lost
> interest because:
>
>    - Low interest; uNhAddins.Postsharp is used only by me.
>    - I am not sure if sharpCrafters will be interested in give us this
>    license, i think the current structure of unhaddins wouldn't be appealing
>    for them because it is not for me. Id prefer to have the whole CpBT outside
>    uNhAddins in a different OSS project.
>
> 2011/3/8 Luigi Clemente <gigitsu...@gmail.com>
Reply all
Reply to author
Forward
0 new messages