Caliburn.Micro and the Bootstrapper/BootstrapperBase Classes - caliburn.micro

I thought I would check out Caliburn.Micro. Using the old CodePlex documentation I went to implement my inherited bootstrapper class (inheriting from BootstrapperBase) and there is no BootstrapperBase/Bootstrapper class in the new GitHub version.
I have since re-downloaded the older CodePlex version and I am back in business with the tutorials etc. and the Bootstrapper classes are available.
What is happening in the latest version of Caliburn.Micro and why is there no Bootstrapper classes?
Note, I have seen:
Caliburn.Micro does not have "Bootstrapper" in a namespace in App.xaml
this does not help me.

From Rob Eisenberg's blog post on 2.0:
Remove Bootstrapper and PhoneBootstrapper, use BootstrapperBase and PhoneBootstrapperBase
There's a usage sample here.

Related

IdentityServer4.Services.InMemory not working

I google a lot but not find any solution. Below is my problem :
I make a simple project where I use reference "IdentityServer4.Postgresql": "1.0.0"
where "using IdentityServer4.Services.InMemory" works perfectly.
But when I use "IdentityServer4.Postgresql": "2.0.0" then IdentityServer4.Services.InMemory always shows error.
That means version 2 of IdentityServer4.Postgresql not support IdentityServer4.Services.InMemory.
How can I use IdentityServer4.Services.InMemory for "IdentityServer4.Postgresql": "2.0.0"?
Thanks in advance.
IdentityServer4.Postgresql is not a part of the IdentityServer project, but sounds like a community contribution. You may have a better result by contacting the library creator.
Otherwise, you could try the official IdentityServer4.EntityFramework package that is maintained by the IdentityServer team in combination with an Entity Framework Core database provider for PostgreSQL.
The official quickstarts only show adding Entity Framework in the 8th quickstart. You'll have to do each one in succession up to the eighth one to fully understand / make sure to have the code you need.
After you have Entity Framework added to the configuration, you can support a Postgres database by just adding dependencies.

Xamarin Forms, no unitybootstrapper

I figure this should be very simple to fix but this is driving me totally crazy because I can't find any information about this problem.
I have created a "Blank APP (Portable)" in VS2015.
Next I used NuGet package manager to update and or install:
Xamarin.Forms v2.3.1.114
Prism.Core & Prism.Forms & Prism.Unity.Forms v6.2.0
Unity v4.0.1
--
So I want to create a bootstrapper that derives from the "UnityBootstrapper" however it can't seem to find it and suggesting to me to generate a new class.
Here are the references:
In which Assembly can I find this UnityBootstrapper?
In all the tutorials there seems to be no problem inheriting from the unitybootstrapper.
There is no more bootstrapper. As noted in the release notes, this has been removed.
https://github.com/PrismLibrary/Prism/wiki/Release-Notes-6.2.0
You should be using PrismApplication now. Also look at the getting started in the docs
https://github.com/PrismLibrary/Prism/blob/master/Documentation/Xamarin.Forms/1-GettingStarted.md

MVC 5 App with Google OAuth2 Sign-on issues

I am following this article to login using a google account. However even after installing the latest version of entity framework to the the project and also the latest versions of Microsoft.AspNet.Identity.Core and Microsoft.AspNet.Identity.Owin, I am still getting an error at these lines
app.CreatePerOwinContext(ApplicationDbContext.Create);
app.CreatePerOwinContext(ApplicationUserManager.Create);
The first error is that my ApplicationDbContext does not contain a definition for Create. Now how is this possible? Or is this something I have to implement myself in the ApplicationDbContext class? If yes, wont those changes be lost when I reacreate the edmx file?
The second problem is there is no ApplicationUserManager class present. What will have to be the definition of this class?
Am I missing some references or something?
Thanks.
You don't need those lines in your code, that article is using an old version of the template. All you need to do is copy the Google AppId and it should work

