Recent Comments



floyd
Yesterday

re: Adding minimal OWIN Identity Authentication to an Existing ASP.NET MVC Application

This is the best article about AspNet.Identity I've read ever!

Pamela
Tuesday

re: Custom ASP.NET Routing to an HttpHandler

I downloaded the sample project and put a copy of westwind.web.dll in my own project, but the CallbackHandler in that assembly only has 2 properties—IsReusable and RouteData—no Context, Request or Response. Where can I get a compiled dll whose CallbackHandler has all 5 properties?

Doug Dodge
Saturday

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

@Rick - Can't resist.. Off topic so apologies.

I noted in your two articles the words "Today" and "Tomorrow"

Reminded me of a joke; The Past, the Present and the future all got together in the same room.

It was tense. *g*

Doug Dodge
Saturday

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

@Rick, The article that lit me up was <a href="http://www.defmacro.org/ramblings/fp.html/">Functional Programming For The Rest of Us</href> written in June 2006 by Slava Akhmechet.

Recommended if you haven't read it yet

Rick Strahl
Saturday

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

@Doug - yes I think that where we're heading. Small, single responsibility UI components that can be plugged together to create a whole. Reusability by design and testibility by simplicity. As I mentioned in the post this sounds great, but it really takes some mental adjustment to work this way effectively - it does scatter things about quite a bit and it takes a dedicated workflow to be able to keep things organized.

Doug Dodge
Saturday

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

@Rick - Great article as always; thanks. Also, a big shout out to Pluralsight. Before their recent move their old office was about 3/4 of a mile from where I live. Great folks and product(s). So, having no time whatsoever :) to take advantage of my Pluralsight membership nor to keep up with the recent changes like React & Flux the article summed up for me nicely what I do think, if I am reading this all correctly, the larger directional move of our industry. I appreciate you doing all the heavy lifting (again *s*).

In the abstract sense all of the changes in these new products seem to me to be moving in the direction of the Functional programming model. I heard small objects, each with a discreet task, with predictable results for predictable input. Maybe I'm misunderstanding but it sure seems that way.

Thoughts?

Ben
August 28, 2015

re: Building a better .NET Application Configuration Class - revisited

Hi Rick

Thanks for your blog post

I am using a console application to test your code. But with the console application, there are no dlls so what should i put after type="" ??

any pointers would be appreciated, because I am young to .net and it would take me a long time to work it out otherwise.

regards
Ben


<configSections>
    <section name="MyCustomConfiguration" requirePermission="false"
             type="Westwind.Utilities.Configuration.MyCustomConfigurationSection,Westwind.Utilities.Configuration.Tests"/>
  configSections>
.

Adam
August 28, 2015

re: Azure VM Blues: Fighting a losing Performance Battle

Thank you for this post! I've been looking all over for other opinions on Azure because I am definitely getting frustrated. I am in the same boat right now as far as having a physical server and trying to move to Azure VMs. It's definitely tough to see what kind of hardware specs I will get with Azure compared to what I currently have on my physical server, but I really need to move to a hosted solution. I am looking to move around 10 sites to an Azure VM while also running a local SQL Server instance and right now I am on the Standard A0 instance to keep the monthly cost down, but I'm not sure it is going to be enough with 0.25 Cores & 0.75 GB of memory. I have also been looking at AWS and it seems that the RDP isn't as slow but I'm still going to get minimal resources unless I want to fork out a bunch of money (personal budget here as well). I really need to find something that provides decent resources and won't suck my wallet dry, and I don't need all the bells and whistles as far as the admin side goes.

Brad
August 27, 2015

re: Windows 10 RTM Upgrade and Driver Update Issues

This fix assumes you know which driver is failing. What do you do if you cannot tell what is causing the install failure?

Torgeir Helgevold
August 27, 2015

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

@Rick:It's a fair point that similarity is relative, but I don't think components offer better modularity than Angular 1.x. Granted, it's true that the api surface of Angular is too complex, but if you model your directives with all your logic in directive controllers, there is not much of a difference between Angular 1.x "components" and Angular 2.0 components - at least on the surface. I also attribute some of the "cleanliness" of Angular 2.0 to the new direction of using TypeScript. In fact if people started using TypeScript with Angular 1.x I bet people would praise Angular 1.x code as well :-)

