using Microsoft.IdentityModel.Claims; fails in my Home controller! - asp.net-mvc-3

I'm following the Microsoft guide for implementing federated identities. As it doesn't state where the code should be placed I created a file \App_Code\Auth.cs for it. when it's time to implement the FederationResult to my home controller I try to use the aforementioned namespace but VS complains of missing an assembly reference.
The weird thing is that the code in Auth.cs doesn't complain... I've looked in the References item of the project and don't see anything I can recognise, although I did "Add STS reference" to the project. I've also looked in NuGet but don't see anything I should add...
what's going on here?

hmm... seems I just needed to add the reference manually. I don't know how come the assembly is available to some pieces of the code and not to others but it works!
One more thing, I needed to use Microsoft.IdentityModel.Web not .Claims

Related

Add dll´s from .nupkg to Unity Project without using nuget

I am trying to use Microsoft´s WorldLockingTools (repo see here) in my Unity Mixed Reality project. Therefore I need to add the Frozen World Engine DLL to my Unity Project. In Microsoft´s Documentation they describe to do this via nuget. I want to add the dependencies manually like described in this thread, since for me it´s not possible to use nuget (I have no network-access on that computer). I was able to extract the .dll, but if I add it to my project as described in that thread, unity still can´t find the dll. Do I need to do some further steps than just adding the dll to my Asset-Folder? If yes, can you please tell me which steps they are? I would be really thankful for that!
Best regards!
OK I figured out the reason behind this misbehavior. The problem is, that there is a c#-Script within the nuget-package additional to the dlls which has to be placed within the WorldLocking.Engine folder. After that all Exceptions disappeared and it seems to work now! I Hope I could help anybody who comes across this Question.

Visual studio complains about spatial types

I have these CLR types installed on my local https://puu.sh/yEWG5/b4f77fba7b.png
Also, I have SQL server 2016 installed on my local system but when I try to run the project I get error as below
https://puu.sh/yEWQm/78a4220830.png
Can someone help? I tried installing latest nugget package from https://www.nuget.org/packages/Microsoft.SqlServer.Types/ but it did not help.
Though I am able to add a column of type geography in a table in my local database. It fails at runtime when I run my project and error comes as below
https://puu.sh/yEWQm/78a4220830.png
According to the docs if you have installed the CLR Types it should load from the GAC so I'm not sure why that didn't work for you. (I would check that you have the correct version as your dependency)
However, we do use the SQLServerTypes in our app without installing the CLR types by using the following method (this method is described in the readme.htm that comes with SqlServerTypes).
Grab the SqlServerTypes.nupkg and extract it to a folder lets call this folder SST from now on.
(Locations of the files I talk about in the following steps may differ from version to version but, the principle is the same)
Create a SqlServerTypes folder in your project
Copy the SST/nativebinaries/x86 and x64 folders into your new SqlServerTypes folder
Also copy the files from SST/content (you should see Loader.cs and readme.htm) into the SqlServerTypes folder.
Now all you need to do is call the Loader when your app boots up.
We do this during our autofac setup by making this call.
Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory)
You may need to adjust the param passed into this method to work with your application. If the correct path is used you should have access to the spatial types in your code.
edit: It may be possible to just call the LoadNativeAssemblies straight away (and avoid all the work I posted above) if you have installed the nuget package in your app but, I have not tested this as we are stuck on an old version of SqlServerTypes.
Because i cannot put a comment i have to put a answer, you can check that, that article and this, this, this and this answers, i hope they guide you to someting usefull.

#import causes parse issue: "could not build module"