MVC2 with Ninject.Web.Mvc 2.2 and Ninject 2.2 runtime version 4.0 always asks for parameterless constructor for controllers

I have a previous project running Ninject 2.0 runtime version 2.0 and now I am using Ninject in a new project and using the new Ninject, ninject web.mvc version 2.2 for runtime version 4.0.
Every single time I get the error no parameterless constructor
Invalid Operation exception
An error occurred when trying to create a controller of type HomeController'. Make sure that the controller has a parameterless public constructor.
What am I missing. All the bindings are registered.
Do I need to now define interfaces for Controllers as well such as HomeController as IHomeController as I have seen in some examples, Or do I get back to using the older version
There is one version that does not show activation exceptions properly but show this exception instead. Most likely the problem is a duplicated binding.
In addition to what Remo Gloor said, you might want to check that MVC is set up to use Ninject correctly. I was doing some things manually on an older version of the MVC plugin and ended up needing to just bite the bullet and make Global extend the NinjectHttpApplication class, which I had previously been avoiding.
The error you're getting is the error you would get if MVC tries using its built-in controller factory to produce controllers. So you may want to create a custom method binding on your controller class and put a breakpoint inside to make sure it's even being invoked.
You may also want to switch to version 2.3. You can pick up the latest builds of Ninject and all its extensions here.
I have seen this issue mentioned couple of times on forums where there is no direct answer, here is the solution to the above problem, i.e., working with latest ninject
Download the latest Ninject from github.
The ninject I got for MVC2 is named as Ninject.Web.Mvc2-2.2.0.0-release-net-4.0 (runtime version 4)
Now during adding reference add Ninject.Web.Mvc.dll(check the version is same as above by right click properties in VS)
Now Add Ninject.dll from the lib folder in same parent folder (check the version as above)
Now Add CommonServiceLocator.NinjectAdapter.dll from the extensions folder in lib parent folder (check the version as above.)
The missing link in all these have been the commonserviceLocator.dll and the correct version should match. This should be tried if you are sure your bindings are correct as mine were and check to see if your project work with older version.
Thanks to everyone, and good luck :)

Ninject with MVC3 RTM

I've upgraded MVC3 from RC2 to RTM. We were using Ninject 2.1.0.76, but things stopped working once I upgraded. So I used the NuGet manager to get the latest Ninject, Ninject.MVC3 and Ninject.Web.Mvc libraries (2.1.0.91, 1.0.0.0 and 2.1.0.39 respectively). Now, it creates an AppStart_NinjectMVC3 file.
I removed NinjectHttpApplication from my global.asax and made it back into a regular HttpApplication. When I tried to build, I get;
"Exception has been thrown by the target of an invocation"
Looking further, if I disable the following line;
DependencyResolver.SetResolver(new NinjectServiceLocator(kernel));
The build goes through. But I'm pretty sure I don't want to do this.
Any ideas?
----- UPDATE ---------
I created a new MVC3 project, added the reference to Ninject.MVC3 and this builds and runs fine. I compared web.config, don't see any differences that relate to Ninject or MVC in the two. A fresh project doesn't add the Ninject.Web.Mvc library, so I removed it and commented out all code relating to that, and still, the error occurs.
Since ASP.NET MVC 3 Beta the IServiceLocator interface is replaced by IDependencyResolver. I'm not sure Ninject.MVC3 already has a release where they have implemented this interface.
Judging from the line DependencyResolver.SetResolver(new NinjectServiceLocator(kernel)) it appears they have not.
Here's a simple implementation of this interface for Ninject.
UPDATE: The Ninject.Web.Mvc library has a NinjectDependencyResolver class that extends from the IDependencyResolver interface. I think you should use this one (I do and everything works fine).
Download the dlls from here
https://github.com/ninject/ninject/archives/master
https://github.com/ninject/ninject.web.mvc/archives/master
Further more do not use Ninject.MVC3 all you need ist Ninject.Web.Mvc
I also have an article documenting same here

Resources