What's the .NET 4.5 equivalent to UserNameWSTrustBinding? - .net-4.5

I am converting a active profile STS to the new .NET 4.5 System.IdentityModel framework. My code using the UserNameWSTrustBinding which doesn't seem to exist in the new framework. Any suggestions.

Although this is an old question, I couldn't find any non-third-party answer on the internet, so here it is:
To replace UserNameWSTrustBinding in .NET 4.5, use the following:
var binding = new WS2007HttpBinding(SecurityMode.{what it was before});
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;

I ported the WCF bindings to thinktecture identity model:
https://github.com/thinktecture/Thinktecture.IdentityModel.45

I also had a hard time finding something that for .NET 4.5 that was not a third party library. But I came across this link for code you can include in your project.

Related

INodeServices is obsolete: Use Microsoft.AspNetCore.SpaServices.Extensions

We've recently upgraded from ASP.NET Core 1.0 to 3.1.
And in our code we're using the interface INodeServices and call its InvokeAsync method to activate some JavaScript library. After the upgrade to Core 3.1 the compiler complains that INodeServices is obsolete and should be replaced with 'Microsoft.AspNetCore.SpaServices.Extensions', but I couldn't find any type within this library that I could use instead of INodeServices, and I also coudn't find any documentation about it. What is the replacement for INodeServices.InvokeAsync in ASP.NET Core 3.1?
Thanks,
ashilon
Consider using this library instead https://github.com/JeringTech/Javascript.NodeJS
For more detailed informations and to see what other people did, i suggest you give a look at this thread https://github.com/dotnet/AspNetCore/issues/12890

ASP.NET Dynamic Data Entities Web Project Broken

Can anybody get ASP.NET Dynamic Data Entities Web project working under EF 6.0.2 and .NET 4.5 in Visual Studio 2013?
I find problems in ManyToMany_Edit.ascx.cs and Global.asax.cs all relating to the switch in namespace for ObjectContext. Changing the using statements in the generated files is not enough. In other words, following this guide is not enough.
System.Web.DynamicData.dll doesn't seem to be aware of System.Data.Entity.Core.Objects.ObjectContext.
Have you read this post? http://blogs.msdn.com/b/webdev/archive/2014/02/28/announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6.aspx , this works for me

What are the Basic different between MEF for framework 3.5 and MEFfor framework 4.0?

I try to below link for window application with MEF
http://geekswithblogs.net/malisancube/archive/2009/05/26/managed-extensibility-framework-101---a.aspx
it's work good in Framework 3.5 but when i try to develop same code for framework 4.0
not able to find below function
return container.GetExportedObject<Form1>();
please give me some properly example for window application with MEF where my container all the Usercontrols on Form
MEF was being developed pre-.NET 4.0 but it became an official part of the framework from .NET 4.0 forwards. The API you are looking for is actually the ExportProvider.GetExportedValue<T> method which CompositionContainer inherits from:
return container.GetExportedValue<Form1>();
GetExportedObject was renamed GetExportedValue, and it occurred with MEF preview 6, which means that blog post was actually based on quite an early revision of MEF.

Zend-Framework 1.x with Doctrine 2.x

I know that there are many examples but this is my problem, because now I don't know which is the best and I don't understand every samples. This before I used doctrine 1.x and that was more simple for me, because there was only few steps to connect to database with doctrine and use it:
1.) Created User.yml file into application/doctrine/schema folder
2.) Run generate-models-yaml in cli which generated php classes into application/models/generated folder
3.) Again in cli run: create-db, create-tables
4.) In IndexController / IndexAction I can use it:
$newUser = new User();
$newUser->name = 'Demo';
$newUser->save;
And that's all. But with 2.0 I have some question:
- Where is the best place for mapping yaml files?
- How can I generate Entities from yaml? (Depending from the first answer)
- How can I create/drop db and tables?
- Which solution is the best EntitiyManager?
So I just want the most simple sample like my doctrine 1.x sample. Thanks!
For me best integration Bisna from Guilherme Blanco https://github.com/guilhermeblanco/ZendFramework1-Doctrine2
Step by step video tutorial using Bisna integration
http://www.zendcasts.com/unit-testing-doctrine-2-entities/2011/02/
Another very good example of ZF1 and Doctrine 2 with fully tested code (PHPUnit & Ant):
https://github.com/eddiejaoude/Zend-Framework--Doctrine-ORM--PHPUnit--Ant--Jenkins-CI--TDD-
They try to work best practice. Always.
Here is my two cents, I've wrote a Zend Framework 1.x resource for Doctrine 2.0
The source code is available on github.
This is another sample about zf1 and D2
https://github.com/marsbomber/zf1-doctrine2/tree/modular_setup
I used it and I think it was useful.

LinkBuilder.BuildUrlFromExpression not working anymore in .Net 4 / VS 2010?

I recently migrating my ASP.Net MVC 1 application from VS.Net 2008 / C# 3.5 to VS.NET 2010 / C# 4.0.
I massively used a builder to get URL strings from the strongly typed calls.
It looks like this :
// sample call :
string toSamplePage = Url.To<SampleController>(c => c.Page(parameter1, parameter2));
the code is added as an extension to the default UrlHelper :
public static string To<Tcontroller>(UrlHelper helper, Expression<Action<Tcontroller>> action) where Tcontroller : Controller
{
// based on Microsoft.Web.Mvc.dll LinkBuilder
return LinkBuilder.BuildUrlFromExpression<Tcontroller>(helper.RequestContext, helper.RouteCollection, action);
}
The only problem of this, is the reference to Microsoft.Web.Mvc dll, but the gain in readability was worth it.
Problem : it does not work anymore, return (null) whatever the parameters.
Questions :
is there a better way now to build links from an expression ?
(yes I tried to google it without success)
is there a trick to have the former LinkBuilder.BuildUrlFromExpression works ?
I tried to recompile it into C# 4.0, but the problem is that it implies working on my own compilated version of System.Web.Mvc which is not an option.
I'm currently trying to migrate to MVC 2 but I still have issues...
Waiting for your suggestions...
Our team overcame this identical issue by referencing System(Microsoft).Web.Mvc 2.0.0.0 statically in our libraries folder, as opposed to a GAC reference. This permitted us to continue working with MVC 1.0.0.0 projects and also gave us the downstream benefit of not having to install MVC 2 on our servers.
Oki, I found the problem.
I had assemblies versioning problems.
After rebuilding Microsoft.Web.Mvc + unistalling MVC 1 + refreshing all references it finally worked again.
It sucks because I still need MVC 1 for others projects, but at least my main problem has been solved.
To developpers new to the MVC framework : consider starting directly with MVC 2 / VS.Net 2010 / C# 4.0