Showing posts with label Silverlight. Show all posts
Showing posts with label Silverlight. Show all posts

C# Developer’s Anonymous (Defending C# in a JavaScript World)

Hi, My name is Ben and I am a C# developer.  It’s been 1 minute since I wrote a line of C# code.

Am I the only one that has noticed some negativity towards C# and .NET these days?  All this buzz and talk about HTML5, CSS3 and JavaScript has C# devs on the defensive.  Lately, I feel like I need to apologize for using C#, ASP.NET, XAML and\or Visual Studio.  Everyone wants to use JavaScript for everything.  It looks like this post by Jeff is 100% accurate.  In the article, Jeff says anything that can be written in JavaScript will be.

Node.js is a huge example of this.  Don’t get me wrong Node is a great way to build a fast, scalable cross platform web interface for FREE!  I get it, it’s FREE.  However, let’s discuss the word “free” for minute.  Is it free if it takes me twice as long to develop it?  Is it free if I have to import all these open source modules, libraries and frameworks, some of which have licensing that forbid commercial use?  Is it free if my application breaks due to a bug in a new version of one of these open source projects?  To me the productivity gains I get from using IIS, ASP.NET MVC (or Web Forms), C# and Visual Studio are well worth the licensing fees required to build applications with .NET.  Not to mention all the unbelievable productivity tools provided by 3rd party vendors like Telerik.  In the long run, my users and customers don’t care about the backend technology as long as the architecture performs and can be scaled.  They also want it done as soon as possible.

Most of the C# developers I know love developing using .NET and Visual Studio (VS).  Hardcore open source proponents might say VS is cheating.  It abstracts much of the low level details and plumbing so the developer can focus on just building the application.  Is that wrong?  Maybe if you are writing a hardcore application that needs control over some low level operations.  Most apps these days don’t need that.  Plus I would argue that 3rd party JavaScript frameworks like jQuery, backbone, knockout, etc. do the same thing in the JavaScript world.  To me the abstractions that VS provides are all that is right with software development.

Ever since Microsoft killed Silverlight and provided HTML5, CSS3 and JavaScript development for Windows Store Apps, C# developers get no love.  TypeScript is a perfect example of this.  I love TypeScript and use it to write large JavaScript based applications.  But TypeScript exists for one reason, because JavaScript development is painful for C# developers that have been spoiled by the most powerful language (C#) and IDE (VS) on the planet.  TypeScript is trying to bring all the features of these tools to JavaScript.  Eventually it will get there and we will all be writing applications that “compile” to JavaScript.

Visual Studio and C# produce software that runs on many different devices.  The apps created with these technologies might not always run on every device but they can target a large range of devices.  They might require some licensing fees, hosting fees or cloud fees.  My experiences is that these fees are a reasonable cost (or even a necessary cost) for writing and deploying good quality applications.

Finally, I want to say that I do not hate JavaScript.  I find it very similar to C#.  However, I miss all the value that the .NET framework and Visual Studio provides.  If I can ensure the environment my application runs in will have .NET installed I will use it every time.

VS Live Redmond Recap. Who’s ready for VS Live Orlando?

Last week was VS Live in Redmond.  I’m just recovering enough to write a post about it.  It was a great conference.  The best thing about this conference is the interaction between presenters and attendees.  As a presenter I love the ability to talk offline with attendees at all the different events setup by the conference organizers.  I also like interacting with the rest of the presenters at the conference as well.  I really feel energized and ready to go after taking in all the information at the conference.

I presented two sessions in Redmond.  One on Internet Explorer\HTML5\CSS3 and one on using MEF to build composable applications.  Both sessions went well.  The attendees had great questions and were well engaged.  During these sessions a few code changes and demos were done.  Below are links to the updated slides and demo code:

IE9: HTML5 Developer Overview

MEF Composition

Let me know if you have any feedback regarding the content of these files.  Other than that I want to say thank you to all those that attended my sessions.

After all that happened in Redmond I am jazzed to do it all again in Orlando.  If you have not registered for the Orlando conference do it here now as early bird pricing ends next week.  As a presenter I love to attend the other sessions at the conference and gain as much knowledge as possible.  In Redmond I was always conflicted on which sessions to attend.  I’m looking forward to catching those sessions I missed in Orlando.

Hopefully the temperature in Orlando will be a bit warmer as well.  See you there.

VS Live October 17–21 in Redmond