After updating with Xcode 6.3, I found something strange things with my projects.
Below codes causes parse issue that says "Could not build module 'AgendaFramework'", the AgendaFramework is my custom embedded framework for ios8:
#import MyEmbededFramework;
The error marker looks like this:
The issues is raised during indexing not building. Whole building can be performed successfully without any error or warning. I can build, archive, run on device, deploy, submit to App Store.
However the error marker shows up when I edit the classes that belongs to the extension. The the extension(widget) explicitly linked to the embedded framework. (I know that I don't have to do it when I use #import statement.)
In this state, I could not receive any valid content assistant, very annoying.
After I replace the import statement with old style, the problem was disappeared:
#import <AgendaFramework/AgendaFramework.h>
I have several other projects that have very similar topology with the project which causes this issue, But they are okay. Only one project causes this issue. I compared every detail build settings, I could not find any clue.
I tried:
Delete derived data
Full Clean
Reboot
Any clues are welcomed. Thanks!
It looks like turning on:
Allow Non-modular Includes In Framework Modules solved this issue for me.
Hi this is due to the fact that file which you are making it public in framework header must be public also.
Sometimes this issue can be solved by adding the framework to the same folder as the .xcodeproj file, no subfolders or anything.
Credits to Jonny who points it out as a comment in the question.
Solution that worked for me: diligence in framework header file orientation to system style imports... like #import <CoreXLib/CoreThreads.h> the story:
In my case my framework that I built came from the combination of several code bases as it became apparent that I could reuse some of the general design patterns across that code easer via Framework vs the fragile Xcode project pathnames.
As I built my framework "CoreXLib", I reorganized it into the Cocoa Framework typical of Xcode. I changed my imports from:
#import "CoreTypeAliases.h" // project local style
to
#import <CoreXLib/CoreTypeAliases.h> // system or framework style
appropriately. Several projects that used the CoreXLib.framework which includes the public headers in the lego-folder worked... so I thought I was good to go...
Unfortunately some of the headers that were public did not get fully updated. The classes in the framework built just fine in the local style. All projects using it worked up to this point and then I ran into one that didn't... and the error noted by #jeeeyul
So after finding this thread and finding #kwz 's solution, and not having it do anything in my case, I decided to polish the code up while I was trying to figure this problem out. In the polishing, I found that some of the #imports did not get changed like they should have in the Xcode search and replaces. Time for some hand-jamming...
After fixing all of those references in all of my CoreXLib project headers (not just the public ones, self defense), I dove back into the problem... I took the newly complied CoreXLib.framework over to the errant project that embedded it... and the problem had vanished! I checked the Allow Non-modular Includes... in both the framework project and the project that linked the framework in and both were "No". Flipping both to "Yes" and to "No" made no difference in several tests. The only other change was the #import "..." to #import <CoreXLib/...> modifications.
So sometimes polishing the apple 🍎 knocks the bugs🐞🐞off...
set YES in Build Active Architecture Only in build settings.
It worked for me.
Today I solved this problem by those steps,:
Chose the schema "MyEmbededFramework"
Press [Command + B] to build
From the build phase panel, add "MyEmbededFramework.framework" to Link Binary With Libraries
Try to build your project, the problem may disappear now.
you can try this, it's work for me. delete DerivedData dir that about your project.step by step
Turn off module's in build settings. That may work

Resharper completion won't look for different namespaces in project since v9

I may have done something wrong because since the v9 I can't get resharper to suggest classes from different namespaces (different from the current one) if I don't type the using first.
But anything outside the project is ok. So it looks in imported dlls without any problem but won't look in the current project.
Any idea how I could have done that? (looked at the jetbrains forum and didn't see any similar issue so I assume it's not a bug)
Thank you

Visual studio 2010 colourizers, intellisense and the rest. Where to start!

Ok, before I begin I realize that there is a lot of documentation on this subject but I have thus far failed to get even basic colourization working for VS2010.
My goal is to simply get to a point where I can open a document and everything is coloured red, from here I can implement the relevant parsing logic.
Here's what I have tried/found:
1) Downloaded all the relevent SDK's and such- Found the ook sample (http://code.msdn.microsoft.com/ookLanguage) - didn't build, didn't work.
2) Knowing almost nothing about MEF read through "Implementing a Language Service By Using the Managed Package Framework" - http://msdn.microsoft.com/en-us/library/bb166533(v=VS.100).aspx
This was pretty much a copy and paste of all the basic stuff here, and also updating some references which were out of date with the sample see: http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/a310fe67-afd2-4592-b295-3fc86fec7996
Now, I have got to a point where when running the package MEF appears to have hooked up correctly (I know this because with the debugger open I can see that the packages initialize and FDoIdle methods are being hit).
When I open a file of the extension I have registered with the ProvideLanguageExtensionAttribute everything dies as if in an endless loop, yet no debug symbols hit (though they are loaded).
Looking at the ook sample and the MEF examples they seem to be totally different approaches to the same problem. In the ook sample there are notions of Clasifications and Completion controllers which aren't mentioned in the MEF example. Also, they don't seem to create a Package or Language service, so I have no idea how it should work?
With the MEF example, my assumption is that I need to hook into the "IScanner.ScanTokenAndProvideInfoAboutIt" to provide syntax highlighting? Which would be fine if I could ever hit this method.
So my first question I guess is which approach should I be taking here? Or do they both somehow tie together?
My second questions is, where can I find a basic fully working project that implements bog standard basic syntax highlighting and intellisense or VS2010?
Thirdly, in the MEF example when I created a Package there were a bunch of test projects created for me. I appears that the integration tests launch the VS2010 test rig somehow, but the test fails. It would be good to write my service with tests but I have no idea what/how I can test each interaction so any references to testing Language services would be helpful.
Finally, please throw any resource/book links my way that I may find useful.
Cheers, Chris.
N.B. Sorry I realize this is part question part rant, but I have never been so confused.
First, the package example is not using MEF. Essentially everyplace that you mention MEF in your question is not actually MEF, but the managed package framework (MPF), also colloquially called the managed language service (MLS). You'd know if your extension was using MEF by two things: the vsixmanifest lists your assembly as containing a MEF component, and you see [Export] and [Import] attributes in the code.
The easiest way to do this is to use MEF. Since you have the SDK installed, you also have a template for an editor classifier project (under C# (or VB)->Extensibility->Editor classifier in the New Project dialog). You can certainly do this with a language service/colorizer/package, but there will be significantly more code than the equivalent classifier.
The Ook solution is the sample for this and should work; if it doesn't build/work, then can you send me email (noahric at microsoft) with what errors you are seeing so I can email the owner of that sample?
In general, you should also read my answer for the question on "How can I write a plugin for VS2010 using MEF?". That has links to other resources that should help.

Resources