Lightswitch global query breaking app - visual-studio-2010

I'm trying out Lightswitch for the first time, and I'm finding some of the 'built-in' features aren't as easy to implement as the videos show. The most notable being global queries, because everyone I create is causing a specific error that I cannot find a cause for. I've stripped it down to a query that does nothing but return a 'select *' on the table, and removed any code I've added.
Here is the query in my solution explorer:
And here it is in the designer:
Simple enough, so I add a screen for the query:
Everything is pure default, so why do I get this error? It says it doesn't recognize the query at all, and gives a weird dll error.
I've tried recreating it as a couple different kinds of screens, but I followed this tutorial where they use a List and Details Screen in this way. The best I can come up with is that I'm experiencing a bug due to having VS 2012 and .NET 4.5 installed as well (don't ask me why). I'm just curious if this makes sense to anyone else, or if anyone else has been successful in creating these.
P.S. - I've also been unsuccessful in accessing the permissions I created by their name. I eventually figured out I could reference them by their index, but why is that necessary? I saw nothing about needing to add a reference to make this work.
partial void CustomerNew_CanRun(ref bool result)
{
result = User.HasPermission(Permissions.AllPermissions[1]);
}

OK, just to reassure you a bit (maybe), this is not normal, & I haven't seen this or heard of anything similar.
The fact that you can't access any of your permissions by name indicates something's definitely not right. You should be able to use Permissions.NameOfOneOfMyPermissions.
Starting from the basics, have you rebuilt the solution (note rebuilt, not just built)? What you'll often find with LightSwitch is that one error will cause a whole series of other errors to appear in the list, which can look quite daunting. When you fix the original error, the rest disappear. Double-click the error in the Error pane, & you should be taken to where the error is occurring. If you can't make sense of it, past the code here & I'll see if I can figure out what's wrong.
You'll also need to check that there isn't some code left over from any previous attempt at following the tutorial. Try adding a query with a different name, & see if the error has the new name in it, or the old one.

Related

Need to 'gatsby clean' with essentially every code change

So, our team are working on a Gatsby website, and it's working correctly for most of us.
One developer, however, needs to run gatsby clean on essentially every single code change.
Doesn't matter if it's an error, changing a text value or adding markup.
I realise this is a fairly vague question, but I'm not sure where to start troubleshooting this.
Has anyone encountered this before?

Script 'Game_Actor' line 335 (Cannot open menu in RPG Maker XP due to missing code?)

I'm very new to coding. I've been using RPG Maker XP recently and have been able to fix most issues I've come across by Googling what needs to be done, however I seem to come across something I can't find an answer for.
I had deleted a class in the database (no script editing involved) so that I could rewrite it entirely, and when I finished and opened the game, I found a couldn't open the menu and the game shut down after showing this error message.
Script 'Game_Actor' line 335 : NoMethodError occured. Unable to find
method 'name' for nil:NilClass.
I looked at line 335 under the 'Game_Actor' window and saw this:
return $data_classes[#class_id].name
As I've said, I know very little about code and so I can't actually see anything wrong with this. I didn't rewrite or edit any of the actual script so I'm not sure how I have affected the script. (I haven't touched any script on the principle I have no idea how to fix it.)
I have searched for answers but unfortunately most people seem to be using later version of the RPG Maker like Ace or MV, and they're different enough to XP that the answers are not relevant to this issue.
If anyone could point me in the right direction, or tell me how to fix this, I would be very appreciative. I've worked really hard on this project and I would hate to have to scrap it and start over.
Thanks again!
Basicaly the error message sais that $data_classes[#class_id] is nil (and that's why $data_classes[#class_id].name is unavailable), so you have to check where it becomes nil and why. I'm afraid further help is impossible without you showing us more code of your app (presumably the full code).
It is likely that the code still tries to access the 'class' you deleted in the database. I take it you deleted a database table, is that right?
The error Unable to find method 'name' for nil:NilClass. means that the variable on which the code is trying access the method name is actually nil. The code expects it to contain an object instead.
From the look of it, $data_classes[#class_id] is a hash which is filled with definitions of 'classes'. It gets filled at some earlier point and since you did delete a class, it cannot find a definition for it.
Important here is that it still knows that it needs the class you deleted. It means this class is mentioned somewhere else before this hash initialization takes place. It might be in a config file or another 'class'. Without seeing the complete code it's hard to ponpoint where exactly.
If you cant find this location, try to restore the class you deleted and instead of deleting it altogether just remove anything from it that you don't need. This way the class itself will still be present and this error will not happen. You will be then able to add what you want in that class instead.

Xcode autocomplete showing results that don't exist on object

When using App Code, autocomplete will only show results directly related to my struct. This is a great feature as it keeps everything very clean and I know that accessing these properties isn't going to give me an error.
Except I don't like App Code and it's non native looking UI.
In Xcode it's quite different. Why am I getting flatMap, map, description, debugDescription?
Obviously if its my own code, I know which properties/functions are okay to use, because I wrote them. I can just ignore the noise. But if I'm using someone else's library this can slow things down. Especially when I'm just guessing or trying to remember a function.
Is there a way to fix this — to have Xcode not show me functions/properties that I can't use?
It always shows default system objects properties if the object/class is not found.
It's the behavior of Xcode

How to detect syntax errors when debugging Firefox extensions

When working on a large Firefox plugin, I sometimes accidentally make a syntax error not caught by my editor. When this happens, then calling
Components.utils.import("resource://modules/Foo.js")
will simply fail to import or return anything, without any kind of helpful hint as to where in the file to look for the syntax error. Is there any way I can get Firefox to give me some kind of clue when my imports fail?
EDIT: I fixed my own problem, which turned out to be that I was using code which had a global reference to the navigator object. What made this especially annoying was that the code would work when loaded in the browser (as Wladimir suggested below), but would still fail when importing in my extension.
Eventually I resorted to a sort of manual binary search: I'd delete half of the file and then see whether the import still failed. If so, then I'd delete half of what remained and repeat. As soon as it didn't fail, I had a more precise notion of where the problem was, which allowed me to either continue the binary search or scan the smaller area manually looking for the problem.
This is extremely time-consuming and I'd still appreciate any suggestions about how to speed up this debugging process.
The issue here is most likely the one described on https://developer.mozilla.org/en/Exception_logging_in_JavaScript and setting dom.report_all_js_exceptions preference to true should work. I must admit that I haven't tried that however because setting this preference makes the error console very noisy. Instead I use an ugly hack and load the module as a script in a local HTML file - this is enough to show me syntax errors and fortunately isn't something I need to do all too often (it is only an issue with syntax errors, runtime errors are reported as usually).

ICE32 Error from MSM

I have 4 MSM's that are needed for one of my products and they are all producing ICE32 errors when included. This would normally not bother me cause they are external errors and I still get my MSI and it works perfectly. The problem arrises though, that I can not request help from Microsoft with ANY issues that arise from this particular setup project if there are ICE errors (like good ole 32). Interesting side note is that the MSM's causing the errors are Microsoft modules.
Does anyone have any idea how to get rid of these errors short of editing the MSM files directly?
I have tried using EnsureTable element to no avail, and it is only these four MSM's that are used so I can't even try placing another merge module before them.
Turns out I was just ensuring the wrong tables. In total I had to ensure the Class, PublishComponent, Condition, TypeLib, and Extension tables in order to take care of the errors given to me by the VC_User MSM's from Microsoft. Hope this can help someone else find the problem a little more quickly.

Resources