Add a reference to the System.IdentityModel.Tokens DLL - asp.net-mvc-4

How do I add a reference to the System.IdentityModel.Tokens dll?
It does not seem to come up in the Nuget Package Manager.
Do I need to download the DLL?
I have .Net 4.5 installed.
The following code will not compile without the reference:
SessionSecurityToken sst = e.SessionToken;

It does exist on NuGet, and was last published 2013-02-08, so I don't understand why you couldn't find it. Try searching for System.IdentityModel.Tokens.ValidatingIssuerNameRegistry.
The best way is to install it is using the NuGet packet manager.
You can find the package here:
https://www.nuget.org/packages/System.IdentityModel.Tokens.ValidatingIssuerNameRegistry/4.5.0

In your solution, right click the References folder and choose "Add Reference"
From the Assemblies->Framework (.NET 4.5) list, select (check) System.IdentityModel and the press ok.
Add the using statement to the top of your class - using System.IdentityModel.Tokens;

In case it helps someone else.
Depending on what class you need you may also need reference to
System.IdentityModel.Tokens.ValidatingIssuerNameRegistry.dll
This may not be obvious as it may be implicitly required by specific element in web.config file and not explicitly required in code.

Related

BizTalk: How to get all dlls from an application?

I would like to build an external app (console application) which inform me for the DLLs versions that are used in an BizTalk application.
Of course with a quick search I find some examples which are use the Microsoft.BizTalk.ExplorerOM DLL,
but these examples shows only the DLLs that exist in [BizTalk_Local_MgmtDb].[dbo].[bts_assembly] table which when I see them in BizTalk health monitor they have type System.BizTalk:BizTalkAssembly.
I would like also to add in my app (Console application) the DLLs of type System.BizTalk:Assembly which for example can be a helper class which are not listed by Microsoft.BizTalk.ExplorerOM because, I guess, they not exist in [BizTalk_Local_MgmtDb].[dbo].[bts_assembly] table
Have someone any idea how I can achieve what I want?
I found them, these assembles exists in managmentDB in table [BizTalk_Local_MgmtDb].[dbo].[adpl_sat]
So if I understand the question correctly:
You are creating a utility console application, which uses "Microsoft.BizTalk.ExplorerOM". And your "helper class Assembly" is not being listed in your "Console application" because it is not of type "System.BizTalk:BizTalkAssembly".
I'm afraid that you won't be able to do so, as you can't add a class library as "System.BizTalk:BizTalkAssembly". Here is the error we get when try to do so:
You can make try using "System.Reflection".
For your components to be considered as BizTalk Artefacts, your project should be .btproj
Then deploy your components same way you deploy your biztalk applications.

File or assembly name ****.dll or one its dependenies not found

I have added a new service reference to a vb.net dll after excluding the previous one. While debugging, When I am sending a request through a form, the new reference is not able to create a object.exception is at this line:
Dim ObjPricingService As New PricerWebService.MedicalProductService_V2_0
MedicalProductService_V2_0 is the new service reference. The exception is:
File or assembly name ****.dll or one of its dependencies not found.
Source:mscorlib
the name of the *.dll changes every time I debug..so its a random one. the code is built in Visual Studio 2003.
Please provide a solution.
It sounds strange, that the Library changes the name every time you debug. The best thing todo, is to try to set an standard name (if you wrote the library). Also you can try to
Import PricerWebService
and then to use only
Dim ObjPricingService As New MedicalProductService_V2_0
If this will be not fix your problem, try to upgrade your framework + Visual Studio Version (VS2003 what?).
BTW: It would be great if you can send us the error text ;)

Where can I get Tridion.ContentManager.Data.ContentManagement DLL?

I want to access "Fields" property for accessing fields of a schema in core services in SDL Tridion but Visual Studio says I am missing an assembly reference.
I searched for namespace and it requires Tridion.ContentManager.Data.ContentManagement DLL. Where can I find this DLL?
There's no Fields property on CoreService. If you see it - you probably have mixed references to TOM.NET and CoreService. You need only reference to CoreService client dll and nothing more. If you wan't to have something similar to Fields implementation - you may take a look at this article: http://code.google.com/p/tridion-practice/wiki/ChangeContentOrMetadata
If you want to have the Tridion.ContentManagement.Data.DLL just do this:
Open cmd from Run
Navigate to C:\Windows\assembly\GAC_MSIL\Tridion.ContentManager.Data\6.1.0.996__ddfc895746e5ee6b>
Copy the file to a folder you want

COM unregister/register type library problem

I have a .NET COM DLL that I want to unregister. I do:
regasm.exe /u ConfigManager.dll
When I look with COM-ole viewer app I still see in type libraries section an entry for ConfigManager( specifies the path to ConfigManager.tlb there). How can I make sure I deregister for good any entries of ConfigManager.dll COM ?
I ask this because I have a nasty error where it seems that ConfigManager clients do not see some types from ConfigManager and want to make sure I deregister and register again ConfigManager
You just need a typelib registration utility. TypeLibs are not specific to .NET so you can find these kinds of ones anywhere.
Here's a simple one:
http://www.vbaccelerator.com/home/vb/utilities/Type_Library_Registration_Utility/VB6_Register_TypeLib_Utility.asp
I prefer to use TlbExp instead of the /tlb option of RegAsm to get a typlelib without automagically registering it. That way I can explicitly register (or unregesiter) the typelib.

How do I write a working IThumbnailProvider for Windows Vista

I have written a thumbnail provider following the interfaces specified on MSDN. However, I have been unable to figure out how to register it in a way that Vista actually calls into it. Has anyone gotten a thumbnail provider working for Vista? Sample code or links would be especially helpful.
The documented way to register your IThumbnailProvider is to create a registry entry at HKCR\.ext\ShellEx\{E357FCCD-A995-4576-B01F-234630154E96} and set the (Default) string value to the GUID of your IThumbnailProvider.
Your assembly will need to be registered first. If using .NET, that means you will need to use the RegAsm.exe tool to register it.
There is sample code available here: http://www.benryves.com/?mode=filtered&single_post=3189294