Replies: 1 comment
-
Microsoft implemented the dependency injection capabilities in .NET Framework 4.7.2 and higher. The NuGet packages to support the capabilities are available to .NET Framework users, and are supported by CSLA. I don't know if Windows Server 2008 can run .NET Framework 4.8, but I think that's possible? So you just need to get your software updated to .NET Framework 4.7.2 or higher (I'd recommend 4.8, as that's the final version of netfx ever), and then you can use the DI features. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been following CSLA loosely since the VB 5 days, but I am still very much a NOOB. (Also, I have not been a full time dev for many years.)
I currently have a need to extend an application with some emailing capability, and it seems to be an ideal fit for CSLA server-side processing. However, due to the nature of the application, it is problematic to setup the configuration in config files, and so the new features in CSLA, allowing configuration in code, and also the DI support, are very compelling, and so I want to use 5.3.2.
The problem is, the servers I need this to run on are still W2008 R2, which does not support ASPNETCORE.
I created a partial app (just a couple of business objects), and I got it working on a test server (W2012R2) using ASPNETCORE.
Now I'm trying to get it to work with ASPNET MVC5, but I don't know how to make the DI work. (I want to use the Microsoft.Extensions.DependencyInjection libraries.)
I've configured the ServiceCollection in the Application_Start event using some code I found online (non-Csla) and that part runs without error, so I think that I've got my business objects loading into the services.AddTransient, but when my Fetch method runs, the DAL object is null:
private void Fetch(DateTime invoiceDate, short divId, [Inject] IInvoiceDal dal, [Inject] SqlConnection cn)
So, my question is - Is this even doable in ASP.NET (non-Core)? If so, does anyone have a small demo app showing how to make this work?
Otherwise I'll need to convince my boss to upgrade the application servers :)
Thanks,
Bob
Beta Was this translation helpful? Give feedback.
All reactions