Geeks With Blogs
Blog Moved to http://podwysocki.codebetter.com/ Blog Moved to http://podwysocki.codebetter.com/ .NET
CMAP Code Camp Wrap Up - Dependency Injection and IoC Containers
I really enjoyed speaking at this past weekend's CMAP Code Camp. I hope you all enjoyed my presentation on "Loosen Your Dependencies with Dependency Injection and Inversion of Control Containers". It was a great discussion to have with everyone and I like to learn there as much as I teach. I also enjoyed teaming up with Scott Allen on his "A Gentle Introduction to Mocking" where we talked about mocks versus stubs, test pattens and mock frameworks such as Rhino Mocks and Moq. Hopefully we'll be doing ......

Posted On Sunday, April 13, 2008 11:45 PM

Unity Community Contributions and Interception
Now that Unity has been released into the wild, there has definitely been a bit of interest swirling around it. One of my key wants for a good IoC container is basic interception capabilities. My criteria for evaluating a container usually comes down to the following: Configurability (XML, DSL, Code) Dependency Resolution, usually opinionated Lifetime Management (Per Thread, Pooled, Singleton, Transient, etc) Extensibility for Interception So, I realized that Unity was missing some of these things ......

Posted On Friday, April 11, 2008 7:35 PM

Microsoft Free Tools - Best Practice Analyzer for ASP.NET
Microsoft has released a new tool called Microsoft Best Practice Analyzer for ASP.NET. This tool scans the configuration of an ASP.NET 2.0 application. The tool can scan against three mainline scenarios (hosted environment, production environment, or development environment) and identify problematic configuration settings in the machine.config or web.config files associated with your ASP.NET application. This tool is current in alpha right now and Microsoft is counting on your feedback on how to ......

Posted On Monday, July 3, 2006 12:19 PM

Unity 1.0 Released into the Wild
As Chris Tavares mentioned in his blog, Unity 1.0 has been released a couple of days earlier than the April 7th release date mentioned by Grigori Melnik earlier. Scott Densmore also announced this as well as working on porting the inteception from ObjectBuilder2 which I talked about earlier in some of my Unity and IoC containers posts. Looking forward to that post as we've shared some emails on the subject. Would You Like To Know More? For those looking for my posts on the matter, I've covered it ......

Posted On Monday, April 7, 2008 12:40 AM

XUnit.net RC2 Released
UPDATE: More posts on the subject xUnit.net RC3 Just Released Relooking at xUnit.net RC2 UPDATE: xUnit.NET RC2 New Drop includes ASP.NET MVC support and better GUI runner. Details here. UPDATE: Added Static Methods mention and F# - Thanks to DevHawk! I've been a big fan of such testing frameworks as NUnit and MbUnit, but recently I've found myself getting pulled more towards xUnit.net at least to play around with for any of my code samples that I write for this blog and on my own time. I'm not really ......

Posted On Monday, March 31, 2008 7:31 PM

Passed 70-528!
With my hectic schedule, I was still able to squeak in an MCP exam recently.  I passed the 70-528 TS: Microsoft .NET Framework 2.0 - Web-Based Client Development exam with a 982!  Time permitting, I'll post some links that helped me quite a bit with the preparation.  I guess I haven't decided yet which exam to take next, but now I have my MCTS - Web Development...

Posted On Tuesday, August 29, 2006 4:00 PM

Updated BizTalk 2006 Documentation
Microsoft has recently upgraded a lot of BizTalk Server 2006 documentation within the past week and is now available. Included in this is the following: BizTalk Server 2006 Installation and Upgrade Guides Microsoft BizTalk Server 2006 Documentation Update (CHM) BizTalk Server Code Samples Among the 31 code demos, these I found interesting: BAM and HAT Correlation Convoys Policy Chaining SQL Adapter with Atomic Transactions in Orchestrations Overall, a great list of code samples well worth going through! ......

Posted On Monday, July 3, 2006 12:35 PM

Understanding AOP in .NET
In my previous posts I have talked a bit about Inversion of Control (IoC) containers with respect to Interception and Aspect Oriented Programming (AOP). It's not only important to understand the uses and strategies for implementing your solutions using it, but also how interception and AOP works deep down in .NET. Instead of a long, drawn out post, I think I'll just include some articles and posts that do a very good job of explaining some of the ideas behind it. Articles and Posts I think it'd be ......

Posted On Friday, March 28, 2008 7:45 PM

Looking at DSLs in .NET
As I've mentioned in recent posts such as here, here and here, I've been very interested in Domain Specific Languages (DSLs), especially with regards to F# and the DLR as well. I recently re-listened to Software Engineering Radio Episode 52 with Obie Fernandez discussing DSLs in Ruby. One of the things that attracted me to Ruby for this was the flexibility of the syntax for closures, mixins, etc. Anyhow, it's a good listen and if you're new to the subject, you should give it a go. Also, there is ......

Posted On Tuesday, March 18, 2008 7:43 PM

Resource Application Block v2.0
Steve Phillips has recently released version 2.0 of his Resource Application Block. This block provides a simple interface to use resources, which include not only strings, but also images, etc, without the need of knowing where they came from. Your application resources can be stored in many files, and now even databases and you will have access through this block. If your application is resource intensive, this may be a way to go. If you are still working with .NET 1.1, Steve also has a version ......

Posted On Thursday, June 22, 2006 3:41 PM

Introduction to Windows Communication Foundation (Workshop) – Part 1
Robert Shelton of the Microsoft Federal Government Developer and Platform Evangelism Team is working on a set of workshops which teach Service Oriented Architecture (SOA) development with Windows Communication Foundation (WCF). He is making each one a standalone and includes: * Source Code * What to do in each step and why * Before and after code with comments Stay tuned to this location here for the workshops including Part 1 and their blog ......

Posted On Thursday, June 22, 2006 2:49 PM

Videos and Interviews from MIX08
Well, I've had the urge to find all the videos I could and watch them to find out all the goodies I missed while not at MIX08. If you missed any of the main sessions, you can find out more about them here. Note that there are 88 sessions recorded here, so it's a lot of good viewing material. Best of all are Scott Hanselman's MVC Videos can be seen here. He also covers the MVC Mock Helpers which better allow for unit tests using various Mock frameworks including Rhino Mocks, TypeMock.NET and Moq. ......

Posted On Monday, March 10, 2008 7:21 PM

IoC Container, Unity and Breaking Changes Galore
Update: IoC and Unity - The Basics and Interception As Grigori Melnik noted on my blog previously as well as his own, there was a brand new drop of the Unity Application Block as of March 4th. This by far was a huge update with a lot of breaking changes. That teaches me to use a CTP of any product and blog about it actively as it compares to other Inversion of Control (IoC) containers. Glad I didn't do a lot on ASP.NET MVC just yet but I have a few good projects going on the side with that now. Where ......

Posted On Friday, March 7, 2008 2:13 AM

Live From Mix08
No, I'm not at Mix08 right now, but I'm busy paying attention to every detail. I'm missing a lot of really cool things such as: Silverlight downloads at 1.5 million a day IE 8 preview with Firebug? SQL Server Data Services Also, now you can download IE8 already from here, so the news just keeps coming... You can too by paying attention to the following places: Live streaming video from Mix from Microsoft and some short videos on: IE 8 Scott Guthrie Ray Ozzie Dean Hachamovitch CodeBetter's live stream ......

Posted On Wednesday, March 5, 2008 1:34 PM

IoC Containers, Unity and ObjectBuilder2 - The Saga Continues
Update: Fixed code changed from CTP and More in the series: IoC Container, Unity and Breaking Changes Galore I just wanted to revisit the whole Unity Application Block just once more to look at a few more things including handling parameters, instances and so on. If you hadn't seen, there was another source drop of Unity as of 2/26, so if you haven't picked it up, feel free to do so here. So, we're going to continue our look at DI and IoC containers as they pertain to different needs. I'm not going ......

Posted On Tuesday, March 4, 2008 2:15 AM

IoC and the Unity Application Block Once Again
Update: Fixed code changed from CTP and More in the series: IoC Containers, Unity and ObjectBuilder2 - The Saga Continues IoC Container, Unity and Breaking Changes Galore After the reaction of my last post of talking about IoC and the Unity Application Block, I thought I'd include a few more samples of using Unity and how they compare with other IoC containers. I realized after my first one, that I didn't give any love to StructureMap and I'm going to fix that for a brief sample as well. I realize ......

Posted On Tuesday, February 26, 2008 6:31 PM

Resharper 4.0 Nightly Builds Now Released
A recent announcement was made on the altdotnet mailing list that made me jump for joy today. Ilya Ryzhenkov and the great folks at JetBrains have published the nightly builds for Resharper 4.0. The download for this can be found here and you might want to read the release notes here. It's important to note that the LINQ syntax is still not supported yet. As with any product in nightly builds, please use with caution, but download it and play with it today ......