There are however other benefits to Angular components under the hood. They have promised to decouple the components from the runtime environment, which means we get some of the same benefits as React offers.

As far as migration goes... I disagree with you that it's unwise to migrate a project to the next version of the framework. Picture a multi year project. Going forward with yesterdays's technology is undesirable for a few reasons. 1) Hard to attract talent 2) You end up losing out on the new cool features of the next version.
That said. In light of the recent news that Angular 1.x and Angular 2.0 will be able to coexist in the same project, we pretty much get the migration for free.

Rick Strahl
August 26, 2015

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

@Corey -

> Rick watching one of my courses? Achievement unlocked! :)

LOL. I struggle as much as everybody else trying to keep up with all this change and Pluralsight has been a good resource for high level exploration... finding time for watching a multi-hour course even at x2 speed is the biggest problem :-)

Rick Strahl
August 26, 2015

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

@Torgeir - Similar is a relative term. Directives in Angular 1.x are a terrible API construct in terms of implementation. Angular 2's implementation of a component is much cleaner and because of it components can serve multiple purposes as components and controllers. My point in the post is that Angular is consolidating things into simpler constructs and less API surface which makes things easier to work with.

As to new concepts - there are plenty in Angular 2. Today few people really build modular applications with Angular. Most people build essentially complex controllers with directives as needed to handle reusable features or for interfacing with the DOM directly to abstract low level logic. In Angular 1 you'd be crazy to build a modular application out of directives only.

Backwards compatibility and the ability to migrate is overrated. If you have a running application there's no great need to migrate it. I would not recommend going down that road unless you're planning to do a major rewrite/refactor anyway. 'Migration' rarely makes sense IMHO it's just running in a hamster wheel and not making any progress while wasting development resources.

If you really want to take advantage of Angular 2 (or any of the other frameworks) you'll want to go full bore and do ES6 modules, and classes etc. Porting an app from ES5 to that will not be a weekend job...

Torgeir Helgevold
August 26, 2015

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

In my opinion Angular 2 doesn't really introduce a new concept by releasing "components". Angular 2 components are very similar to Angular 1.x directives if you stick to directives supported by external "controllerAs" controllers. The old .controller will be retired, but the new Angular 2.0 component class is really just the same concept all over again :-)

The component vs directive similarity will help a future migration since the concepts are so similar. I have done a comparison here in case you are interested: http://www.syntaxsuccess.com/viewarticle/migrating-from-angular-1.x-to-angular-2.0

Cory House
August 26, 2015

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

Rick watching one of my courses? Achievement unlocked! :)

You've hit on the biggest downside to choosing React: The paradox of choice. There's multiple routers, many Flux implementations, many ways to handle data calls, validation, etc. You're right - Comparing React to Ember and Angular is apples and oranges. React is just a component library. But if you're someone who likes picking best of breed technologies, React with React Router and some flavor of Flux is a compelling option. It's the polar opposite of Ember, which of course has its plusses and minuses. But it does make it extremely versatile - you can sprinkle React like salt on existing projects. And if you find it's tasty, you can make a full meal of it.

Mike Gale
August 26, 2015

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

If WebAssembly ever comes to pass that will take the "JS only" out of this debate. No doubt make it more complex. Presumably that's years away, even if it does happen.

Rick Strahl
August 26, 2015

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

@Corey - thanks for the feedback. Yeah I think Ember managed the transition to 2.0 a lot better than the other frameworks. But if you want to use all the greatest stuff you still will have to deal with the ES66 builds steps. Ember's CLI generator creates a massive amount of stuff that as a newbie is totally overwhelming even if you are already using other frameworks.

As to React and Flux: I think React and Flux are an aquired taste, to me personally I'm not happy mixing HTML markup and code in the same place (too much of a throwback to ASP Classic :-). React also isn't really a framework per se - more of a view engine and it excels at that part of it. Other things have to be explicitly built on top of it and there aren't a lot of standard implementations it seems. For example form no standard form validation.

