Recent Comments



Rick Strahl
Thursday

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

@Chris - yes it's possible but you probably have to muck with the firewall settings in Windows to allow the port to open. Maybe on the Mac too - I can't recall but it definitely works with the VM. Just make sure you use the right IP Address since they are different.

chris
Wednesday

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

Hi Rick

I have my xcode and mac running in vmware on my windows machine. Is it possible to build straight to the mac on vm. Tried using the IP address (IPv4 using DCHP) but wont connect. Any ideas.

Rick Strahl
February 08, 2016

re: Web Browser Control – Specifying the IE Version

@Pavel - Navigating to file is the best thing you can do actually because there's an actual document there to start with. As you found out about:blank isn't a real HTML document so you can't really modify it. And you do want to navigate so you can load a complete HTML document including doc type and docheader so you have full control over the HTML rendered. That's what I do in my offline apps that use Web Browser. Additionally this is nice because you have a debug trail - you can open the doc in a different browser and use debug tools if you need to (which you can't do in the Web browser control).

Pavel
February 07, 2016

re: Web Browser Control – Specifying the IE Version

@Rick, I'd like to avoid using files. But your suggestion pointed me to the "navigate to correct document" solution.

about:blank is the problem! Using different about:xxxxxxx causes the document to load in different mode.
about:navigationcanceled as initial navigation worked fine for me.

Thank you

Rick Strahl
February 05, 2016

re: Web Browser Control – Specifying the IE Version

@Matt - POWERPNT.EXE

@Pavel - if you need to load a full page I recommend you write a file to disk then navigate to disk. You can then apply the appropriate DOCTYPE to the document that's on disk.

Pavel
February 05, 2016

re: Web Browser Control – Specifying the IE Version

Hello again,
I'd like to review the statement. Using wb.Navitage("http://someurl...") works fine for 9000 as well. And there are all linebreaks for 11000.

How do I achive the same for wb.Navigate("about:blank") and wb.Document.Write(<!DOCTYPE><html><head></head><body>" & txtText.Text & "</body></html>") ? It seems that the document mode is not loaded properly in this scenario.

Uday
February 04, 2016

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

Hi Rick this article is very nice.

If want to know in deep about OWIN and how to use it with .NET which is the best tutorial or a reference book.

Can some one please suggest.

Ryan
January 30, 2016

re: Gotcha: Entity Framework gets slow in long Iteration Loops

Thanks. This was really helpful.
Even though I was calling SaveChanges() inside my loop, it was still incredibly slow.

Rick Strahl
January 30, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

@TonyH and @Matt - You're absolutely right that for the typical developer, it's perfectly fine to wait for RTM and not care about the mess that came before it. That's fair enough for early adopters to get yanked a bit and ultimately it only matters what comes out at the RTM bit.

But... the concern and what I tried to convey in this post is that if RTM is rushed, the treadmill we've been on is likely not going to stop and that pain we've seen so far might very well continued post RTM. I'm hoping by encouraging Microsoft to take more time (as they are apparently going to be doing) to give them more lead time to make sure that a) RTM is a stable core that can be built upon without worrying of constant API and library changes and b) that provides the necessary developer surface needed to get stuff done - both at the application level (which is likely to be Ok) as well as the component/library developer level.The latter is often forgotten in this discussion, but it's a very important aspect especially in this early cycle where library authors are encouraged to update their libraries to work on Core.

Previews allow for getting stuff out to developers actually building REAL stuff which is what really determines viability and I'd argue there's been very little of that so far because of the 'moving target' status of the current development. I know in previous major .NET version upgrades I started in early beta cycles to move over some of my production applications to the new stuff. And while there were always a few things that would go wrong, overall the changes post-beta were pretty minor. With  Core this hasn't happened, because it's just not been stable enough to build anything that I can keep running through the previews.



Tom
January 29, 2016

re: Application that won’t Pin to Taskbar in Windows 7

I had the same problem but it wasn't the name that was the cause. Rather it was the location. I have a small USB flash drive that I keep plugged into my computer at work on which I keep my music and a portable chat program along with its data files. I was unable to pin the chat icon to the taskbar. I finally realized that if I make a copy of the EXE on the C drive and create the shortcut using that copy then I can pin it to the taskbar. After pinning, I edited the properties of the taskbar icon to point to the USB location and removed the temporary files from the C drive.

Adam
January 28, 2016

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

Does it really only make requests over localhost? If so what are the hostname and initalizationPage settings for? Can i set the hostname with a custom host or ip address? will this override it trying to make requests over localhost? enter image description here

Does it work over SSL?

Does it work with authentication? Within the original Application Warm-Up implementation it looked as though you could specify auth credentials but i don't see how that is possible anymore.

Shawn Kovac
January 28, 2016

re: WebAPI: Getting Headers, QueryString and Cookie Values

as Will pointed out, a fundamental flaw in your code is that duplicate keys like 'key=1&key=2&key=3' will break your code. that's because IDictionaries (Dictionary and SortedList) are slightly different than what you'd expect for QueryStrings and Form values and cookie values. in all these, a duplicate key shud give a result that resembles 'key=1,2,3'. This is why .NET has a NameValueCollection. In terms of efficiency and speed, the NameValueCollection uses an internal hash table, so it's lookup speed is as fast as Dictionary<string, string>. But it terms of duplicate keys, the NameValueCollection works as it shud with duplicate keys, where the values are combined. This is also why Request.QueryString is a NameValueCollection and *not* a Dictionary<string, string> nor a SortedList<string, string>. Happy Coding!

Theof
January 27, 2016

re: Going Big: 40 Glorious inches of 4k with the Philips BDM4065UC

Hi Rick,

Your review introduced this monitor to me, and while I resisted the urge to get it since (also a review about color banding in Amazon), I couldn't resist any more, and I've ordered it.
Waiting for the monitor to arrive :) Far too many monitors in the house, but it's ok. Others have a passion for collecting cars..

Thank you for all your contributions all these years! You've been a source of inspiration!
Cheers

Andrei
January 27, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

Awesome post.
I also agree it's very important that v1 of ASP.NET 5 will work as advertised.
Since it's a rewrite, the performance and stability prevail over the features.

Chris
January 27, 2016

re: Azure VM Blues: Fighting a losing Performance Battle

Why use VMs at all? It doesn't sound like you need a full Server environment to host custom applications. If all you are hosting are web sites and web/db apps use the PaaS rather than IaaS parts of Azure. Put a little time into configuring you web sites into Azure Web Apps or Azure App Services. Cheaper, faster and nearly no administration.

Thomas
January 27, 2016

re: Interactive ASP.NET Resource Linking and Editing with Westwind.Globalization

Hello,

First of all, thanks for a great blog and a great globalization library :-)