Posted On Friday, February 15, 2008 4:16 PM

RockNUG Meeting - ASP.NET MVC + Updates
Tonight, put on the DVR and come out to the Rockville .NET Users Group (RockNUG) for a presentation by Jeff Schoolcraft on ASP.NET MVC. The timing of course couldn't be more appropriate as ScottGu has recently posted about the ASP.NET MVC Framework Update in which he talks about a few pain points I know I've been having as well as others such as: Can be deployed in partial trust in the \bin directory Improved routing features and infrastructure Test wizard now supports and probably one of my favorite ......

Posted On Wednesday, February 13, 2008 6:54 PM

Assembly Hijacking Presentation
Rocky Heckman did a screencast about Assembly Hijacking that is well worth checking out. It is available in Flash format here: http://www.rockyh.net/Assem... He covers the following topics: * Understanding Attackers * Testing for SQL Injection * Testing for SQL Account Privileges * Probing the file system * Replacing low level libraries (such as logging) * Inference Attacks It is a very good presentation which can open eyes especially to security risks mitigations that ......

Posted On Thursday, June 1, 2006 5:43 PM

Adventures in Compilers - Building on the DLR
So, I can admit, I've been on a bit of a kick with compilers and such after my posts on DSLs, Compilers and the Irony of it All and Lang.NET and Rolling Your Own. Today is no different, but this time, I'm just intrigued by targeting the DLR instead of the CLR. Thankfully there are a few great references that people are doing right now for these little adventures. One day once I'm more finished with the deep dive into F#, I'll dig a little deeper. So, to get started, head on over to the IronPython ......

Posted On Friday, February 8, 2008 7:54 PM

Software Transactional Memory and F#
Since I have a rather long commute to and from work, I have the opportunity to get caught up on all sorts of podcasts and such. Very recently, I listened to the DotNetRocks Episode 310 with Simon Peyton Jones on Haskell and Functional Programming. It seems that Carl and Richard are definitely on a functional programming trip, and I think Scott Hanselman has joined the group as well with his shows on Hanselminutes. Since I've been learning F# and such I thought this show was well worth a listen, and ......

Posted On Thursday, February 7, 2008 7:57 PM

DSLs, Compilers and the Irony of it All
In a previous post, I posted about the Lang.NET symposium and rolling your own compiler. I cited an MSDN article that was a good starter for someone interested in writing that new language in .NET we've all been waiting for. It's not by any means to get you towards finishing IronRuby by yourself, but some of the fundamentals are covered. The reason I've stated that I'm pretty interested is that of course I'm a geek, but I'm also interested in Domain Specific Languages (DSLs) lately as you may notice ......

Posted On Wednesday, February 6, 2008 7:12 PM

Ruby.NET is dead, long live Ruby.NET
As I noted yesterday, Dr. Wayne Kelly, the leader of Ruby.NET project, attended the 2008 Lang.NET Symposium last week led a discussion of how he wrapped Ruby, a dynamic language, on top of the static CLI. Of note of course in that speech was how hard certain things are with Ruby due to the lack of a formal specification. Anyhow, fast forward to yesterday. Wayne announced in a post yesterday about the future of Ruby.NET. I encourage you to read the whole thing here. He writes: Ruby.NET started life ......

Posted On Tuesday, February 5, 2008 5:01 PM

Lang.NET and Rolling Your Own
Last week, the 2008 Lang.NET symposium was held last week. If you're not familiar with what that is, it's a discussion about languages, compilers and libraries within the .NET space. It's been one of those things I'd love to attend just to understand where Miguel de Icaza, Anders Hejlsberg, Luke Hoban, Jim Hugunin and others are going with their related languages. Lang.NET Stuff I followed Ted Neward's recaps as they were going on as to understand what all we were missing. He was good enough to provide ......

Posted On Monday, February 4, 2008 7:00 PM

C# - vNext
I've been reading lately about what people are interested in with the next version of C#. It's amazing to think how far the language has come from the early days. Many of the newer features of the language with 3.0 by far have made it a better language. So, what did we get with the latest C# 3.0? Object Initializers Automatic Properties Anonymous Types Extension Methods Lambda Expressions LINQ Collection Initializers By far, I agree with most of Jeremy Miller's sentiments regarding C# vNext, including: ......

Posted On Friday, January 11, 2008 9:20 PM

Object Mother Pattern versus Test Data Builder Pattern
When creating my unit tests, I've been a big believer in the Object Mother pattern for creating state for my immutable value objects. Basically, I need to put the objects in a valid state in the constructor. Doing such is usually a pain, however. Before the ObjectMother pattern, you had code similar to this to create an object in valid state, such as a medical claim. Remember that we need hundreds of these to capture the variations in our model for our tests. Claim claim = new Claim( new DateTime(2008, ......

Posted On Tuesday, January 8, 2008 1:11 AM

DC ALT.NET Meeting 1/15/2008
We are announcing our second meeting of DC ALT.NET on January 15th at 7PM. The meeting this month will bring ALT.NET to CMAP. Are you a developer who always keeps an eye out for a better way? Do you look outside the mainstream to adopt the best practices of any development community, including Open Source, Agile, Java, and Ruby communities? Are you always looking for more elegant, more simple, more maintainable solutions? If so, then you might be an ALT.NET practitioner! This group follows the Open ......

Posted On Wednesday, January 2, 2008 11:31 PM

xUnit.net RC1 Released
Brad Wilson and Jim Newkirk who are both from Microsoft announced earlier this week about the release of xUnit.net RC1. They split the project into the core (xunit and console), and the extensions (Resharper runner, TestDriven.NET runner, etc) What are some of the changes this time around? Supports static methods Console runs in the STA, so now you can use WatiN for tests Removed sealed behavior from Assert classes which prevent extending Documentation galore! Ok, now that it's been announced, the ......

Posted On Friday, December 21, 2007 12:13 AM

Model View Presenter (MVP) Passive View, SharePoint and Mocking
For the past couple of years, the Model View Presenter pattern has gotten a lot of attention on the .NET platform and more in particular to ASP.NET. For a thorough introduction on MVP with ASP.NET, read the article on CodeProject by Billy McCafferty. Recently, it has come to play that many now favor the Model View Controller (MVC) pattern over MVP. If you're confused about the differences between the two, check out this post which will explain it well. The basic gist is that the MVP pattern gives ......

Posted On Thursday, December 20, 2007 1:11 PM

ASP.NET Extensions and MVC Code Samples
As noted in some of my previous posts, there is a lot of excitement around the ASP.NET 3.5 extensions including MVC, Dynamic Data, Silverlight and so on. I have a few samples I'll be posting within the week using ASP.NET MVC with such things as Spring.NET, Castle Windsor, Object Builder and so on. In the mean time, I'm still working on the Spec# posts and some SharePoint Model View Presenter I hope to get out soon. Anyhow, there are some great links out there for doing cool stuff with ASP.NET MVC: ......

Posted On Tuesday, December 18, 2007 1:35 PM

MVC Contrib Progress
In a previous post, I mentioned that Jeffrey Palermo launched MVCContrib to serve as community contributions to the ASP.NET MVC ASP.NET extensions. Since that time, there has been a lot of activity on that front. Current contributions include: IoC container controller factories for containers: StructureMap, Windsor, Spring.Net and ObjectBuilder Extra View Helpers Generic Test Doubles for Unit Testing Very cool stuff and let's see more contributions on that front. Develop with passion ......

Posted On Friday, December 14, 2007 1:10 PM

DC ALT.NET First Meeting Wrapup
Last night was our first DC ALT.NET meeting held in Alexandria, VA. We had a good turnout for a first night and a lot of good topics discussed. I want to thank Scott Singleton for hosting the event. The Open Spaces format worked well for us as all brought topics to talk about and the talks very lively and passionate. A lot of good learning took place! This was the intention when I helped found this group last month... Of course with any proper ALT.NET meeting, alcohol was served in a nice friendly ......

Posted On Friday, December 14, 2007 1:03 PM

.NET 3.5, Design by contract and Spec# Part 2
Updates: Part 3: Invariants Part 4: Object Ownership/Assertions & Assumptions Part 5: Frame Conditions/Inheritance/Boogie Part 6: Implementing a non-null string collection Part7: Spec# Wrapup In a previous post, I talked about the essentials of Spec# and where it's going. After the first post, I talked with Greg Young a little bit about the possibilities and potential of Spec# and Design by Contract. Greg gave a session on Spec# at DevTeach, so it's great to talk to someone passionate about this ......

Posted On Wednesday, December 12, 2007 3:05 AM