But to be fair I totally get the attraction and the key is to build everything as small components so that the HTML/JS intermixing is minimal and doesn't turn into a mess. It might take me a few more attempts and some more in depth research to support functionality to dig a bit deeper. Hey your Pluralsight course is on my list :-)

Cory House
August 26, 2015

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

Great writeup Rick. You've summarized the current state well.

However, I'd argue version 2.0 doesn't necessarily mean it's a significant shift. For example, Ember's initial 2.0 release simply removed already deprecated functionality. So release numbers don't necessarily mean much. And that's important because I'd argue React's .13 combined with the Flux library of your choice is already a generation ahead of the current crop of "Version 2" libraries you're discussing. Why? I believe the fundamental mistake other frameworks are making is continuing to be HTML-centric instead of JS-centric. I explore this issue more here: https://medium.com/@housecor/react-s-jsx-the-other-side-of-the-coin-2ace7ab62b98

Angular, Ember and Knockout put “JS” in your HTML. React puts “HTML” in your JS. That's a powerful paradigm shift. And one I'd argue the "next-gen" frameworks shouldn't ignore.

Stephen Cleary
August 26, 2015

re: The Rise of JavaScript Frameworks – Part 2: Tomorrow

Thought you may be interested in this...

One of the big takeaways I had from ThatConference is that JavaScript is making a huge push into native mobile. React Native (by the React team) and NativeScript (by Telerik) are both vying to be the future cross-platform mobile solution. I thought the approach with React Native was particularly interesting: they're using jsx just with native components instead of DOM components.

Johan
August 26, 2015

re: AngularJs ng-cloak Problems on large Pages

I've had problems with the brief displayof angularJS expressions too, even though i was using the ng-cloak construction. (including the ng-cloak styleclass with display: none !important; in my css file) It turned out that in my case, the ng-cloak construction was working properly, but the flickering was caused by debugging tools. In my case firebug was also enabled, which caused slow rendering of the page (timing issues). When I disabled firebug for my page, everything worked as it was supposed to. (no flickering)

Jan Onder
August 25, 2015

re: Rebooting Database Localization for ASP.NET with West Wind Globalization 2.0

@Rick thank you very much for quick reply and I think I am going back to MVC5, because I also found a lot of issues in new ASP.NET5. Nevertheless thank you for your amazing work :)

Mike
August 25, 2015

re: Rendering ASP.NET MVC Razor Views outside of MVC revisited

Hi Rick and thanks for your quick reply. I figured it was something like that so now I know I'm on the right way.

I really enjoy reading your blog so please keep up the good work and good luck in the future!

All the best,
/Mike

Rick Strahl
August 25, 2015

re: Rendering ASP.NET MVC Razor Views outside of MVC revisited

@Mike - if you have existing controllers and controller contexts that you want to use you can use standard DI in ASP.NET to get the controllers injected as usual. If you're creating a new context completely you'll have to add that functionality in the CreateController  by using reflection and ServiceProvider explicitly to inject the constructors since it doesn't go through the standard ASP.NET mechanism of creating the controllers.

Rick Strahl
August 25, 2015

re: Rebooting Database Localization for ASP.NET with West Wind Globalization 2.0

@Jan - it's not going to work in ASP.NET 5 even when running with the full CLR runtime, due to the dependency on web.config configuration and HttpContext in many places.

ASP.NET 5 hasn't even nailed down localization semantics yet. I think it'll be a lot easier to hook into the new pipeline (based on what the ASP.NET Team is talking about in their preview samples) but it'll be very different.

In short the server side code will need a big rewrite to make it work. I will eventually port it, but the platform is so unstable at the moment that I don't want to waste my time.

Awesome
August 25, 2015

re: Multiple Desktops in Windows

Prayers answered with new trackpad software:
http://www.trackpadextramagic.com/

I bought an apple trackpad and a bluetooth dongle from BestBuy to operate my 4K PC home theater. After installing the software I'm able to 4 finger swipe back and forth between desktops like on my MAC. I was on the verge of selling my x51R2 to buy a MAC, now I'm perfectly satisfied with Windows.

Jan Onder
August 25, 2015

re: Rebooting Database Localization for ASP.NET with West Wind Globalization 2.0

Hello Rick,