I'm playing around with your globalization library, and a couple of things strike me.
When using the library on a public website, how is it possible to properly secure ONLY admin access to the /LocalizationAdmin folder and files within ? I hide all the localization GUI stuff from the frontend. In my code-behind (yes, I'm using asp.net 4.0) I simply check for a specific user and role combination. This works fine, and everything seems to be good. But when I (or google or a hacker) does some manual directory traversing on the website, and hits the /LocalizationAdmin folder, the interface appears. No authentication needed. Am I missing something? Is that behavior expected? If not, can you give me a hint on how to secure that folder?

Do you in the future intend to use stored procedures when communicating with the SQL-Server database?

I hope you'll take the time to answer my questions.

/Regards
Thomas

Matt
January 26, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

Nice post Rick.

Echoing what TonyH says above. Agree with you that the naming is a shambles, and feel sorry for you and all the other early adopters.

Me, I'll wait until it's released and then worry about learning it. Given how stripped down the new .NET Core will probably be I doubt I'll even use it in production until version 2. There's always the the age old wisdom of "wait until version 3 for any Microsoft product".

Matt

Muhammad Rehan Saeed
January 26, 2016

re: FontAwesome Fonts and Mime Types in IIS and other Web Servers

It's not just woff2 that's the problem, there are a bunch of other missing MIME types like application/json. It doesn't stop there either, there are some MIME types that are simply incorrect or using older non-standard MIME types for particular file extensions. These incorrect types generate warnings in browsers like Chrome. I submitted a pull request to ASP.NET 5 which adds these missing types including woff2 and also fixes a few incorrect types.

For ASP.NET 4.6, you can take a look at the ASP.NET MVC Boilerplate (See https://github.com/RehanSaeed/ASP.NET-MVC-Boilerplate) project which contains a Web.config file with the above fixes (See https://github.com/RehanSaeed/ASP.NET-MVC-Boilerplate/blob/master/Source/MVC5/Boilerplate.Web.Mvc5.Sample/Web.config). In particular you want to look at the staticContent section.

ForgotMyName
January 26, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

Thanks a ton, Rick! Looks like the folks in Redmond got the message. RC2 and RTM got TBDed in their roadmap.

Jonathan
January 26, 2016

re: FontAwesome Fonts and Mime Types in IIS and other Web Servers

I've been seeing those woff 404 logs in the Chrome developer console for a while now, but I haven't bothered to actually try and "fix" them, or even to go and look for an explanation. I'm glad that I finally understand what it's all about now, having stumbled on this blog post of yours. Thanks! :)

TonyH
January 24, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

The name change is not late for the people, like myself, who haven't looked at ASP.NET 5 yet. I decided not to spend any time with it because, like you said, the alphas and betas kept changing. I am not looking forward to experience the pain of using software which won't work as expected. I will spend too much time figuring out if it's my setup and code or Microsoft's setup and code. I am in no rush to play with it. They can call it whatever they want. When it's out and RTM, I'll learn it and use it pretty quickly. I follow your tweets about your experiences and sometimes I want to feel sorry for you :)