RockNUG Meeting 12/12
The Rockville .NET User Group (ROCKNUG) will hold it's meeting on 12/12 from 6:30-9PM. This month will cover MbUnit, a favorite tool of mine, by Jay Flowers. Listed below are the details: Release 1.6 Wednesday, December 12, 2007 6:30-9:00 PM Montgomery College, Rockville Humanities Building - Room 103 MbUnit by Jay Flowers In this talk Jay will introduce you to some advanced unit testing techniques. MbUnit offers easy ways to create parameterized unit tests. He will explorer fixtures like the RowTest ......

Posted On Monday, December 10, 2007 2:33 PM

.NET 3.5, Design by contract and Spec#
Updates: Part 2: Method Contracts (Preconditions/Postconditions) Part 3: Invariants Part 4: Object Ownership/Assertions & Assumptions Part 5: Frame Conditions/Inheritance/Boogie Part 6: Implementing a non-null string collection Part7: Spec# Wrapup As I continue to dig deeper into BDD, TDD and DDD, I've been intrigued by Design by contract and Eiffel. For a quick introduction for those lazy to visit those links, Design by contract means that designers of software should define precise verifiable ......

Posted On Monday, December 10, 2007 10:53 AM

ASP.NET 3.5 Extensions (MVC and others) released!
Today, the ASP.NET 3.5 Extensions were released. You can now download them here. Now people can have the opportunity to do a tech preview on a lot of cool things coming to ASP.NET including of course MVC. Scott Guthrie and Scott Hanselman also mention this on their blogs. Scott Hanselman also has a 40 minute "How To" video worth watching as well. Here is what is included in the extensions download: ASP.NET MVC ASP.NET MVC provides model-view-controller (MVC) support to the existing ASP.NET 3.5 runtime, ......

Posted On Sunday, December 9, 2007 10:39 PM

First public preview of ASP.NET MVC tomorrow 12/7?
Update 12/7 - Looks to be delayed til next week... In two previous posts, I have followed the ASP.NET MVC pattern quite intensely as TDD with Web Projects is something I'm always interested in. Anyhow, Scott Guthrie aka (ScottGu) posted the third part in his series on ASP.NET MVC. This one covers passing ViewData from controllers to views, and more specifically cover ways you can pass data from a Controller to a View in order to render a response back to a client. This covers two scenarios of passing ......

Posted On Thursday, December 6, 2007 6:19 PM

ASP.NET MVC Roundup Part 2
In a previous post, I covered a lot of the early happenings within the ASP.NET MVC Framework. Since Scott Guthrie started blogging about ASP.NET MVC, there have been follow-on articles. Here are the latest information about ASP.NET MVC: ASP.NET MVC Framework Part 2 (URL Routing) in which Scott Guthrie drills down deep into the built-in capabilities of the URL routing within ASP.NET MVC. For those chomping at the bit to get this code, this is another great post in the series. An Architectural View ......

Posted On Tuesday, December 4, 2007 5:54 PM

