Castle.TypedFactory.DefaultInterfaceFactoryComponentSelector could not be resolved - castle-windsor

I am following example by José F. Romaniello on session management with NHibernate. It's a very good article, however I'm struggling with it having very little experience with NHibernate, Windsor and MVC.
I am trying to re-create NHibernateInstaller, however encountering the following error: Component Castle.TypedFactory.DefaultInterfaceFactoryComponentSelector could not be resolved. Make sure you didn't misspell the name, and that component is registered.
In the sample project provided this error does not crop up, even though the installer is identical and Google does not come up with any results (which is very unusual). What causes this and how can it be avoided?

it seems a problem with the TypedFactoryFacility... are you doing this?
kernel.AddFacility<TypedFactoryFacility>();
before running all the installers?

uncomment the following code in Bootstrapper.cs file.
container.AddFacility();

This happened to me when I created my own implementation of ITypedFactoryComponentSelector, but forgot to register the selector itself.
There was no indication this was the actual problem (and the kernel debug information assured me the components can be resolved) - but registering it fixed the issue.
Hope this helps someone :-)

Related

Bad window path name ".snd"

Can someone please help me with this issue? Also please kindly explain me the instructions step to step cause I have less experience and understanding regarding Programming things. Thanks again
About all we can tell from that message is that the .snd widget (“widget” is the name for a window or control component in the Tk toolkit, which is the primary GUI library for Tcl) was not existing at the point where that pack configure command was called. Except we've got a bit more context from the stack trace: it's in a procedure called CreateWidgets that was called from another procedure called CreateGUI so it's almost certainly doing widget creation and setup (pack configure is a reasonable setup action).
Given that, the problem is probably either that the code is asking to work with a widget that it hasn't created yet (funny how that won't work!) or has a typo which is making it ask to use the name of something that will never exist, or something has caused the widget to be deleted earlier than expected. Without seeing the code it's hard to be sure which. A typo is fairly possible, as is failing to construct a compound widget name correctly (which is also a kind of typo I guess) but putting the manipulation code before the creation code is definitely a possibility. An early delete is less likely in general but can't be discounted.
As the code is apparently well over a thousand lines long, I don't think it'll be easy to find volunteers to look through it.

Devart LinqConnect for mysql A field initializer cannot reference the non-static field, method, or property

I couldn't solve this problem after linqConnect For Mysql generated entity of models for me. I thought devart is good software, without testing trial period, I purchased their license, but now I am facing this issue, I couldn't even get it working. please help
enter image description here
The the piece of code highlighted is "System.String.Empty", nothing is wrong here. A similar problem is discussed, for example, at Visual Studio 2015: Intellisense errors but solution compiles. Have you tried to build a project ignoring these fantom errors? Most likely, the build will succeed in this case. To avoid displaying such misleading "errors", choose "Build Only" droplist value (instead of "Build + IntelliSense") in the Error List window from your screenshot.

.NET WebApi jsonapi.org support

Does anyone know if there is a media formatter out there to support the jsonapi.org spec (application/vnd.api+json).
If not has anyone started (or looking at starting) a project to implement this?
For the record, as of today the answer seems to be no. Best I could find was this guy: http://www.emadibrahim.com/2014/04/09/emberjs-and-asp-net-web-api-and-json-serialization/ and that only tackles a tiny part of the problem.
I've been trying this for a while…unfortunately I tried to make something that was really smart and would automagically handle a data model from Entity Framework with almost no work. I was getting close to thinking about releasing it...and then I found out they changed a bunch of stuff in EF 6 (all models are supposed to be POCOs and the context is now a DbContext instead of an ObjectContext) and I'm probably going to have to essentially start over…which is why I started looking again to see if someone else was doing it and found your question.
Let me know if you're still looking for this, and I'll keep you updated.
UPDATE
I've just published a codeplex project that aims to provide exactly what I've described above. It's called JSONAPI.NET and while it's very early, it already does quite a bit. Documentation is sparse, and I don't have NuGet packages yet…but take a look everyone and see if it's useful for you. Feedback is encouraged! You can contact me from the project page in the link.

Can't get MVVMCross core project to reference System.Xml.Linq