We all know that PDC… I mean BUILD is coming up in a couple weeks in Anaheim, California.  Microsoft is keeping all the announcements (Including a real agenda) for BUILD really close to the vest.  One thing is for sure, there will be some fallout after BUILD.  Many questions, rumors and suspicions will be debated out there in cyberspace.  What better place to get the real answers than at Microsoft Headquarters in Redmond?  VS Live in Redmond includes sessions from some of the top names in the industry, including many Microsoft Product\Program Managers.  No one knows what will come out at BUILD (Or no one can talk about it until after BUILD).  In the short time between BUILD and VS Live the speakers will undoubtedly be up to speed on what is going on in the Microsoft world.  Join us at VS Live and have access to all the speakers to get your questions answered by real world software engineers.

Early bird rates are available until Sept. 7th.  Click on the image below to register for VS Live in Redmond and get a special speaker discount.

By the way I will be presenting on HTML 5 and MEF at VS Live in Redmond.  I sincerely hope to see you there.

HTML 5 vs. Silverlight

Ever since PDC 2010 there has been tons of controversy and debate swirling around HTML 5 and what it means for Silverlight.  About a week ago Scott Guthrie wrote a post that I found on the Silverlight Team Blog (here) that addresses this issue.  I recommend reading that post and the comments as well.  When all the buzz came out about HTML 5 I saw a bunch of angry posts from Silverlight developers.  Many of the comments on Scott’s post fall along the same lines.  However, it has been months since PDC and people are starting to calm down and realize that HTML 5 is just another tool in the tool box.  I compare this to the ASP.NET MVC release and how it affected Web forms developers.  At first you feel threatened.  You think that all the hard work you put into mastering Web forms or Silverlight will be irrelevant.  After awhile you realize that new technologies simply give you more options when solving problems for your clients.

My opinion is that HTML 5 and Silverlight will co-exist for a very long time.  The reason is they have different usages and solve different problems.  Especially in the mobile space.  No matter how you slice it users like the native experience of apps on their mobile devices.  I know with HTML 5 you can make websites look and feel like native mobile apps, but the experience is still just a bit off.  So Silverlight will be around as a mobile development story for some time.

I also believe Silverlight will remain for awhile because of the fact that HTML 5 is JavaScript intensive.  In my opinion JavaScript is still not as friendly to work with as managed code, even with all the new libraries like JQuery and Dojo.  Maybe someday the libraries and tooling will make developing JavaScript easier.  Again that is not going to happen for some time.

So, let’s review our UI choices for developing new .NET applications.  There is ASP.NET, ASP.MVC, Silverlight and don’t forget WPF.  I know that is simplifying things quite a bit, but in general that is what we have from a .NET perspective.  Each one of these technologies have there pros and cons.  The best advice I can give you is to design your applications with services and business layers so your UI is as thin as possible.  If you do that, it is not really that hard to create a UI layer for every one of these technologies.

ASP.NET Authentication using WCF Authentication Service returns “AuthenticationService is Disabled”

I recently deployed a solution I was working on that used ASP.NET Authentication via the WCF Authentication Service.  When I called the service it returned a fault exception that read:

AuthenticationService is Disabled

I could not figure out why.  What happened was my web.config on the server was lacking the following entry to enable the service:

<system.web.extensions>
  <scripting>
    <webServices>
      <authenticationService enabled="true"/> 
    </webServices>  
  </scripting> 
</system.web.extensions>

I hope this helps solve your problem.

Posted in Labels: , , , | 0 comments

ASP.NET Authentication using the WCF Authentication Service is Not Working

I’ve used ASP.NET Authentication on a handful of projects.  I am using it now as well and I ran into some strange issues that I wanted to pass along.  First of all this is one of the most useful post I found on using the WCF Authentication Service.  Read that post for a good step by step guide.

I had everything setup and it appeared to be working.  When I would call the Login method on the service I got back true telling me everything was working.  However, the very next line I would try to call a method on my custom service that resided on that site and I would get an unauthorized request.  I pulled my hair out on this for a long time until I found this new .NET Framework 4.0 entry in the web.config.

<machineKey validationKey="Your Key" decryptionKey="Your Decrypt Key" validation="SHA1"/>

This new entry is needed for applications that run on separate servers to talk the same language when doing authentication.  Obviously you will need generate your own keys for your sites but this fixed it for me.  This entry is needed on both the server calling the Authentication Service as well as the server hosting the service.

