Anything related to the .NET framework
05 Jun 2008

Specified method not supported

I had a great chance to write some kick ass Silverlight code last week as a proof of concept for a potential new business venture the company I work at is thinking about, and hopefully in 6 months to a year I will be able to talk about it. The final solution won’t be Silverlight based but for the POC it provided the delivery method, functionality and UI that gets the message across.

image

Part of that POC was to be able to have a local XML file (local as on the server) loaded when the application was open and parsed. So the only way to do that is to use the WebClient class and call the DownloadStringAsync method with the URI to the XML file and then parse that in an XDocument. Not rocket science at all, but when I tried it I kept getting a message “An exception of type ‘System.NotSupportedException’ occurred in System.Windows.dll but was not handled in user code Additional Information: Specified method not supported.”

No matter what I tried I could not get it to work :( Eventually I figured out that it only was occurring when debugging/running from within Visual Studio. Publishing it to an actual web server and running it as a user would worked perfectly. This is a big issue for me, since it makes ad-hoc testing and debugging very difficult. Thankfully for me it was just a POC, but this could be a big pain for serious projects.

11 Mar 2008

IE8 - The developers best friend

There are a few good reasons to use IE 8 as a developer but yesterday I found my new favorite. When using Visual Studio 2008 and running the site a new section appears in the solution explorer called Script Documents. In this little gem of a folder is the pages you are looking at, the scripts etc... all as the server provided them to the browser! Meaning if you open the .aspx page there is no ASP controls, just normal HTML. If you do inserts of JavaScript via OnInit, that is there as well. Amazing!

AttachmentSize
Image icon cool.png13.01 KB
03 Jan 2008

Essential Developer Tools - Part 4: Static Analysis Tool

Static analysis is the process of having a tool scan at your compiled and/or uncompiled code for things like bad practises, maintainabilty, performance and security issues and so on. If you have Visual Studio Team Edition or better then you have the built in tool which is based on the free FxCop. Wikipedia contains a nice list of various tools available, but the reason why FxCop/VS is so much better is the help on the issues. All the help contains samples and information on the how and why of the problem and solutions for it. This actually becomes more than a tool to ship software but a great learning aid for the developer using it.
27 Dec 2007

.NET Framework 3.5 - Part 3: Extensions

In my previous post I spoke about some of the new features in 3.5. For ASP.NET though there is more goodness coming in the form of the ASP.NET 3.5 Extensions package. This package contains some interesting bits I want to highlight.
  • ASP.NET MVC: This model view controller (MVC) framework for ASP.NET provides a structured model that enables a clear separation of concerns within web applications, and makes it easier to unit test your code and support a TDD workflow. It also helps provide more control over the URLs you publish in your applications, and more control over the HTML that is emitted from them.
  • ASP.NET Silverlight Support: With the ASP.NET 3.5 Extensions release we'll deliver support for easily integrating Silverlight within your ASP.NET applications.  Included will be new controls that make it easy to integrate Silverlight video/media and interactive content within your sites.
  • ADO.NET Data Service (codename "Astoria"): In parallel with the ASP.NET Extensions release we will also be releasing the ADO.NET Entity Framework.  This provides a modeling framework that enables developers to define a conceptual model of a database schema that closely aligns to a real world view of the information.  We will also be shipping a new set of data services (codename "Astoria") that make it easy to expose REST based API endpoints from within your ASP.NET applications.
There are a few more and Scott Guthries post will be good to cover if you are interested (all the info above is from him).

Now starting with Silverlight support thats a no brainer really. If your market is developers wanting great tools, then making them edit HTML to get your new platform is a little tougher than need be. The MVC is a nice thing if you believe the information on it (I haven't used it yet myself) but it basically is bringing a lot of the CCF/CAB ideas to the web in a elegant way. Lastly Astoria is a great technology (I almost built my own for a project but beta 1 came out and saved me from that) which gets your data from within the black box of servers on to the web in a way it can be consumed by client applications easily. Obviously performance doesn't compare to ADO.NET directly but if you don't have access to the server this is the way to share information.
17 Dec 2007

.NET Framework 3.5 - Part 2: What's new in it?

For the sake of the series I am going to just highlight a few points. For real concrete stuff see:

There is a lot of new language features in 3.5, most important to highlight for this series is LINQ. Moving along to the more shiny information there is significant work put into integration of AJAX, WPF (XBabs support in Firefox, can work with cookies now), WCF (more WS* support, general syndication support, special model for web development,  and Silverlight. WCF + WF and WCF + AJAX now play very well together (lots of support for each other now). There is also support for new cryptography stuff (nice), peer to peer development. Interesting WinForms now supports the same model as ASP.NET for authentication.
13 Dec 2007

.NET Framework 3.5 - Part 1: Where you can find it?

There is the logical place on the Microsoft site but if you installed Visual Studio 2008 you have it already (including 2.0, 3.0) all in 32 and 64 bit. Now in VS 2005 this was under the Visual Studio folder in Program Files. With VS 2008 it moved to being part of the Windows SDK, so you can now find it in (assuming you installed to default locations, else modify as needed):
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages

BTW one nice feature of using this version, is that you have all 60Mb already downloaded. So when you launch it, and it says you need to download a bunch of data - well you give it a second cause it doesn't.
13 Nov 2007

RegularExpressionValidator Designer Will Die

Working with Microsoft software is often a ride of highs and lows. Highs caused by a tiny feature which changes your life. These tiny features are the spark of genius from some lowly dev in Redmond which makes the magic happen (my favorite is the fact you can copy and paste the MSCRM license code into the installer and fills in all the blocks at once, not just the first block like other installers. Office 2007 has a similar good idea).

However there is the other side, the lows of the idiot. The people think about problems so much they forget how the rest of the world works/sees there item and thus makes it work in odd ways (MSCRM team bastardizing relationships in 3.0 to build certain things. Thankfully fixed in 4.0).

Today though I met another one of these issues, the RegularExpressionValidator in ASP.NET. You give it a RegEx to validate against and guess what it validates against that. Good, expected, normal. Here's the issue, leave the field blank or put only spaces in the field and BOOM! No validation! The workaround, and it is a workaround since this is supposedly by-design, is two validators per field (RegEx and Required!). I mean for heaven sake this is retarded. There is no reason why it should be like that, and if there is WHY OH WHY is there no property to make it work logically/illogically.

Let it be said that if I find you, Mr RegularExpressionValidator Designer Guy/Girl, you will pain for the torture you have caused me to go back through every field in my app and add another validator!

24 Aug 2007

Looking Good

Through my experiences with software development a lot of time how good (polished) a software looks is almost as important as if it works well. It seems easier to get people to grant an extension on that deadline if the software looks good. A key point for any development on Windows (and in my main area Microsoft CRM) is icons. Be them for tool bars, menus, start menus or (in MSCRM) entities and ISV.Config changes good icons are a must.

To date I've collected around 11000 and sometimes never have the right one but it's a good collection to have and build from. I do share these with my coworkers but a lot of the time they ask me where I get them from so I have decided to share some of the places I got them from.

This is all inspired by the great set of 105 icons released today Sekkyumu so the first item is hers, but these are in no real order. If I can think of anything special about the site I will put it in but some places I just found some icons there. All these sites have free icons available and most also have paid for icons. I do recommend supporting these guys by buying (or getting your customers) to buy icons from them if you use them alot.

  • Developper Icons by Sekkyumu - DeviantArt is also a great place in general to search.
  • IconKits - These guys have some great free ones and there is a points system (each month you get a point and if you recommend someone you get points) which enables access to more icons.
  • Evraldo.com
  • GlyphLab - I got exposed to these guys when they bundled their icons with Delphi 2005, which still beats the pants off of the ones that ship with Visual Studio.
  • FastIcon
  • Icon Experience
  • FamFamFam - Of all the icons I have their Silk ones (and there is over a thousand in the set) have graced more MSCRM deployments than any others.

Pages