first of all thanks for this amazing work, but I would like to ask how is it possible to implement Globalization to ASP.NET5/vNext project as it changed a lot (for starters replacing web.config with config.json) and I am not able to get it functional. I already tried to add Westwind.Globalization.Web.Starter but to no success as there is no Configuration generated and no LocalizationAdmin accessible.

Thank you very much

Mike
August 25, 2015

re: Rendering ASP.NET MVC Razor Views outside of MVC revisited

Hi Rick,

Thanks for your excellent work!

Do you have any idea how this may be implemented in a scenario where dependency injection is used on some of the controllers and the constructors needs to be feeded with some parameters?

Cheers,
Mike

Firegarden
August 24, 2015

re: Adding minimal OWIN Identity Authentication to an Existing ASP.NET MVC Application

Your tutorial was the best Rick. I tried to get this to work quickly with every other tutorial out there but could not get past the need to expose

IAuthenticationManager AuthenticationManager
{
get { return HttpContext.GetOwinContext().Authentication; }
}

Also if you don't have using System.Web which is common in an MVC project you will have an even harder time. Word to your mother.

Damir Colak
August 24, 2015

re: Azure VM Blues: Fighting a losing Performance Battle

I had exactly the same experience as OP did. I gave up on Azure.

Windows 10, Azure, Microsoft is dead.

Rick Strahl
August 20, 2015

re: Using Cordova and Visual Studio to build iOS Mobile Apps

You probably have to modify your firewall rules to allow Visual Studio to communicate with the Mac.

Nayos
August 20, 2015

re: Using Cordova and Visual Studio to build iOS Mobile Apps

Hello !

Well, this tutorial seems nice, but unfortunatly, I have a 404 every time I try to connect the remote agent on the mac.

Maybe I did something wrong, but it's appear right now to be a pain in the ass to use an IOS....

Rick Strahl
August 19, 2015

re: Auto Selecting Cultures for Localization in ASP.NET

@rudy - that depends on what you are using. In most of ASP.NET you can use

HttpContext.Current.GetGlobalResourceObjects("resourceSet","resId")


https://msdn.microsoft.com/en-us/library/ms149949(v=vs.110).aspx

If you're using MVC or WebAPI you're likely using strongly typed resources.

rudy
August 19, 2015

re: Auto Selecting Cultures for Localization in ASP.NET

Give an example of how to get a string in the appropriate localized language from the resource file in the C# code based on the user's culture passed in with the HTTP request.

mknopf
August 19, 2015

re: Windows 10 RTM Upgrade and Driver Update Issues

Thanks, this helped me resolve a problem where Windows Update was attempting to install an NVIDIA GeForce graphics driver for a graphics card I don't even have in my machine anymore. I cannot understand why MS would have removed this functionality and only supply this feature as an extenstion rather than something thats built into the OS.

Michael
August 18, 2015

re: Azure VM Blues: Fighting a losing Performance Battle

You really should try transip.eu. I'm using this hoster for more than 2 years. You get 150gig ssd, 4 gig ram , 2 cpu for 25€/month. Nobrainer from where I'm standing :).

Rick Strahl
August 17, 2015

re: A Small Utility to Delete Files recursively by Date

No that's not supported - wildcards can't be applied to folders only to the file filter.

Herbert
August 17, 2015

re: A Small Utility to Delete Files recursively by Date

Hi,

I'm looking for a solution where I can use the '*' char in the middle of the pathname, like below.

DeleteFiles f:\ABC\*\XYZ\*.* -r -f -d10

The '*' in the middle of the path can be 1 or more sub folders

Does this tool work with this?

Kind regards, Herbert

Rick Strahl
August 16, 2015

re: Using Cordova and Visual Studio to build iOS Mobile Apps

@Patrick - No not directly for this sample. I've been using an ASP.NET 5 project for this which lives here:

https://github.com/RickStrahl/AlbumViewerVNext

Patrick
August 16, 2015

re: Using Cordova and Visual Studio to build iOS Mobile Apps

Hi Rick,

Great article! Is the source code for the webapi available somewhere? I am interested in understanding how the json data is generated when calling the webapi in the scenario where "useLocalData" is set to false.

Thanks,
Patrick

Rick Strahl
August 14, 2015