There could be multiple reasons authentication fails, but this is the one that bit me and took a long time to figure out.  Hopefully this will save you the trouble I had to go through to get this fixed.

Posted in Labels: , , , | 0 comments

Server Side and Client Side Caching with .NET and the Microsoft Sync Framework

I recently presented at the Denver Visual Studio User Group on this topic.  The approach I took was to start with an out of the box working Silverlight application and then tweak to using caching for performance reasons.  The next step is to persist that cache on the client side to make it even faster and not even require a round trip to the server.  After that I took it even further by saving the entire data structure to isolated storage to allow offline use of the application using the out of browser option of Silverlight.  Finally I expanded it even further by turning it into a WPF application that stored the data in a local SQL Server data base that was synced back to the server using the Microsoft Sync Framework.  To me this is a pretty natural progression of an application.  Build the prototype and then tweak it through different phases to expand it’s capability.

While building these demos I had to refactor a bunch of things through the progression of the changes.  This again to me is very natural.  I find that if I start by simply solving the problem the pieces of the system that need to be refactored and extend become crystal clear in the end.  Where as if I try to architect the application for every possible future change I tend to end up with an over architected system.  Again keep it simple and refactor later.

I think we all know caching is an essential part of almost every web based application.  That was the gist of the first part of the presentation.  The last part showed some of the pros and cons of the Microsoft Sync Framework.  There is some great documentation around this framework here.  If you are new to the sync framework I suggest taking the time to read through a couple of these docs to understand how it works.  My slides also contain some of information regarding the sync framework.  My personal take on it is it is pretty easy to get started with.  The issue I have is what happens when you get errors.  Synchronizing two data sources is by nature a difficult process and errors will occur.  Using this framework is kind of like using a black box.  You sometimes want more control than you are going to get.  Bottom line if I was looking to sync multiple data sources I would start with this framework.  It is a no brainer to get started with and provides a ton a cool functionality.  However, if I started having issues I might revert back to my old ways of just building a sync tool for my own need.

I had a great time presenting and putting together this talk.  Below is a link to the slides and the completed solution if you are interested.

Demos and Slides

Building a Multi-Page Silverlight Application

I also finished taping my Silverlight session.  In this session we start from scratch with building a Silverlight navigation application.  We walk through setting up the URI mapping to provide deep linking.  We also wire up some data that the deep linking will use to look up data based on the link.  This is a great session for anyone thinking about using Silverlight to build a multiple page applications.  If you are interested in watching this session please sign up to attend the virtual conference.  The cost is minimal ($190) and the ROI will be huge.  Check out a list of all the great sessions and register at www.vconferenceonline.com.  You can get a $30 discount if you use my VIP code of BHOELTINGSPVC10.  Enjoy!

Rocky Mountain Tech Trifecta - .NET Beginner’s Track

Last Saturday was the 2nd annual Rocky Mountain Tech Trifecta.  Just like last year it was a great event.  For a list of the speakers and topics go to the site for the event here.  Julie Yack organized the event this year and it was awesome once again.  Kathleen Dollard put together a beginners track and Jeff Certain, Drew Devault and myself where lucky enough to do the presentations.  Jeff did a great job going over the best practices related to architecting an application.  His main point was that coding furiously with no design in a bad idea.  Instead use UML and other technologies to design the architecture first.  It might take a bit longer at the start, but it will save time in refactoring and backtracking later.

The topic of my talk was beginning ASP.NET.  It is almost impossible to decide on how to talk about ASP.NET in a 75 minute session.  Most of the audience was familiar with HTML and JavaScript concepts.  So, I decided to focus on how to utilize ASP.NET to help extend the concepts and languages you already know.  I talked about code behind and how it automatically wired up events and some state management.  We also talked a bit about master pages and themes.  At the end I showed a bit more advanced stuff like AJAX and the AJAX Control Toolkit to display some of the power of ASP.NET.  After my session I created a basic media player to fit in the application using Silverlight.  Drew also created a media player that worked outside the browser and was not integrated into ASP.NET.

In the end I think it was a great day.  Below are the slides and demos from my session.  The demos do not include the final version of Jeff’s code or Drew’s Media player.  They are my web application and the architecture as it was when I started.  Thanks to those that attended and let me know if you have any questions.

PowerPoint Zip

Demos

Silverlight 3 Jumpstart Book