Peter
January 23, 2016

re: UNC Drive Mapping Failures: Network name cannot be found

I had the same problem with windows 10 after the upgrade. I changed the order of the providers to LanmanWorkstation,RDPNP,webclient as you did and it worked! Thank you very, very much!

Steve
January 22, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

@Rick - ok, I believe you. Just after reading your articles for 12 years I thought maybe I had your words and sentence structure "profiled". :-)

Chris Woodward
January 22, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

Great Article Rick. At last a heavy dose of realism. Maybe Scott and Damian will invite you to the next Community Stand Up to air these concerns ? :-)

Adam
January 21, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

Nice post Rick.

I think one thing to remember is that you can still run on top of the full framework, so all those libraries won't need to be ported just yet if you continue on mono or .net 4.6.

Moving to the CoreCLR is a whole different ball game. For myself, I will move to the new mvc/project.json etc, but stay on the full framework therefore guaranteeing libraries still work but finally getting rid of the csproj BS.

Jason
January 21, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

Always love your no-nonsense assessment of things Rick. I'm just starting on a new project and have been struggling with the choice of ASP.NET 4.6 vs ASP.NET Core. Your insight helps me greatly with that decision. I'll stick with 4.6 for this one, the devil I know.

Part of me wished the project could be starting just a few months later. But when I frankly assess what "1.0 RTM" might (and might not) be, I'm left thinking that even in a few months time I'd still be wishing for just a few months more...

Rick Strahl
January 21, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

@Knagis - yup I noticed a while back that you added .NET Core support. I also saw the issue discussion on how much of a pain it was to get that set up initially :-) Great job, too and thanks for keeping it up to date. I use CommonMark in most of my apps including some non-.NET legacy apps these days.

@steve - LOL! You should know I'd never let anybody write my words for me...

@steves - While I also would have liked to see a different name altogether, I see why Microsoft chose to go this route to preserve the recognition. I think it won't take very long for it to become common knowledge that the Core stack is different than the classic stack even outside of Microsoft's dev environment. The bigger issue for me is that RTM is a solid release that doesn't have major missing pieces or badly designed APIs we'll have to live with for another 15 years. We'll see. For better or worse in two months we'll have our answers.

@Stacy - Regardless of what you use on the client side you still need a back end stack. It's not all about MVC, but also about APIs and what you can do easily and efficiently on the backend to write your business logic and API front ends. The most visible improvements are in MVC, but we ought to really look at the whole stack and see how easy it is to address business logic needs and this is where the edge cases I mentioned in the post are going to figure prominently as the stack is in its infancy.

Bill B
January 21, 2016

re: Using plUpload to upload Files with ASP.NET

When using the plUploadBaseHandler is the AllowedExtensions field required? I don't have a requirement to restrict the types of files uploaded. I'd be more apt to exclude certain file types by extension. Is there a way to do this?

Stacy Murray
January 21, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

Thanks for such a detailed look and opinion on asp.net 5.

Starting a new project in today is a difficult decision when considering asp. It seems like the riskiest option compared to say, a react stack for example.

However, the new ViewComponent feature is so amazing, it might be worth suffering thru the early days. I don't know of any "complete" solution out of the box that would make web development faster or simpler.

Steve Smith
January 21, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

Hi Rick,

I have some similar concerns, which I published yesterday:
http://ardalis.com/asp-net-core-naming-history-and-reaction

Hopefully we will be able to shed some of the legacy naming that is clinging to this completely new product.

Steve

steve
January 21, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

Did Rick write this? The verbiage seems quite different.

Knagis
January 21, 2016

re: Microsoft renames ASP.NET 5 to ASP.NET Core 1.0

You will be fine in the Markdown part :-) . However I fully support the concerns raised in this post since it took me one whole evening and half of one night to get CommonMark.NET compiling against .NET Core after some VS update... The worst part is that after I got it working I wasn't sure what exactly was the problem and what fixed it. That was before this last rename and I really don't expect it will be easier this time.