I'm quite new to MVVMCross but I've been actively using it for two weeks, at work and in a school project, and I am really enjoying it! Unfortunately, I've been stuck on the school project for 2 days now : we're asked to do a mobile Jabber client. This is not a big deal since I started it using Matrix XMPP library, which does most of the job and is easy to use. I decided to restart my project using MVVMCross, in order to have cleaner separated code and add a Windows Phone project, but Matrix absolutely needs System.Xml.Linq, and I can't get the core PCL to compile :
The type 'System.Xml.Linq.XElement' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
As shown in Stuart Lodge's tutorial videos, I'm using profile 104, the the faulting dll is really present in the folder, I can't add it manually to project's references since VS prevents me from doing it (gently explaining that it's automatically loaded since .Net portable subset is included in references), I've updated and repaired my VS install "just in case"... and have no more idea left.
So, here are the questions :
is it really possible to use System.Xml.Linq with MVVMCross? or did I miss the big title explaining that what I'm trying to do is stupid?
if yes (that'd be great!) did/does someone experience the same problem? Even more interesting : did someone find a solution?
Thanks in advance!
Additional info : Windows8(x64), VS2012 Ultimate, trial license (school project...) for Xamarin.Android
UPDATE : following Stuart's answer, I compiled and ran the BestSellers sample, which uses System.Xml.Linq... without any problem. As it comes with an explicit reference to System.Xml.Linq (see first link in answer), I tried :
to delete it (and a few others) : VS holds it's promises, and really includes needed references as long as .Net Portable Subset is referenced, so everything rolls smooth.
to manually add this reference via Notepad to my .csproj : it doesn't change anything.
One thing tickles me in Stuart's answer : "perhaps it is something to do with the way the matrix uses XML.linq". Since the Matrix type I'm trying to use is just a descendant of System.Xml.Linq.XElement, which is widely used in BookViewModel.cs from sample, what could possibly be wrong with that?
"Solution" : The problem seems to be due to Matrix requiring a special version of System.Xml.Linq, which is not the one included when profile 104 for building PCL. I used file linking method as a workaround to share the core, and that works, though this is less elegant, readable, and harder to maintain...
Yes it is possible to use at least some of System.Xml.Linq
For example, see the BestSellers sample
csproj file - https://github.com/slodge/MvvmCross-Tutorials/blob/master/Sample%20-%20BestSellers/BestSellers/BestSellers/BestSellers.csproj#L49
example XML linq use - https://github.com/slodge/MvvmCross-Tutorials/blob/master/Sample%20-%20BestSellers/BestSellers/BestSellers/ViewModels/BookViewModel.cs#L44
For the problem you are seeing, I'm really not sure what the error is - perhaps it is something to do with the way the matrix uses XML.linq? You might have more luck of you open up this question to other tags like portable-class-library, XML-linq and windows-phone.

Unexplainable ClassCastException thrown in Play Framework

I've been experiencing a strange error while working on my Play Framework project. While my project is running, I will sometimes receive a ClassCastException, but the error is this:
ClassCastException occured : models.Person cannot be cast to models.Person
This occurs usually when I'm calling a find method such as:
Person p = Person.find("name=?","Joe").first();
If I restart the project, the problem goes away, but only temporarily. It makes testing my project a major pain. How do I fix this?
I've experienced this error while in Dev mode in Play, in two scenarios (as far as I can remember):
Modify an entity and try to recover values from cache that are objects of that entity class.
A compilation error while reloading the code of the page/application
In both scenarios fixing compilation errors or cleaning the cache solved the issue.
Not saying that those are the only possibilities, it may be that you are having some other issue.
This most likely occurs because you've somehow loaded the Person class under two different class loaders. When a class is loaded twice in two different class loaders it's effectively two distinct classes.
(Unfortunately, I can't tell you where/how you might have done this.)
(And it is a bit curious to have the problem pop up on the statement you list. Are you certain that's where it's occurring? Perhaps you should show the exception traceback.)
In my case, this is related to applying evolutions from the web interface. Someone raised a bug for this, but so far it hasn't received any attention from the dev team. There is a patch attached to the ticket, but I haven't tried it, so YMMV.