Just wanted to let everyone know that my employers and friends Dave and Julie Yack have done it again.  They have published another book.  This one is a 200 page jumpstart to the recently released Silverlight 3.  I helped do some tech editing of the book the last couple weeks and I can say it is really good for getting started with Silverlight.  Read more about the release on Julie’s blog here.  You can also get some more details about the book at the books website http://silverlightjumpstart.com/Default.aspx or on Amazon.

Happy reading….

Silverlight 3 and IE 8 Compatibility – Silverlight Control Not Sizing

I ran into an interesting issue with IE 8 and Silverlight 3 today.  We recently switched over to Silverlight 3 to start testing for the upcoming upgrade.  The Silverlight 3 conversion went pretty smooth and it all worked in the test website we are using in the Silverlight solution.  However, once we moved it to QA the sizing of the ASP.NET Silverlight control was not correct.  It kept cutting the Silverlight stuff short.  Not sure what the deal was, but I was able to fix it by wrapping the ASP.NET Silverlight Control in a div tag.  Wraping the control with this div will get it working but I’m not sure if it is a long term fix.

<div style="position:absolute;top:0px;left:0px;right:0px;bottom:0px;">

</div>

Posted in Labels: , | 2 comments

SQL Server and .NET Virtual Conferences

I am happy to say I am presenting at the Spring ‘09 SSWUG.ORG .NET vConference on April 22, 23, 24.  I recorded my sessions earlier and I’m please with the results.  If you are not familiar with the vConference format you can get a 10 minute sample of one of my presentations here.  The cost of the conference is only $125 and since it is a virtual conference there are no additional expenses.  There really is some great content presented by outstanding presenters.  Here is the link to check out all the SSWUG vConferences going on:

https://www.vconferenceonline.com/upcoming.asp

I also wanted to point out a free event that is going on Friday, April 17th.  Here is the link to the free event:

https://www.vconferenceonline.com/shows/spring09/sql/s09event.asp

I will keep this blog updated with my content and slides once the conference begins.

Silverlight is the Future?

Just wanted to pass on this link to a post from Rocky Lhotka.  He describes why many of his new projects are starting to favor Silverlight over ASP.NET and Win Forms.  It’s a quick read and gets you thinking.  Check it out:

http://www.lhotka.net/weblog/WhySilverlightIsTheFuture.aspx

Posted in Labels: , , , , | 1 comments

.NET Events in Colorado

I know January is almost over, but to me the year is still new.  I wanted to inform everyone about all the awesome User Groups and Community events in Colorado.

One of the most exciting upcoming events is the first ever Rocky Mountain Tech Tri-Fecta on Saturday, Feb. 21.  I cannot explain how cool this event is going to be!  It’s basically an all day geek fix.  There will be sessions related to .NET development, SQL Server and Windows Server.  So, if you work with MS products or know someone who does this is the event for you.  We have tons of speakers (Scott Hanselman is coming!) from all over the country and many who work for Microsoft and have inside info you cannot get anywhere else.  If you like what you are hearing please be sure visit the www.rmtechtrifecta.com site to register for the event to reserve your spot.

Next I wanted to let people know about the South Colorado .NET User Group.  I have taken over the leadership of this group from Julie Yack.  Julie Yack, David Yack and David Milner round out the leadership team for this group.  Next Tuesday we have Kathleen Dollard coming down from Ft. Collins to talk about rethinking Object Orientation.  SHould be great!  Please check out the link above to get more details.

Here are the links to all the MS related user groups I can think of in Colorado.

Denver Visual Studio User Group

North Colorado .NET User Group

Boulder .Net User Group

Colorado Springs SQL Server User Group

Denver SQL Server User Group

Colorado Springs Windows User Group

Rocky Mountain Windows Technology User Group

Please let me know if I missed a group.

Silverlight Path Resolution

First let me explain path resolution.  I have an image I want to use as my XAML button.  Easy enough I add an Image control to my Control Template for the button and set the source to the path of that image.  Path resolution is how the compiler determines where that image is.  I could hard code it to a directory on my hard drive, but that is never good because that path could change between environments or client machines.  So, most times we use relative paths.  Combinations of  ".." and slashes help us navigate the application structure to find the files.

Path resolution in XAML can be hard to understand.  It get's even more complicated once you add Silverlight to the mix.  Then on top of that when you are using User Controls from a Silverlight User Control Library things get down right nasty!  Then add in some shared Control Templates and things get darn near impossible.  That is the scenario I'm in.  I ran across this article which helped me get it working.  Check it out.