Rhino Mocks and cutom BizTalk code revisited
In a previous post, I talked about abstracting the BizTalk XLANGMessage away from the code through an IOrchestrationMessage interface. After some deliberation and inspiration from Phil Haack, I decided to take another look at using Rhino Mocks to help my cause. In this case, I'd like to use Extension Methods, but I'd rather not mix and match Visual Studio 2005 with 2008 just yet. But you could imagine it would look something like this when done: public static XLANGMessage CreateBizTalkMessage(this ......

Posted On Thursday, November 29, 2007 12:46 AM

Visual Studio 2008 InstallFest - Reston, VA
Once things calm down around here I'll actually get to posting code again. Soon enough and hopefully this week. Anyhow... As Scott Hanselman noted in his blog post this morning, there is an Visual Studio 2008 InstallFest at the Microsoft office in Reston, VA on December 12th. Here is the scoop: Come join Andrew Duthie for a night of installing Visual Studio 2008 90 day trial edition at the Microsoft Reston Office and a voucher for the full version. Also, games and networking will be there, so bring ......

Posted On Wednesday, November 28, 2007 2:09 PM

Forms Server 2007 Presentation Wrapup
Sahil Malik gave a great presentation tonight at the CapArea.NET user group meeting tonight. From this discussion he covered quite a few things that involved InfoPath, Forms Server and WF for SharePoint. A lot of the interesting tidbits discussed are available on his blog. Customizing the default Document Information Panel in which he populates the document properties by using a custom InfoPath form. Writing SharePoint Workflows in Visual Studio 2005 covers the basic WF scenarios in SharePoint, but ......

Posted On Tuesday, November 27, 2007 11:59 PM

Capital Area .NET User Group Meeting 11/27
Tomorrow night (11/27/2007) is the Captial Area .NET User Group meeting for November at 7PM-9PM. The information is as follows: Location: 1900 Gallows Road Vienna, VA 22182 Topic Building Forms-Based Applications with InfoPath Presenter: Sahil Malik Looks to be an interesting topic and hope to see a good turnout ......

Posted On Monday, November 26, 2007 11:27 PM

ASP.NET MVC Roundup
Last month, Scott Guthrie announced the ASP.NET MVC framework which allows for built-in support for the Model View Controller based architecture. Since that time there has been a flurry of activity from Microsoft to demo the technology to the world and make demos readily available. In case you missed it, here are some of the features: Clean separation of concerns. All core contracts of the MVC framework are testable and mockable Highly pluggable to use NHibernate, Spring.NET, Windsor, and other great ......

Posted On Monday, November 26, 2007 11:18 PM

Windows Communication Foundation Workshop – Part 4 Schemas and Contracts
Robert Shelton of the Microsoft Developer and Platform Evangelist Team has released his fourth workshop involving Windows Communication Foundation (WCF) which covers handling data between the client and server. Moreover, this covers sharing schemas (contracts) between the two instead using classes. Robert will show how easy it is to do this with WCF. As always, each workshop can be built and ran independently of other workshops. The workshops can be found here. Once again, keep up the good work Robert ......

Posted On Friday, June 30, 2006 9:33 AM

5 Days With Windows Presentation Foundation (WPF)
With all the information out there floating about, it's difficult to know where to begin when learning Windows Presentation Foundation (WPF). Karsten Januszewski has made things easy with a 5 Day Lesson entitled "My Five Day Course For Hitting the WPF Curve/Cliff ". This five day lesson includes a detailed agenda for each day and has many presentations and links to tutorials. This is a must for anyone who is looking into getting started with WPF. Also, be sure to see the rest of the posts on this ......

Posted On Monday, June 19, 2006 8:05 PM

SharePoint Tips and Tricks - Traverse and Fix All My Sites Document Library
Recently, for a very large customer, I had to fix some issues with regards to SharePoint My Site lists. Destroying and recreating each person's My Site was not an option. This scenario actually happened due to the fact that should you get the dreaded SPException which indicates a "Save Conflict" while updating a SPList object, it will wipe out some of your properties. I will show an example in code in a Console Application. So, let's start with the Main method: [STAThread] static void Main(string[] ......

Posted On Monday, June 19, 2006 7:52 PM

Why isn't ALT.NET Mainstream.NET?
Very recently, within the past 5 months, I've been following the ALT.NET movement and part of me wonders why this isn't Mainstream.NET. To me it only makes sense to pick the best tool for the job no matter who made it, adopt the best practices from the software industry no matter the language, and always look for a better way to develop software in an Agile/XP fashion For those unfamiliar, David Laribee coined the term and came up with the four basic points of who is ALT.NET: You’re the type of developer ......

Posted On Tuesday, November 20, 2007 9:00 PM

TDD and BizTalk Orchestration Expression Code
Lately a lot of my work has focused on BizTalk for some custom solutions. I'm a big fan of BizUnit as a unit testing tool for BizTalk, as it is pretty much the only option. But, what happens when you call custom components (dlls) through Expression or Message Assignment Shapes? Take for example this custom code snippet public class OrchestrationHelper { public static void ProcessDocument(XLANGMessage bizTalkMessage) { Stream bizTalkStream = (Stream)bizTalkMessage[0].R... // ......

Posted On Tuesday, November 20, 2007 10:18 AM

Visual Studio 2008 Released
Today Visual Studio 2008 went RTM and made available on MSDN Subscriber Downloads. Most of the morning, MSDN had problems keeping up with demand and was down until around 10AM EST. I finally got mine installed around 10:30 or so this morning and so far so good. It was just frustrating while I was getting ASP.NET server errors exposed to me while I am trying. Scott Guthrie has a pretty good post on the release ......

Posted On Monday, November 19, 2007 9:52 AM

C# Null-Coalescing Operator
When I was studying for the 70-536 exam and now studying for the 70-528 exam, I've done quite a bit of studying of the new language features. One of them that caught my eye was the null-coalescing operator. If you look at section 19.5 of the C# 2.0 Specification document, it covers this in detail with several scenarios. When I first saw this feature, I was a little bit skeptical. I like functions to make my life easier, but they should be easy to understand and not obfuscate what the ultimate result ......

Posted On Wednesday, July 5, 2006 8:15 PM

Another look at the GZipStream and System.IO.Compression Streams
Previously, I posted a quick and dirty sample of using the GZipStream. I found a few other posts which have gone into this stream in just a little bit more detail. Over at the .NET Interop blog, Dino gives a quick introduction to the GZipStream and DeflateStream. What's of more interest is that linked to the post is a library to create zip files using the DeflateStream. This includes an attachment as located here from PKWare which allows the user to create zip files using the aforementioned stream. ......

Posted On Wednesday, July 5, 2006 2:12 PM

.NET Recursive Functions - Recurse through Files and Directories
One of the things driven home during most computer science courses, at least in my era, was all about linked lists, pointers, hexidecimal calculations, bubble sorts, and last but not least, recursive functions. If you need a slight introduction to recursion, Wikipedia is a good place to start here. Anyways, I thought I'd bring that same concept when iterating through and creating a list of all files in a directory and all subdirectories. It's a fairly simple concept in which you iterate through each ......

Posted On Monday, July 3, 2006 2:31 PM

.NET - Overriding Equals and Equality Operators
I've been a little absent recently due to a lot of training I have been attending. Too much to learn in such a short period. Anyways, let's get back to coding samples and best practices. Even though I like to be at the software architect level, I still love keeping my hands dirty with code and giving samples here and there. Today I will be covering overloading equality operators and the Equals method. When you are creating your entity objects or business objects, you should override and overload ......

Posted On Friday, June 30, 2006 1:46 PM

.NET 3.0 June CTP Released - What's changed?
Microsoft has released the .NET 3.0 June CTP. Please note that this CTP does not have a "Go-Live" license available with this release. Here are the links for the software required for this CTP plus some extras: * .NET 3.0 Runtime Components June CTP * Windows SDK June CTP * VS.NET 2005 Extensions June CTP * Workflow Foundation RC and Extensions June CTP So, what has changed in this CTP? The Windows Communication Foundation (WCF) team has blogged about the changes: * Some Changes for Channels and ......

Posted On Friday, June 30, 2006 8:38 AM

Windows Communication Foundation Workshop – Part 3 Transactions
Robert Shelton from the Microsoft Federal Development and Platform Evangelist Team has released the third installment of his Windows Communication Foundation (WCF) Workshops. The third installment deals with distributed transactions. In this exercise, the customer (Bank) has decided that they are going to offer a new service to their ATM users, and the new feature requires Transactions. The source code does not rely upon earlier code, so you can start at any lesson. As always, the workshop code can ......

Posted On Friday, June 30, 2006 8:04 AM

Windows Communication Foundation (Workshop) – Part 2
Robert Shelton has posted part two of his Windows Communication Foundation (WCF) Workshop. The workshop is located here in case you missed it yesterday. This session covers holding Session State in your WCF application. As stated before, each lab can stand on its on and you can forego part 1 if you wish. Part 3 will cover implementing transactions within a WCF application. Great job Robert ......

Posted On Friday, June 23, 2006 2:18 PM

15 Working with Data in ASP.NET 2.0 Tutorials
Scott Guthrie has posted a good link with 15 ASP.NET Data Tutorials that were created by Scott Mitchell. These tutorials found here, cover the following: Introduction Articles Creating a Data Access Layer using Typed DataSets Creating a Business Logic Layer Using Master Pages and Site Navigation for Consistent Look and Feel of the Data Samples Basic ASP.NET Data Reporting Displaying Data with the ObjectDataSource Using ObjectDataSource Declarative Parmeters Programmatically Setting ObjectDataSource ......

Posted On Friday, June 23, 2006 2:10 PM

What Would You Like in the Enterprise Library for .NET Framework 3.0?
Tom Hollander from Microsoft Patterns & Practices group is asking for suggestions for what is to be in the Enterprise Library 3.0 release. Since Microsoft has announced .NET 3.0, the Patterns & Practices group would like to get a head start on the next release of the Enterprise Library. To give guidelines, they are looking for suggestions in the following areas: New blocks (please specify what these blocks should do) New providers for existing blocks (please specify which blocks and what ......

Posted On Wednesday, June 21, 2006 1:43 PM

Webcast - Model-Driven Development in Visual Studio 2005
Microsoft has introduced very powerful tools for architects with Visual Studio 2005 Team Edition for Software Architects. Among these is the ability to define, generate and customize your own set of visual modeling tools that are built upon the same infrastructure as those provided with Visual Studio. There is an MSDN Webcast available entitled Domain-Specific Language Tools for Model-Driven Development in Visual Studio 2005 which goes over this in detail. This webcast covers the following: * Visual ......

Posted On Wednesday, June 21, 2006 1:27 PM

Compression and GZipStream
When I was studying for the 70-536 exam, I concentrated heavily on streams as it was a good portion of the exam. One stream that stuck in my mind the most was the GZipStream which encompasses the industry standard for lossless file compression and decompression in the GZip format. As I always did during the reading process was to whip up little examples of using each technology. I decided to create a little example of how to use the GZipStream in a few lines of code while compressing a known document. ......

Posted On Wednesday, June 21, 2006 1:06 PM

Tips on Writing Reusable Code
As I wandered the net this morning for my usual tech tips and such, I always found that I can be a sucker for lists. I came across this blog post 10 tips on writing reusable code in which Hosky elaborates upon what he feels should be concentrated upon. The basic list boils down to this: 1. Don't repeat code 2. Make code do one thing 3. Break down logic by test case 4. Remove business logic from frameworks 5. Hide code dependencies with abstract classes and interfaces 6. Code for extensibility with ......

Posted On Wednesday, June 21, 2006 12:16 PM

C++ - Dipose with Null Pointers
Nishant Sivakumar recently wrote in his blog about NULL pointers and C++/CLI in his post "You *can* delete a NULL pointer!". What I did know is that delete works fine on unmanaged code, but I wasn't 100% sure about managed, and now this confirms that it works exactly as I thought it would. Take for example this code: public ref class MyClass { public: MyClass(); ~MyClass(); }; And this calling code: MyClass myClass = nullptr; delete myClass; In this above case, the destructor would not be called ......

Posted On Tuesday, June 20, 2006 2:36 PM

MSDN Architecture Webcast: Exposing Your Content as a Service Using Windows Communication Foundation
Tomorrow at 11AM EST, 8AM PST, there is an MSDN Webcast entitled Exposing Your Content as a Service Using Windows Communication Foundation to discuss migration of existing services such as RSS, mashups and scrapes to Windows Communication Foundation (WCF). This webcast targets the enterprise architect as it discusses how WCF can be leveraged to expose more of your site as a service in multiple formats and transports. Clemens Vasters will walk through several examples on how WCF can help you. ......

Posted On Tuesday, June 20, 2006 1:59 PM

SecurePasswordTextBox and SecureString
A while back, I covered in detail some of the things you could do with SecureString in my post .NET Code Access Security - SecureString. Dan Sellers of Microsoft had a post about his webcase entitled Least Privilege and New System.Security Features in which the SecureString was used. The webcast in question can be found here. The source code is available for the SecureString demo can be found here. In this webcast, the SecureString is used to read in the password, character by character from the ......

Posted On Tuesday, June 20, 2006 1:47 PM

C++ - Where is STL/CLR???
When Visual Studio 2005 was still in Beta, Visual C++ had a concept of STL .NET (now called STL/CLR), which in short is a porting of the STL to the CLR. One may ask, so why STL/CLR? As you may or may not have noticed, C++ will not accept managed types inside of an STL container. Nikola Dudar explains more about the differences in his post "What is STL/CLR". Stan Lippman had a great introduction of this great library in an article on MSDN called STL .NET Primer. Nick Weinholt also had a good introduction ......

Posted On Monday, June 19, 2006 9:36 PM

Day 10 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
Update: Put a comment in if you want the C# version of this code and I will get it to you In the previous installment, I actually gave the source code which is available if you go to the Day 9 post. Anyhow, what we're going to cover today is setting up your IIS to allow for BITS upload functionality. Several things must be done in order for uploads to be supported on your machine. First, we need to install the BITS Extensions for IIS. In order to do so, you must do the following: Go to Add/Remove ......

Posted On Sunday, June 18, 2006 8:05 PM

Know Your Enterprise Design Patterns
Enterprise Design Patterns are a way of life now as software architects. The "Gang of Four" laid the groundwork for proposing and enumerating these design patterns in their book "Design Patterns: Elements of Reusable Object-Oriented Software". Make sure you have this book. Sometimes it's good to keep it underneath your pillow, or something like that... Microsoft Press has of course also released a book entitled "Enterprise Solution Patterns Using Microsoft .Net: Version 2.0 : Patterns & Practices" ......

Posted On Friday, June 16, 2006 4:58 PM

Passed Exam 70-536 - Application Development Foundation
A few days ago, I posted some links for study guides and links for the 70-536 exam. Well, it worked nicely for me as I passed with a 982! I know I missed one question on COM Interop because the way they were talking about returning an HRESULT to a COM caller is not the way I would do it. I chose the C# version since I've done most of my work in C# so far with Visual Studio 2005, although I could have done the C++ version just as easily. I already have the MCSD and the MCDBA, but I thought I'd try ......

Posted On Friday, June 16, 2006 11:15 AM

Simplifying XMLHTTP programming with ASP.NET “Atlas”
Marc Schweigert, from the Microsoft Federal Government Developer and Platform Evangelism Team Blog, has posted a screencast on MSDN Channel 9, in two parts addressing XMLHTTP programming, which has been around for a while, and working with ASP.NET Atlas. What these screencasts accomplish is allowing the browser to make web service calls from client-side script. Very cool and well worth checking out! The screencasts are available in two parts at the following location: * Simplifying XMLHTTP programming ......

Posted On Thursday, June 15, 2006 1:14 PM

.NET Security Best Practices - ASP.NET 2.0 Security Practices
Microsoft has published a set of security best practices in an article entitled "Security Practices: ASP.NET 2.0 Security Practices at a Glance". Let's go over briefly what this guide can do for you as you design your applications. First of all, it covers a wide array of topics from what is new in ASP.NET 2.0 and the .NET 2.0 framework when it comes to security. Each of the following sections includes at least a couple "How to" articles on the most basic topics. I'll cover each topic in bullet points, ......

Posted On Wednesday, June 14, 2006 3:58 PM

.NET Security - Argument Validation Revisited
In a previous post, I shared my ArgumentValidator class as well as an overview of Regular Expressions. I want to revisit this topic because of the fact that I hadn't really optimized it for ASP.NET 2.0. There are some features now offered in .NET 2.0 that help the process of keeping your messages standard. Also, I'd like to re-address some of the regular expression things as well. Let's go ahead and create a new ASP.NET 2.0 Web Site. From here, we have the basic Default.aspx/cs. From this page we ......

Posted On Wednesday, June 14, 2006 2:45 PM

MSDN Channel 9 Security Code Examples
It seems security is becoming more and more of a focus at Microsoft. This of course is a very good thing and interests me a lot since I focus on security issues as one of my top priorities. The MSDN Channel9 Security Wiki has introduced a set of .NET code examples to do common security tasks. These tasks are separated into different categories according to what function they perform. The categories for the code samples are: * Authentication * Cookies * Cryptography * Data Access * I/O * Input Validation ......

Posted On Tuesday, June 13, 2006 1:58 PM

Microsoft .NET 3.0 Community Home Site
Now that Microsoft has renamed WinFX to the .NET 3.0 Framework, the new site containing all of these has been launched at the Microsoft .NET Framework 3.0 Community (NetFx3). This site combines all previous sites as well as some new ones. The linked sites are: * Windows Communication Foundation (WCF) * Windows Presentation Foundation (WPF) * Windows Workflow Foundation (WF) * Windows CardSpace (WCS) This site also combines the latest news, blog posts and forum discussions from each subsite as well ......

Posted On Tuesday, June 13, 2006 11:58 AM

Resources for the 70-536 Certification Exam: Microsoft .NET Framework 2.0 - Application Development Foundation
As I am studying for the 70-536 exam, I came across this really helpful link that has a lot of reference material linked from the MSDN that contains general topics that will be covered in the exam which can be found here. Mike G. did a really great job! I'm definitely using this to my advantage in terms of study material. This is not a brain dump, but instead a good study guide that provides links to classes that will be covered as well as several "How-Tos" that will be essential to pass this exam. ......

Posted On Tuesday, June 13, 2006 6:19 AM

.NET Best Practices - Constrain User Input
In previous posts, I talked about one of the major pillars of security is to never trust user input. We need to verify at every level the data that is in our system. One way of doing this is to implement a validation class that does the heavy lifting for you. I have written a common class that follows the pattern introduced in the Common library from the Enterprises Library to do just this task. This class validates the parameters and throws the appropriate exception type based upon the values given. ......

Posted On Friday, June 2, 2006 2:53 PM

Day 8 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
Update: Put a comment in if you want the C# version of this code and I will get it to you Well, I finally managed to get a spot for the Managed BITS Wrapper on SourceForge.net. I have not uploaded any files just yet, as I am cleaning up one or two things as well as trying to add some test cases to it. I will let people know when I actually have a release out there available. The first available release will be in Managed C++ and then the second release will be in C++/CLI. I left off last time looking ......

Posted On Friday, June 2, 2006 11:44 AM

Test Driven Development - Using CruiseControl .NET to Automate Your Builds
Jean-Paul Boodhoo has posted so far in 8 parts on how to automate builds using NAnt. The post entitled Automating Your Builds With NAnt - Part 8 (Enter CruiseControl) is highly informative about how to introduce CruiseControl .NET into your build procedures. In previous projects I have worked with CruiseControl and found it to be very helpful. Cruise Control .NET can be used to do the following from my own previous experience: * Get latest code from source control (VSS) * Perform a build which registered ......

Posted On Monday, June 12, 2006 12:37 PM

Microsoft Identity Integration Server 2003 Extensions
At the June Capital Area Microsoft Integration and Connected Systems User Group (MICSUG) meeting on the 22nd, I will be presenting on how to use Extensions to perform custom tasks such as migrating users from one SharePoint Web Site to another, transforming identity information, etc. I found a useful link on MSDN which contains some of the code samples that come with the MIIS installation. Under the Using Microsoft Identity Integration Server 2003 page, listed are the following of note at least to ......

Posted On Monday, June 12, 2006 11:28 AM

MICSUG Meeting - June 22nd
Geoff Snowman has announced that Joe Francis, a longtime Microsoft employee and expert on the Windows platform, has agreed to speak at the MICSUG meeting on June 22. Joe, a principal product specialist with Microsoft Corporation, specializes in identity management and Windows infrastructure. One of the most challenging issues in integration is cross-platform management of identity, and Joe will describe Microsoft's approaches for addressing this issue, including Microsoft Identity Integration Server ......

Posted On Sunday, June 11, 2006 6:52 PM

MSDN Wiki - Visual Studio Documentation, Wiki Style
Have you ever been frustrated with the documentation on MSDN sometimes? Many times I have tried to do some of the more interesting .NET Framework classes such as SecureString and not finding much documentation on it. Microsoft has just introduced the MSDN Wiki Beta which allows a collaborative effort to document the framework with code samples, tips and tricks from developers. This is the really cool part to be able to contribute samples of things that I have used in the past that really isn't documented ......

Posted On Saturday, June 10, 2006 1:59 PM

WinFX renamed to .NET 3.0?
There seems to be a bit of confusion out there as to what WinFX is and how it compares to .NET. Well, according to Somasegar's WebLog, Microsoft has decided to rename WinFX to the .NET Framework 3.0. The logic behind it being that WinFX really was the next generation of the developer framework. The .NET 3.0 framework will still include all functionality from WinFX and just have a name change. It still includes Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows ......

Posted On Saturday, June 10, 2006 11:36 AM

Best Practices - Static or Instance?
Two days ago I posted about the Static Members Best Practices, I now realize I might need to step back just a little bit and get into the debate of why to have static members in the first place. It's an interesting debate worth having especially when it comes to your designs. Why Use Static Members? When I have conducted code reviews in the past, I found many times that people would use static methods and properties all over the place. The only real justification that was used was that it cut down ......

Posted On Friday, June 9, 2006 11:58 AM

Day 9 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
Update: Put a comment in if you want the C# version of this code and I will get it to you Well, I was having troubles connecting to CVS on my Managed BITS Sourceforge Project over my VPC, so while I figure it out, I decided to upload the source code plus binaries to SaveFile for the time being. Let me know if you have any questions or problems regarding this. Now that I got that out of the way, let's get back to where we left off. In the previous lesson, we talked about implementing the IBackgroundCopyCallback ......

Posted On Thursday, June 8, 2006 3:34 PM

The Federal Government Moving from Java to .NET?
I found a little light reading entitled "Java Succumbing to .NET in my Organization" by Neil Chaudhuri in which a local Federal Government contractor is moving towards .NET. If you really want to hear arguments on both sides of the aisle, this is it! Talk about light reading... As for me, I prefer .NET technologies which is why I'm starting with Microsoft in about a week. I make no qualms about being an advocate for Microsoft products including .NET, BizTalk, SharePoint, etc. I've done both and I ......

Posted On Wednesday, June 7, 2006 9:04 PM

Static Members and Threading Best Practices
After reviewing some code examples out there, I decided it was time to look into static members and threading best practices. I see a lot of the same mistakes being made over and over. We can think of many times when we create static methods and properties that sometimes we forget that problems can arise. Let's look at a code example: private static int currentNumber = 0; public static int NextNumber{ get { int newNumber = currentNumber; newNumber += 1; // Do more stuff here currentNumber = newNumber; ......

Posted On Wednesday, June 7, 2006 1:23 PM

Reminder - June 10th Reston Code Camp
Just as a reminder that the Reston Code Camp is on June 10th. The Code Camp Schedule has been posted which looks to be a full day of good stuff. I, unfortunately, cannot attend the whole day as I have a concert to go to that night, but I'll try to catch what I can. If you missed signing up, you missed out! They have a wait list, and they will try to do their best to get you in... Hope to see a good crowd there ......

Posted On Tuesday, June 6, 2006 5:46 PM

Script# - Microsoft's Answer to Google Web Toolkit?
A month or so ago, Google released the Google Web Toolkit (GWT) which enabled people to build AJAX-enabled applications in Java. This GWT compiler created browser-compliant Javascript and HTML based upon the Java code which allowed for much easier creation of AJAX applications. Nikhil Kothari from Microsoft, has introduced Script#, which is a compiler which takes C# code and compiles to Javascript instead of IL which the .NET compilers do. The goal is to make the code to have Intellisense, compile-time ......

Posted On Tuesday, June 6, 2006 3:33 PM

Convert any unmanaged string with Managed C++
UPDATE 6/7/2006 Nishant Sivakumar had a project on Code Project entitled StringConvertor which allows the implementer to convert System::String objects to unmanaged char pointers, STL strings, etc in C++/CLI. This is a very handy class to have when dealing with unmanaged code and translating back and forth. I came across the need for some of these things when working with ISAPI technologies where I wanted to easily go between managed and unmanaged strings. I was only using Visual Studio 2003, and ......

Posted On Tuesday, June 6, 2006 12:43 PM

ASP.NET - Project Atlas Toolkit
Microsoft has launched a community development website called CodePlex (Beta) on May 1tth. James Newkirk announced the launch on his May 16th post. This site currently has 23 active projects with a couple that are tests that will go away shortly. The most popular projects are here: * Ajax.NET Professional Starter Kit* Project SharePoint Forums Web Part* Project MSBuild Extras - Toolkit for .NET 1.1 "MSBee"* Project "Atlas" Control Toolkit The one that interests me most at the moment would be the ......

Posted On Tuesday, June 6, 2006 7:36 AM

.NET Code Access Security - Assembly Design Considerations
In previous posts, I talked about designing your classes with security in mind. Designing assemblies is no different when it comes to keeping security in mind at all times. Today I will cover what things to keep in mind when designing secure assemblies. The basic points we will be covering today with regards to assembly security is: * Who is the target for the assembly * Identify Potentially Sensitive Code * Identify the Resources Needed * Explore Trust Levels * Abstract or Sandbox Highly Privileged ......

Posted On Monday, June 5, 2006 2:34 PM

The Most Powerful Language for .NET Programming
Kenny Kerr wrote an article for the MSDN entitled C++: The Most Powerful Language for .NET Framework Programming which is definitely an interesting read. The point of the article is to compare and contrast C++/CLI and its functionality to that of C#. This article focuses on the changes in C++ from the C++ with Managed extensions which came with Visual Studio 2003 that make C++/CLI a much more viable alternative than in the past. When going between Managed C++ and C#, your code could look drastically ......

Posted On Monday, June 5, 2006 10:38 AM

Automating SharePoint Deployment Through Post-Build Events
When working on enterprise level applications and even smaller ones, I tend to automate everything for my builds as much as possible. My recent experience with an enterprise SharePoint rollout is no different. I'll walk through a basic scenario where I can deploy my web part library to my local instance through build events. The prerequisite of this of course is that you have the templates installed. If you do not, they can be found here: http://www.microsoft.com/do... ......

Posted On Thursday, June 1, 2006 4:25 PM

C++/CLI Best Practices
Kenny Kerr has recently had an article published by the MSDN for best practices for C++/CLI. The link can be found here: http://msdn.microsoft.com/l... Overall it is a very thorough article on what you should and should not do when using C++/CLI. I found one interesting piece in here about the best practices dealing with the auto_handle versus using the delete keyword on a managed object. The auto_handle from what the link describes, is ......

Posted On Wednesday, May 31, 2006 2:32 PM

More Things Great .NET Developers Should Know
A few weeks ago, I linked to a list of What Great .NET Developers Should Know. I then came up with the idea of adding more of my own through my own experiences. I found this list to be helpful and not just random trivia and picking points out of the .NET class libraries. If anyone has more to add or to nitpick my list, please let me know... Updated 6/15/2006 See Questions BizTalk Developers Should Know as well for more questions Common Language Runtime Questions: Describe the inheritance differences ......

Posted On Wednesday, May 31, 2006 1:10 PM

Microsoft Developer Dinner Presentation - Atlas Wrapup
Last night, Robert Shelton and Marc Schweigert from Microsoft gave a very good presentation on the Atlas Framework. This event covered how Atlas can be extended not only to do server-side controls, but client-side Javascript as well. The client-side libraries can even be used in other scripting languages such as PHP which makes this even more interesting. The slide deck from last night's event is available here: http://www.federaldeveloper... ......

Posted On Wednesday, May 31, 2006 8:33 AM

Reminder: Microsoft Developer Dinner - Overview of AJAX programming with Microsoft Atlas
Tonight, join the Microsoft Federal Developer Evangelist Team for an overview of AJAX (Asynchronous JavaScript and XML) and what it means. Microsoft is pushing heavily the ATLAS framework as a Microsoft version of AJAX. Come to the dinner and find out more. Here are the details: Overview of AJAX programming with Microsoft Atlas Tuesday, May 30, 2006 6:00 PM - Tuesday, May 30, 2006 8:00 PM Pacific Time (US & Canada) Welcome Time: Tuesday, May 30, 2006 5:30 PM Language: English-American Microsoft ......

Posted On Tuesday, May 30, 2006 11:51 AM

.NET Security - Understanding and Detecting Cooke Tampering
In previous posts, I talked about other security issues such as Cross Site Scripting (XSS), SQL Injection and other validation controls available to you for writing secure applications. Today is no different as we are talking about understanding and detetcing cookie tampering. What Is Cookie Tampering? Cookies can be manipulated quite easily as they are plain text files on your local machine. For example, say you have an application that stores your favorite color in a cookie. Once that data has ......

Posted On Tuesday, May 30, 2006 11:47 AM

Visual Studio Tools for Office 2005 Starter Kit: Requirements Authoring Starter Kit
Earlier this month, Microsoft released the Requirements Authoring Starter Kit (RASK) for Visual Studio 2005. It is available here: http://www.microsoft.com/do... RASK provides a customizable requirements-authoring solution for software development teams. It provides the basis for a Requirements Authoring solution and shows how to access Microsoft Visual Studio 2005 Team Foundation Server programmatically from Microsoft ......

Posted On Friday, May 26, 2006 12:30 PM

Day 7 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
Update: Put a comment in if you want the C# version of this code and I will get it to you In previous days, I discussed the methods and properties to be implemented with the BITS wrapper BackgroundCopyJob. Let's go over some of them today. Let's start off with the IDisposable pattern which must be implemented when using these unmanaged objects. Here is the simple implementation required: // BackgroundCopyJob finalizer Podwysocki::Services::Backg... ......

Posted On Friday, May 26, 2006 12:01 PM

.NET Code Access Security - Understanding and Preventing SQL Injection
In previous days I have talked about other ways to make your application secure. All of these lessons come down to a basic set of points: 1. Never trust user input 2. Use least privileged accounts What SQL Injection Is Today we will cover SQL injection, what it means and how to protect against this attack. SQL injection is a security vulnerability in an application that calls the database with SQL with unescaped characters which can lead to malicious data manipulation. This can be even more dangerous ......

Posted On Thursday, May 25, 2006 2:46 PM

Day 6 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
UPDATE: See Day 9 of the Background Intelligent Transfer Service (BITS) Managed Wrapper for the source code plus binaries. In previous lessons, I covered the BackgroundCopyManager and how I wrapped the IBackgroundCopyManager in Managed C++. Today, I'll go a step further to look at the BackgroundCopyJob wrapped class. The BackgroundCopyJob wraps the following interfaces: * IBackgroundCopyJob * IBackgroundCopyJob2 * IBackgroundCopyJob3 As we are dealing with unmanaged types, we must also take into ......

Posted On Wednesday, May 24, 2006 6:47 PM

Free tools - Simian and Code Refactoring
Code refactoring is a very important concept to learn when dealing with Object Oriented design patterns. Luckily, Visual Studio 2005 gives us the ability to refactor code quite easily with just a simple highlight and right-click. More information about code refactoring can be found here: http://msdn.microsoft.com/l... Anyhow, we need an easy way to find duplicate code worth refactoring. RedHill Consulting created the Simian tool to detect ......

Posted On Monday, May 22, 2006 12:54 PM

.NET Code Access Security - Regular Expression Input Validation
In a previous lesson, I talked about preventing Cross-Site Scripting (XSS) as part of a security strategy. Today, I will cover another topic in the security strategy and implementation. I also want to talk about basic validations and where they should be done. As a secure programmer and architect, you should realize that data validation needs to be done at every layer. The .NET framework provides us with many tools for us to accomplish that goal. We do not want to assume since the user interface ......

Posted On Wednesday, May 24, 2006 1:14 PM

.NET Code Access Security - SecureString
With many secure applications, we must be cognizant of the memory usage and the secure storage of our data. In the C++ world, there have been functions specifically defined to secure memory, such as SecureZeroMemory iin Winbase.h. For example, we can use the SecureZeroMemory function to place zeros over the memory for a user name and password once we are finished with them. Here is an example of how to do this: http://msdn.microsoft.com/l... ......

Posted On Tuesday, May 23, 2006 3:22 PM

Capital Area .NET User Group Meeting
Just as a reminder, tonight there is a Capital Area .NET User Group meeting at 7PM. Details are located here: Tuesday, May 23, 2006 (EST) - Developing Integration Solutions using BizTalk Serspeaker: Geoff Snowman and Lamont Harringtonlocation: AT&T Building, 1900 Gallows Road, Tysons CornerCome learn how to employ BizTalk to tie applications together. Lamont Harrington is a Technology Architect with Microsoft Corporation and works out of the Reston, VA -based Microsoft Technology Center. He focuses ......

Posted On Tuesday, May 23, 2006 1:04 PM

Microsoft Developer Dinner - Overview of AJAX programming with Microsoft Atlas
On May 30th, join the Microsoft Federal Developer Evangelist Team for an overview of AJAX (Asynchronous JavaScript and XML) and what it means. Microsoft is pushing heavily the ATLAS framework as a Microsoft version of AJAX. Come to the dinner and find out more. Here are the details: Overview of AJAX programming with Microsoft Atlas Tuesday, May 30, 2006 6:00 PM - Tuesday, May 30, 2006 8:00 PM Pacific Time (US & Canada) Welcome Time: Tuesday, May 30, 2006 5:30 PM Language: English-American Microsoft ......

Posted On Tuesday, May 23, 2006 11:10 AM

.NET Security - Exception Management
In previous days, I talked about many other ways to write a secure application. Today I will cover exception management and handling as it pertains to application security. When dealing with Exceptions, it's a best practice to hide the implementation details of your applications from the user. This includes hiding information regarding implementation, any secure data, and system configuration. To provide a secure application with regards to exception handling: * Use a structured exception handling ......

Posted On Monday, May 22, 2006 11:10 AM

.NET Code Access Security - Class Design Considerations
As secure developers, we must take into account our class designs. We need to reduce the attack surface available to potential to attackers. We can do this by limiting inheritance, and limit users or groups or even code that can call the secure code. Today we will concentrate on five major topics: * Limit class or member visibility * Seal non-base classes * Restrict callers of your code * Restrict inheritance with keys * Limit the set modifier on properties Limit class or member visitbility When ......

Posted On Saturday, May 20, 2006 8:17 PM

Free SharePoint Tools - CAML Builder
In some of my SharePoint experience, I have had some cases in which CAML is necessary. So, I scoured the web looking for references when CAML Builder from U2U was pointed to me. The tool is quite easy to use, as I will show you down below. First off, let's go through the login screen. You must specify at this point the URL of the SharePoint instance you wish to connect. For this example, I will be looking at the personal site of TestUser. You also have the option of connecting to the SharePoint instance ......

Posted On Friday, May 19, 2006 3:34 PM

C# 3.0 - First look at LINQ and implicit types
In the first look I posted last week, I asked the question why the var keyword for implicit types were so powerful and more than just syntactic sugar. After a response, I then realized I overlooked something pretty obvious with regards to LINQ queries. I found this post from Cyrus' Blather to be quite helpful: http://blogs.msdn.com/cyrus... Let's just go over the details for my own piece of mind. Let's compare how we would do each query in .NET 1.1, 2.0 and now 3.0. First, ......

Posted On Monday, May 15, 2006 12:06 PM

Understanding and Preventing Cross-Site Scripting
One of the many purposes of this blog is to stay up to date with .NET security features. One of the security topics that I'm going to cover today is Cross-Site Scripting (XSS) attacks. First off, let's understand what XSS attacks are. XSS attacks exploit vulnerabilities in Web-based input validation by injecting client side scripting, such as Javascript (JS) or Visual Basic Script (VBS). Once the script has been sent to the server, the data is stored and then sent back to the user. These attacks ......

Posted On Thursday, May 18, 2006 3:42 PM

What All Great .NET Developers Should Know
I found Scott Hanselman's post "What Great .NET Developers Ought to Know" just a little bit ago and it really is one of the best comprehensive lists of interview questions out there. Over time as I've interviewed people for positions within the current company, I always found a good checklist for what makes a good OO programmer but didn't have the definitive .NET list. This list is pretty much a must to know! Update: See This post for my own set of questions that I like to ask as well as my latest ......

Posted On Thursday, May 18, 2006 11:35 AM

C++/CLI and XML Code Documentation
Finally, in Visual Studio 2005, Microsoft now supports XML Code Documentation. Visual Studio now ships with XDCMake.exe which creates XML Documentation files that we so enjoyed back in C#. Let's take a further look on how to use it. First off, I created a new C++ CLR library in Visual Studio called AuditingLibrary. Once the project has been created, right-click on the project and go to the properties page. Notice on the left hand tree, that there is a XML Document Generator element. Expand that element ......

Posted On Wednesday, May 17, 2006 11:23 AM

Microsoft Application Threat Modeling - Security Workshop Wrapup
It was a great workshop held at Microsoft in DC today by Talhah Mir from the Application Consulting and Engineering (ACE) Team. We covered such topics as threat modeling, code security, attacks and countermeasures as well as lots of other topics. First off, let's talk a little about the ACE Team at Microsoft. The ACE Team is responsible for application performance, security, and privacy engineering at Microsoft. They have their blog at this location which is well worth checking out: http://blogs.msdn.com/ace_t... ......

Posted On Tuesday, May 16, 2006 7:02 PM

Day 5 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
Update: Put a comment in if you want the C# version of this code and I will get it to you Sorry about the delay about getting back to this, but I have been rebuilding a clean build environment for this tool for both Visual Studio 2003 and Visual Studio 2005 which required a little bit of work. I'm in the process of getting some sort of hosting so that I can share the source code, but if you need or want it in the mean time, please do not hesitate to contact me. Anyhow, we left off with the total ......

Posted On Monday, May 15, 2006 3:08 PM

ASP.NET 2.0 Custom Membership Providers
Last week, I was studying for 70-528 TS: Microsoft .NET Framework 2.0 - Web-Based Client Development at the local study group, I came across the out of the box Membership Providers. Currently, there are two Membership Providers out of the box with ASP.NET 2.0, the SqlMemberProvider and the ActiveDirectoryMembership Provider. On the MSDN, Microsoft has released the Provider Toolkit for ASP.NET 2.0. As we dig further, we see there is a link for Membership Providers which has an example of how to create ......

Posted On Monday, May 15, 2006 12:57 PM

.NET Code Access Security - ZoneIdentityPermission
In previous posts, I've talked about SqlClient permissions, Visual Studio 2005 improvements, strong names among other things. Today, we're going look at some of the ways to secure a web application. So, let's bring ZoneIdentityPermission and ZoneIdentityPermissionAttri... into the picture. This class allows the developer, through code, to specify the zone in which this code can be called. This mechanism for determining the location of the calling code is through Internet Explorer Zones. In the SecurityZone ......

Posted On Monday, May 15, 2006 10:47 AM

Reminder - Developer Security Training - May 16th
Microsoft is holding developer security training on May 16th at the Washington DC office. This class takes Microsoft security best practices and makes them applicable to the enterprise. The details of the event are: Developer Security Training - Washington, DC Tuesday, May 16, 2006 9:00 AM - Tuesday, May 16, 2006 5:00 PM (GMT-05:00) Eastern Time (US & Canada) Welcome Time: 8:30 AM Language: English-American Microsoft Washington, DC Facility Potomac5335 Wisconsin Ave. NW Suite 600Washington District ......

Posted On Monday, May 15, 2006 8:18 AM

C# 3.0, First Thoughts
Since I like to stay ahead of the curve when it comes to new technologies, I came across the C# 3.0 specification recently and thought it was quite interesting. I obtained the overall specification from Microsoft as a word document here: http://download.microsoft.c... Anders Heljsberg gave a presentation about the new specification on the MSDN Channel 9 which can be found here: http://channel9.msdn.com/Sh... ......

Posted On Friday, May 12, 2006 2:56 PM

.NET Code Access Security - SqlClient
In previous posts, I covered what you can do with strong names and the new features in Visual Studio 2005. My perspective regarding security is that it is way overlooked with our programming and needs to be reinforced in all day to day operations. Today, what we're going to cover is the SqlClientPermission and the SqlClientPermissionAttribute. We can use this attribute to restrict how the database can be accessed. I'm always of the mindset is to restrict most permissions unless specifically granted ......

Posted On Friday, May 12, 2006 9:53 AM

.NET Code Access Security for fun and profit - Strong Names
In the previous lesson, we covered the new functionality provided by the security user interface. Today, let's look at strong naming and how you can use it. I'm sure most people by now know about strong names and what they are. If not, here is the best explanation link I have: http://www.codeproject.com/... Basically what the strong name key can give us is cryptographically strong evidence for evaluation. In this case what we're going to do is use the strong name to restrict ......

Posted On Wednesday, May 10, 2006 2:16 PM

Day 4 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
UPDATE: See Day 9 of the Background Intelligent Transfer Service (BITS) Managed Wrapper for the source code plus binaries. In previous lessons, I laid out the basic API for BITS. Now I think it's time for us to start doing the actual planning on how to wrap this API. Let's start by mapping out the BITS types and then creating our own wrapped types. Below, I have a table of those native types and what the wrapped types will be: Enumerations Unmanaged BITS Type Wrapped Type BG_AUTH_SCHEME AuthenticationScheme ......

Posted On Wednesday, May 10, 2006 7:37 AM

Day 3 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
Update: Put a comment in if you want the C# version of this code and I will get it to you In the previous lesson, I left off with the basic understanding of the IBackgroundCopyManager. Today, we're going to dive a little deeper into what exactly the IBackgroundCopyManager creates, the IBackgroundCopyJob. There are many methods in the IBackgroundCopyJob and so much so that it's really difficult to talk about each one in detail. As the versions of BITS evolved, more interfaces were added to support ......

Posted On Wednesday, May 10, 2006 7:34 AM

Day 2 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
Update: Put a comment in if you want the C# version of this code and I will get it to you In my previous lesson, I gave a brief overview of the Background Intelligent Transfer Service. Today we will dig a bit deeper into some of the API as well as give reasons why I chose Managed C++ over a C# implementation. First off, there was plenty of reading to do from the last time. If you want to read more about the uses of BITS as well as the key technologies behind it, please check out this link: http://msdn.microsoft.com/l... ......

Posted On Wednesday, May 10, 2006 7:33 AM

Day 1 of the Background Intelligent Transfer Service (BITS) Managed Wrapper
Update: Put a comment in if you want the C# version of this code and I will get it to you A large client of mine wanted an automated way of delivery large files picture files throughout their network. After listening to their initial solution of FTP, I realized after some research that the Background Intelligent Transfer Service (BITS) would be a good alternative. I could programatically use BITS to transfer files automatically to the other computer using upload job types. BITS has an advantage over ......

Posted On Tuesday, May 9, 2006 12:47 PM

.NET Code Access Security for fun and profit Part II
As I left off last time, I gave a few examples of how to enforce identity security checks via your code. Now, let's look into the changes for Visual Studio 2005. This has quite a few advantages over Visual Studio 2003 in terms of having a user interface for specifying basic security attributes. First off, below is what you would expect when you click on the project properties and browse to the security tab on the left hand side menu. From here, you have the ability to set whether your project has ......

Posted On Tuesday, May 9, 2006 11:44 AM

.NET Code Access Security for fun and profit
In my coding, I've always been careful about which operations are permitted and which are not. I took a lot of lessons learned when I studied for and passed 70-340 Implementing Security for Applications with Microsoft Visual C# .NET. Anyhow, I want to run through a few examples of what I have been doing as a best practice. As I go along in time, I'll run through more useful examples and how they apply to the enterprise. Believe me, in the world today, companies are becoming increasingly interested ......

Posted On Monday, May 8, 2006 3:10 PM

Studying for the MCPD
I recently joined the ViennaMCSD group which is studying for the MCPD. I got my MCSD a year ago and now in the process of studying to upgrade it. I think this is a pretty worthwhile group if you are interested in studying for the certification in a group setting. In the future, I should probably look to upgrade my MCDBA as well and even look at the new BizTalk certifications. I see that they still don't have any SharePoint exams at this juncture which I think it interesting ......

Posted On Monday, May 8, 2006 8:28 AM

Developer Security Training - May 16th
Microsoft is holding developer security training on May 16th at the Washington DC office. This class takes Microsoft security best practices and makes them applicable to the enterprise. The details of the event are: Developer Security Training - Washington, DC Tuesday, May 16, 2006 9:00 AM - Tuesday, May 16, 2006 5:00 PM (GMT-05:00) Eastern Time (US & Canada) Welcome Time: 8:30 AM Language: English-American Microsoft Washington, DC Facility Potomac5335 Wisconsin Ave. NW Suite 600Washington District ......

Posted On Monday, May 8, 2006 7:48 AM

Upgrading from Managed C++ to C++/CLI
I'm sure there are plenty of people still working in the .NET 1.1 world with Managed C++ who haven't quite moved to C++/CLI. I'm finally taking some of my legacy applications that I have written and porting them over to C++/CLI. Unfortunately, the conversion process wasn't very smooth, as I had a lot of unresolved externals once I tried to compile the application. Microsoft has published a migration guide in order to bring your code "up to date" and gives a checklist that you must follow which is ......

Posted On Friday, May 5, 2006 10:04 AM

Free SharePoint Tool of the Week - InstallAssemblies
While working on a large SharePoint deployment for a major corporation, I came across many interesting tools to make my life easier. During the development process, I found it to be a hassle to deploy WebParts to the server over and over again, going through those many steps. During my searching for tools, I discovered InstallAssemblies which is a wonderful tool to allow the easy deployment of WebPart libraries to a SharePoint server. The tool can be found as part of the Web Part Toolkit: http://www.bluedoglimited.c... ......

Posted On Thursday, May 4, 2006 4:54 PM

Free testing tools - WebServiceStudio 2.0
Update: Now moved here: http://www.codeplex.com/wss... At one point or another, we've had the need to test our web services and WSDLs. When I was on a BizTalk integration project, I had the need to test the orchestrations exposed via Web Services easily without jumping through all the code. This WebServicesStudio 2.0 tool allows you to test web services with ease and solves a lot of problems. The product is available here: http://www.codeplex.com/wss... Like most tools, I like to ......

Posted On Thursday, May 4, 2006 4:51 PM

Why isn't Vista built on .NET technologies?
This article by Gary McGraw, CTO of Cigital Inc, wrote an article saying how Microsoft missed an opportunity with moving Vista to .NET. Very much worth reading here: http://darkreading.com/docu... This paragraph definitely caught my eye: The problem, it turns out, is that the .NET builders did not give much thought to providing many of the essential basic building blocks that operating systems construction crews need for their work. Interpreted code has some minor performance issues ......

Posted On Thursday, May 4, 2006 4:50 PM

Upcoming Code Camp - June 10th
I will be attending the upcoming Reston Code Camp on June 10, 2005. Here are the details: Saturday, June 10, 2006 9:00 AM - Saturday, June 10, 2006 7:00 PM (GMT-05:00) Eastern Time (US & Canada) Language: English-American Microsoft Conference Center - MTC Reston 12012 Sunset Hills Rd Reston Virginia 20190United States The link for registration for this event is here: http://msevents.microsoft.c... It's well worth checking out and a shame ......

Posted On Thursday, May 4, 2006 4:48 PM

Managed C++ and IDisposable
Lately, I've been working with a lot of Managed C++ and creating a managed wrapper for the Background Intelligent Information Service (BITS). As time goes along, I will get deeper into the code, but for now I'll just cover the little topics as they come up. As always I run FX Cop, which is available here http://www.gotdotnet.com/te... to validate my coding. I ran across the rule "ImplementIDisposableCorrec... Unfortunately, when I click on the link to check for resolution for my problem, ......

Posted On Thursday, May 4, 2006 9:54 AM

Copyright © Matthew Podwysocki | Powered by: GeeksWithBlogs.net