re: Trying to implement IImplicitResourceProvider

@Hans - the code that implements IImplicitResourceProvider is legacy code that hasn't been updated in ages. The resource provider implements it and it still works - in the past it was required in order to get Visual Studio's resource creation and design time experience to work. I think the runtime functionality never required it. I know it still works, but not sure if it would work without it now.

Hans Melin
August 14, 2015

re: Trying to implement IImplicitResourceProvider

A few years later but still relevant since I see that you still implement this interface in your library, https://github.com/RickStrahl/Westwind.Globalization.

Could you please explain why you do that because I don't see why?

According to the documentation, https://msdn.microsoft.com/en-us/library/system.web.compilation.iimplicitresourceprovider(v=vs.110).aspx there is no need for that:
"If you create a custom resource provider, you do not need to provide customized support for implicit resource localization. Implicit localization will work with your resource provider."

And according to this post the implicit resources are resolved runtime from IResourceReader on the IResourceProvider
https://msdn.microsoft.com/en-us/library/aa905797.aspx

Wagner Melo
August 12, 2015

Zijian
August 12, 2015

re: Passing multiple simple POST Values to ASP.NET Web API

Web API 2.2 apparently has fixed the problem of posting multiple simple type parameters in query.

Rick Strahl
August 11, 2015

re: A WebAPI Basic Authentication MessageHandler

@Johnny - you can check the username in the Identity of the request - it's set there. As to redirect in MVC project that's the behavior forms authentication - which is 302 redirect followed by the login page access which is standard behavior for FormAuthentication or Identity. If you don't want that behavior you'd have to turn off Forms Auth or Identity or configure them to not redirect to the login page and fire just a 401 instead.

Jonny Knott
August 11, 2015

re: A WebAPI Basic Authentication MessageHandler

Hi,

Great post(s), very helpful for me, especially as I'm a complete novice in this area.

I would like to persist the user information to my api controller...so that when I authenticate them I am able to tell which user exactly it is so that I can perform the correct tasks in my action methods. For instance if I call the API with my username and password encryption, and the method is to return my messages, I want to be able to know it is me in the API so I can query the db accordingly.

Have you any advice in this regard?

Also I'm having trouble integrating this because I have added Web Api into an existing MVC project, and when it fails this authorization it is strangely still returning a 200 response with a login page cshtml. Is there anything I need to change in my pipeline when integrating this with an existing MVC site?

Any help would be VERY appreciated, thanks a lot for the post.

Rick Strahl
August 10, 2015

re: Web Browser Control – Specifying the IE Version

Did you restart? The change has to be made before the app is started or else the registry change is not read.

Harry Cummings
August 10, 2015

re: Use IIS Application Initialization for keeping ASP.NET Apps alive

This is a really useful article, thanks!

This article doesn't mention the doAppInitAfterRestart attribute of the applicationInitialization config element. From my understanding of the documentation, I believe this would be a simpler way to address the cases covered in "What about AppDomain Restarts?" above. Is anyone able to confirm/deny this?

Jeremy
August 10, 2015

re: Strongly typed AppSettings Configuration in ASP.NET 5

How can I debug the configuration errors?

Essentially I'm looking for a way to create a strongly typed configuration, however I keep getting an InvalidOperationException... Of course DI never throws the error so I have yet to be able to see the stack trace or anything else of value.


services.Configure<LIS.Core.Configuration.CORSConfiguration>(this.Configuration.GetConfigurationSection("CORS"));

Any ideas?

Web Browser Control – Specifying the IE Version
August 09, 2015

re: Web Browser Control – Specifying the IE Version

Hi,

Great Post..Thanks a lot...

But small issue......

I created a new class to specify the IE version in registry as Machine or Current User.But first time my application not working,second time its working fine...Any update or refresh command required for Webbrowser Control.

Harvey Mushman
August 09, 2015

re: JavaScript JSON Date Parsing and real Dates

Interesting and very informative!

Wondering if it would make sense to write up an example that could be used as a directive in AngularJS? Seems to me that if it really only effects the <input type=date... why not just add on the element that is effected say fix-iso-date?

app.directive('fixisodate', function...

Is this something you might want to post? <g>