What happened to Lazy<T> support in Autofac? - autofac

In beta builds of Autofac 2.1 there was support for automatic resolution of Lazy<T> as described in Nicholas Blumhardt's Lazing Around with Autofac blog post.
The code still seems to be in the source on Google Code, but I can't find LazyDependencyModule in any of the .NET 4.0 binaries I've looked at. Has it moved somewhere else?
How do I use Autofac's automatic Lazy<T> resolution with the latest Autofac builds?

You don't need to register LazyDependencyModule yourself in the production Autofac 2 builds. It is a part of the default container, so just register T and Lazy<T> will be provided.
Make sure you're not accidentally using a .NET 3.5 binary, too :)
Nick

Related

System.Reactive for WPF .NET 6

I'm trying to target .NET 6 for my WPF app, but because I'm using RX.net, the highest I can go is net5.0-windows10.0.19041. One example is that ObserveOnDispatcher() is not available when I'm targeting net6.0-windows, which my app makes heavy use of.
Does anybody know either A) when a .NET 6 version of RX.NET will be released, or B) any workarounds for ObserveOnDispatcher() or ObserveOn(DispatcherScheduler.Current.Dispatcher) on .NET 6?
Thanks
A relatively painless way I found was to simply add the ReactiveUI.WPF package to my WPF projects. This allowed me to advance to net6.0-windows, and also to use DispatcherScheduler. I am not using anything from ReactiveUI library, so this is technically a hack, but took 5 minutes of my time and added only a few hundred kilobytes added to the shipped binaries, so it was worth it for me to be able to move on from previously being held back on net5.0-windows10.0.19041 because of RX.
If I had more time and skill I would dig into how the ReactiveUI.WPF source code achieved this desired effect, and apply this to my own source code... maybe someone has a more elegant, non-hack solution.
This will be fixed in v5.1
https://github.com/dotnet/reactive/pull/1660
You could try the nightly builds as per the readme.
https://github.com/dotnet/reactive#get-nightly-builds

postsharp express limited to 10 target classes per project

Does it apply to any aspect?
Is that it?
If I use a multicast attribute it will apply randomly to the first 10 matches only?
I'm not sure if I got this restriction right. Do you mind elaborating it a little?
Examples would be well welcome'd.
Starting from PostSharp 4.3, this limitation applies to any aspect. The build will fail if you apply aspects to more than 10 targets (with Multicast or not). So no randomness happens.
If PostSharp 4.3 detects that your project would have been built successfully with PostSharp 4.2 or prior, then the backward-compatibility mode is enabled and the project will be built by PostSharp 4.3 without error. Please refer to PostSharp 4.2 API documentation to check if an API used to be available in PostSharp Express.

Inno Setup: Constant for latest FrameWork

I would like to know if there is a constant like {dotnet40} that would find the latest installed NET framework on the user's computer, no matter which one that would be?
Something like {dotnethighestavailable}?
Thank you very much for the help!
No, there is no such constant {dotnethighestavailable}. It would be useless anyway because you need to consider that not always you will have the latest Inno Setup release which would reflect the most recent .NET framework.
If your question has been raised because you are missing a {dotnet45} constant, then I would refer you to this post, where is written that .NET 4.5 framework is in the same directory as .NET 4.0 and so you can use the {dotnet40} constant.

Is EF4 "Code Only" ready for production use?

I've been looking at the new Entity Framework 4 Code Only features, and I really like them. But I'm having a hard time finding good resource on the feature. Everything seems to be spread around blongs here and there, so this make me wonder if it's ready to be used for a serious project?
What do you think? Is it ready for production use or should I use the more traditional approach (EDMX designer, POCO objects)?
Also, I would like to know if there are any features that Code Only does not support yet, compared to the EDMX designer?
What do you think about the Code Only feature? Is it "mature" yet?
Thank you.
It depends when your project should be ready. Code First (Code Only) is only in CTP3 without go-live license. As I've read, there is no exact timeframe for the Feature Pack Where is EntityConfiguration in EF4 VS 2010 RTM? and it will be published when it will be ready (no release date). According to the blog of EF team it will be available in the next framework release.
Code First is still under active
development and will have some
breaking changes so there is no
go-live licence at this time.
Link
Code First = Code Only
In my projects I went with EF + POCO for now.
If anyone is still looking for an answer to this, Entity Framework V4.1 which has the "Code first" feature has been RTW (released to web) for production use since a month and a half now.
You need .Net 4.0 RTM in order to install it. Once you have that installed, you can download the stand-alone installer for EF4.1 from here.

What happens in a .Net 4 app when referencing .net 2 assemblies?

I have an application I want to upgrade to .NET 4, but I have a couple 3rd party assemblies that reference the .NET 2 BCL.
I seem to remember reading something that says they should play nice, but I can't find any documentation on the subject. ( I think my question posed to Google is just too broad, with not enough .Net 4 material out there yet )
Can anyone help me find documentation on what will happen in this case?
If I'm reading Scott Guthrie's post, Multi-Targeting Support (VS 2010 and .NET 4 Series), correctly then that will work fine.
Of Interest?: .NET 4.0 project reference 2.0 assembly
The .NET Framework 4 works side by side with older Framework versions. Applications that are based on earlier versions of the Framework will continue to run on the version targeted by default.
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7
I wanted to reference StructureMap in one of my class libraries. Orginally it was created by VS2010 to use the .NET 4 client profile. Turns out, I had to changed this to the full .NET 4 framework, otherwise structuremap would not be recognized.