http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/03/09/Silverlight-2-Beta-1-Path-and-File-Resolution.aspx

One important thing to note is how you must mark the properties on the images.  Depending on how you are going to access the files you have to either set the Build Action property as "Content" or "Resource".  You might also need to set the Copy To Output Directory property to "Copy Always".

Another thing to note in my case is that if the Control Template is a shared\application level template, the images must reside in the application project, not the control library.  The path used in the shared Control Template is related to the application not the control library.

The most important thing is to pick a one way and stick to that throughout the application.

Posted in Labels: , , | 1 comments

XAML Data Binding Slides and Demos

Last night I presented at the South Colorado .NET User Group.  The discussion started with XAML data binding basics and then went into some more advanced topics.  I basically covered how to bind to any back end data source I could think of including the ADO.NET Entity Framework.  I also covered some style and UI topics.  It was a fun discussion and I think my point regarding the power of data binding in XAML and WPF was made.  I have uploaded a zip file of the slides and demos.  The link is below:

http://www.htechinc.com/files/XAML%20Data%20Binding%20With%20WPF.zip

I also mentioned a cool add in for Visual Studio called XAML Power Toys developed by Karl Shifflett.  Here is the link to XAML Power Toys:

http://karlshifflett.wordpress.com/xaml-power-toys/

If you have any questions regarding either of these links please let me know.

Virtual Conference Day 3

Today was another great day at the vConference.  I attended some great sessions over the course of these three days and now I'm excited to go back and watch the ones I missed on demand.  I hope everyone had as much fun as I did with the conference!

I did finally get my hosting situation figured out.  That means I can get my slides and demos out here for people to download.  I do believe that the vConference site will have this stuff posted eventually, but in case they don't here you go:

SharePoint:

Business Data Catalog Part I

Business Data Catalog part II

KeyNote - SharePoint and SilverLight

.NET:

Beginning WPF Databinding

Advanced WPF Databinding

Design Patterns

KeyNote - Data Services

KeyNote - SilverLight and Cross Domain Calls

KeyNote - LINQ vs. ADO

Virtual Conference Day 2

Day 2 of the conference was just as good as day 1.  We had great sessions all day long.  I attended a bunch of the sessions and had some great conversations with many of the attendees.  One of the issues we ran into today was the demos where not available.  I was going to post them here, but I'm having some issues with my ISV and getting the files to the server.  I will post them ASAP.

In the mean time, enjoy the rest of the conference.

Virtual Conference Day 1

Day one of the Virtual Conference is over.  It was a good day.  We had dueling Dynamic Data Presentation going on from David Yack and Rachel Appel.  If you missed one go to the on demand section of the conference and watch the other.  After  watching both of these sessions you can become an expert on Dynamic Data.

I also attended many of the other session.  Rob Bagby did a great Rest session and Scott Golightley did an awesome WCF session.  Kathleen Dollard gave two great sessions and Tim Heuer got us started with SilverLight.  Not to mention a killer Keynote delivered by yours truly.

And all this was just the .NET Conference. 

I also delivered my two sessions on SharePoint and Line of Business applications.  These were with the SharePoint conference.  Again, if you missed it please check it out on demand.  If you have any questions please direct them to me.  I'd be happy to help.

Tomorrow I deliver my two sessions on WPF data binding.  Please  check them out.  It's also not too late register and attend.  You would also get access to all the on demand sessions from day one.  Here is the link to the registration and my discount code.

Enjoy!

PDC is awesome but... Don't forget the Virtual Conference next week.

The PDC is a great place to get the latest news related to Microsoft Technologies.  It's a good idea to keep up to date with what is going on in the world of Microsoft.  However, most of the stuff released and demoed there is bleeding edge stuff that won't be available for live deploys for months or even years.  That's where the SSWUG.org Virtual Conferences being held next week come in.  Three days of great content, most of which can be used in the applications you are building right now and can be deployed TODAY!!!  Four conferences are being held that include: SQL Server, SharePoint, .NET and BI.  Not only is it great content, but's it's only $100!!!  Or if you use my discount code you can get it for $90.  My discount code is:

SPVIPBH

Please use this code to save yourself $10 and go have a burrito at Chipotle on me.  Mmmmm Chipotle.......