Jeny
January 21, 2016

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

Thank you, I'd been looking for something like this all through and finally landed here and is surely a life saver!!

Rick Strahl
January 20, 2016

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

@Jon - yes writing an big JavaScript app from scratch without a framework is tough. There are those that advocate 'vanilla' JavaScript but what they usually fail to mention is that they are leveraging their own frameworks they've groomed from years of hard earned experience. Even if you have that it's still a big job to build something that is comprehensive.

I've been a big fan of Angular. Personally I didn't think there's a big learning curve - I was up and running with the basics within a few minutes. For the main things you need to do - databinding, module setup, form validation etc. - there's really very little to learn IMHO. This is true of most of the top frameworks. It's when you need to dig into the lower level stuff where things get complicated. Frankly a lot of the times when it gets to that it's often much easier to revert to using jQuery or other plain vanilla tools than trying to bend the frameworks into submission.

As to the 'too heavy' comment, I don't really get that frankly. Minified and compressed Angular 1 is around 40k bytes. You need to add additional modules if you use them but for a typical app that will land at about 60k, which for what it gives you is pretty light IMHO. Especially since no framework you build yourself will have a 0 byte footprint either. It's that same silly approach were people decry jQuery from being too heavy for its 28k footprint which is nothing if you use even a handful of features in terms of value.

Size matters, but when it comes to relatively small footprints for libs that are providing so much functionality it seems silly to reinvent the wheel for the sake of saving the equivalent of a medium sized image. I would much rather forego other small helper libraries, than the big deal libraries that are providing general purpose functionality that you are bound to need throughout larger applications. 

jon
January 20, 2016

re: A WebAPI Basic Authentication Authorization Filter

I tried looking into using Identity for doing validation. It's just too complex. 5+ references, 15+ different files. On node.js I could do it with 2 references and a couple of different files. Ideally libraries simplify the process. No such luck with Identity. Glad you had this tutorial that makes it very simple!

Kevin
January 20, 2016

re: Styling all Text Elements with the CSS :not Filter

Nice tip...Thanks!

Aloha,

Kev

P.S. The Computer is running most excellent!

jon
January 19, 2016

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

It's nice to read why frameworks are desired/needed. I've been thinking how I would write an app with vanilla JavaScript as a learning experience. I've played with it a little. It's really difficult to think of good ways to write a simple app that is flexible/scalable. It makes me appreciate the frameworks out there more.

I wrote my first app with mithril.js. It's similar to react.js but smaller and feature "complete." AKA, an actual framework. I like it because it is well thought out and really easy to get up and going with it. Like you said, even novices can get going quickly with frameworks. I wrote my second app with react. That was a bear trying to figure out how to do it and what the best practices are (since there isn't any real guidance). And then trying to find a decent libraries to integrate with it. I needed it to work on the server and client side. So, I tried using React Router but ended up having to break the good practices to get it to work properly.

I saw the library intercooler.js and thought it would be nice for small apps, and it would work on the server/client side. But then thought. Why not bind to the events directly in element, it seems like a pretty elegant solution, but it appears that is an anti-pattern also, since, apparently, it isn't as flexible and you can only bind a single event to the element that way.

I haven't really looked at angular, et. al. I shied away from it since I heard it was complex/difficult to learn. I like abstractions that make it easier for me to write code, not more difficult. I think mithril.js is an excellent fit for that. intercooler.js looks like it would be really good for small apps (granted it would be nice if it didn't have the jQuery dependency). I'm sure there are a ton of different libraries/frameworks out there that are really good for simple apps. I get annoyed when everyone goes to the over engineered solutions first. They make sense for complex apps, which they are built for. But for the simple ones, it doesn't seem to make much sense, it seems to make more sense to pick something with a tiny API and foot print. Heck, even just a Razor app it better than doing a SPA when it makes sense.

Manoj Kulkarni
January 19, 2016

re: Styling all Text Elements with the CSS :not Filter

Nice article. Thank you for sharing

JD
January 18, 2016

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

Rick, it's great to stumble upon your blog again. I remember following it 5 years ago or so, when you wrote about VFP and .Net interoperability. Which makes me wonder, coming from that background did you ever consider using Servoy? It's been heavily targeted at VFP programmers and the platform brought a different for building rich web applications. I've used it to develop enterprise web applications with over 300 users and productivity, development experience, and final user experience is fantastic. Now, I'm about to embark on a new project and trying to decide what to use. I've been reading up on all the new Javascript frameworks and libraries that are coming out and, in many ways, they all seem to do what Servoy has been doing all along (which means a mature, robust environment) with the downsides that Servoy is not as quick to adopt all of the innovations coming out in the Javascript world and that in some ways you get locked into them. I'm also apprehensive of going down this framework path when it's clearly going to keep evolving and it might take a team of developers down a rabbit hole...

Thanks for taking the time to write these articles and it really is great to find your blog again.

Regards,

Tim B.
January 15, 2016

re: WCF WS-Security and WSE Nonce Authentication

@Andres: is it because of the httpsTransport attribute being there (note the httpS part)?

Denys Chamberland
January 14, 2016

re: Resetting Entity Framework Migrations to a clean Slate

Hi Rick,
I've tried pretty similar EF migration scenarios (sort of offline testing as DBAs would have probably killed me... ;) though I never was 100% sure it was the best thing to do, anyway glad to see I wasn't the only one to give it a shot... Also while enable-migration approach may well work with EF6 versions, dealing with EF7 is a slightly different ball game ;)

Tim
January 14, 2016

re: Resetting Entity Framework Migrations to a clean Slate

I follow a similar process after every production release where I delete all the migrations, empty the migration history table, re-create the first Create migration and then capture the SQL for the insert into the migration history table to repopulate it. The purpose is to reset back to a single Create migration once the individual migration steps are no longer needed. And I use a utility I wrote (gratuitous plug: http://theothertimduncan.com/archive/Entity-Framework-Migrations-Real-World/) to make this easier.

But at the risk of hijacking this discussion (for which I'll apologize up front), I have a slightly related question. In recent discussions with a senior developer at my job, he raised the question of who actually uses EF migrations in the real world. Are there any statistics regarding how many businesses use EF migrations for applications currently in production, either enterprise or otherwise?

Richard L
January 14, 2016

re: Resetting Entity Framework Migrations to a clean Slate

You can replace the Add-Migration + remove generated code step by using "Add-Migration Initial -IgnoreChanges", which will scaffold an empty migration, just adding the MigrationHistory row.

Rick Strahl
January 13, 2016

re: Resetting Entity Framework Migrations to a clean Slate

@rich - While that may be true overall for EF, in this case this isn't what I would call a lot of 'futzing around'. Migrations are not trivial on any platform if they get out of sync so this is not a problem unique to EF. You can do without migrations and update the database manually - if that's what you're doing now there's some serious futzing around you can get into with that :-)

rich
January 13, 2016

re: Resetting Entity Framework Migrations to a clean Slate

EF must offer some phenomenal benefits to be worth all this futzing around !

Rick Strahl
January 13, 2016

re: Using HTML 5 SessionState to save rendered Page Content

@codedevil - well if you capture the list you also need to capture the selected value and also store that. Typically you store the list and the selection as I do in my custom list above as well.

codeDevil
January 13, 2016

re: Using HTML 5 SessionState to save rendered Page Content

thanks let me try using it .... problem i am trying to solve :

"I have a HTML page with couple of div and 2 drop down list . values in drop down list is loaded based on selection made in list 1 (both the list are getting values from DB), such that Every time user selects a value from drop down list 2 .. value is passed as as parameter and the page is reloaded to display the values in div present on the page.

Problem is with the refresh of page select list values are also refreshed and user is again asked to select the values from the list.

As per my knowledge we can store single values in cookies .. is it possible to store a list, also apart from cookies is there any other way to store entire drop down list on client side ?

I am using php for server side scripting and java script on client side "

Rick Strahl
January 13, 2016

re: Using HTML 5 SessionState to save rendered Page Content

@codeDevil - sure. You can cache the underlying data, or cache the actual rendered HTML content of the list and then drop it back into the page the same way I do with the custom rendered list I used. It works with any HTML element as long as you have some wrapping element that you can select and capture the innerHtml from.

codeDevil
January 13, 2016

re: Using HTML 5 SessionState to save rendered Page Content

Thanks rick for the article is their any way to store HTML <select> list on client side and load at page refresh.

Erx
January 13, 2016

re: <main> HTML5 Tag not working in Internet Explorer 9/10/11

there are many tags of html5 that IE doesn't support and i have no idea why.

here is the main spec, scroll down and you'll see IE is crossed out.

http://www.w3schools.com/tags/tag_main.asp

Here are a list of tags, once clicked, you'll see at scroll down that IE doesn't support most of the HTML5 tags (tags with red 5 icon near tag name at main listing reference below):

http://www.w3schools.com/tags/default.asp

Why is this?