<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1528805174514452404</id><updated>2012-01-26T09:47:03.246-05:00</updated><category term='Delete Files'/><category term='101 Topics'/><category term='VSLive'/><category term='IIS 7.0'/><category term='reflection'/><category term='ONETUG'/><category term='Expression Encoder'/><category term='Microsoft'/><category term='introduction'/><category term='Windows 8'/><category term='MVC'/><category term='Architecture'/><category term='Windows Authentication'/><category term='Decompiling'/><category term='asynchronous'/><category term='Code Camp'/><category term='Errors'/><category term='Smart Phones'/><category term='Custom Built PC'/><category term='Conversions'/><category term='AJAX'/><category term='Expression Blend'/><category term='Object Data Source'/><category term='TPL'/><category term='VB.NET'/><category term='Encryption'/><category term='Lambda Expressions'/><category term='Security'/><category term='Freebies'/><category term='ASP.NET'/><category term='VS.NET IDE'/><category term='.ASMX Services'/><category term='MSDN'/><category term='Archiecture'/><category term='Building'/><category term='FTP'/><category term='Awards'/><category term='thoughts'/><category term='Computer Hardware'/><category term='Conference'/><category term='VS.NET 2010'/><category term='Debugging'/><category term='Visual Studio Live'/><category term='History'/><category term='DDD'/><category term='SSL'/><category term='Windows Service'/><category term='Sentiment Analysis'/><category term='Opinion Piece'/><category term='Android'/><category term='System.IO'/><category term='Design Patterns'/><category term='Natural Language Processing'/><category term='Windows 7'/><category term='LINQ'/><category term='Book Review'/><category term='LightSwitch'/><category term='IIS 7.5'/><category term='jQuery'/><category term='SQL2008'/><category term='Setup Packages'/><category term='VSS'/><category term='Periodic Execution'/><category term='.asmx'/><category term='PLINQ'/><category term='VS.NET 2008'/><category term='VB6'/><category term='ListBox'/><category term='Recursion'/><category term='Non .NET Related'/><category term='XML'/><category term='code refactoring'/><category term='MS'/><category term='Caching'/><category term='TSQL'/><category term='ADO.NET'/><category term='C#'/><category term='Windows Server'/><category term='Twitter API'/><category term='Cassini'/><category term='Enums'/><category term='WCF'/><category term='Metro Apps'/><category term='Asynchronous Programming'/><category term='Bindings'/><category term='SQL2000'/><category term='HTML'/><category term='OOP'/><category term='Internet Explorer'/><category term='DropDownList'/><category term='JavaScript'/><category term='Exceptions'/><category term='Training'/><category term='.NET'/><category term='Silverlight'/><category term='BitLocker'/><title type='text'>Allen Conway's .NET Weblog</title><subtitle type='html'>Exploring all things .NET and beyond...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>88</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-4407362067127235639</id><published>2012-01-24T23:31:00.001-05:00</published><updated>2012-01-24T23:31:00.370-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exceptions'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Building'/><title type='text'>Fixing the System.IO.FileLoadException Upon Building An Application Using A Downloaded Assembly</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you ever download applications or assemblies from CodePlex or other open source communities that were originally zipped up (.zip) and either contain references to additional assemblies within or reference the assembly in one of your own applications, you may run across the following 'System.IO.FileLoadException' exception upon building the application in VS.NET:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;"System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Dev\TestApp\Components\Some3rdParty.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) File name: 'file:///C:\Dev\TestApp\Components\Some3rdParty.dll' ---&amp;gt; System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See &lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=155569"&gt;&lt;span style="font-family:arial;color:#ff0000;"&gt;&lt;em&gt;http://go.microsoft.com/fwlink/?LinkId=155569&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt; for more information."&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;As you can see the exception message is recommending a link on how to fix this error. The link refers to a &amp;lt;loadFromRemoteSources&amp;gt; element within the &amp;lt;runtime&amp;gt; parent element in the application's configuration file. The IDE thinks that this resource is being loaded from a network drive or a non-sandboxed environment and is trying to protect you the developer and the application from security risks.&lt;br /&gt;&lt;br /&gt;However you can see within the exception I posted that the .dll is located within the project on a local drive. So adding any additional configuration here is not what I wanted to do.&lt;br /&gt;&lt;br /&gt;In reality what has happened is that the .dll I extracted from the original .zip that I downloaded from Codeplex was already built (in this case it’s a 3rd party assembly and I do not have the source for it to recompile) and was automatically marked as coming from "another computer" and might be a security risk. The compiler will &lt;em&gt;not&lt;/em&gt; allow the application to successfully build in this state with the security flag.&lt;br /&gt;&lt;br /&gt;Removing the security flag is simple. Just navigate to the file in Windows Explorer and right-click it to view its properties. On the main tab at the bottom you will see the following:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-ITt-LQxJNTI/Tx7dxNri1OI/AAAAAAAAAho/cSWIvn78xRo/s1600/UnblockFile.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 393px; DISPLAY: block; HEIGHT: 142px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5701238015853253858" border="0" alt="" src="http://3.bp.blogspot.com/-ITt-LQxJNTI/Tx7dxNri1OI/AAAAAAAAAho/cSWIvn78xRo/s400/UnblockFile.png" /&gt;&lt;/a&gt;&lt;br /&gt;Simply press 'Unblock' and then close the Properties window. Now rebuild your application in VS.NET and you should no longer see the exception.&lt;br /&gt;I see the problem most often with using the pre-built AjaxControlToolkit.dll that comes from the .zip downloaded from CodePlex as well. However, you would not see this issue if you have the actual source code and compile the .dll yourself &lt;em&gt;prior&lt;/em&gt; referencing.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-4407362067127235639?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/4407362067127235639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2012/01/fixing-systemiofileloadexception-upon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4407362067127235639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4407362067127235639'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2012/01/fixing-systemiofileloadexception-upon.html' title='Fixing the System.IO.FileLoadException Upon Building An Application Using A Downloaded Assembly'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-ITt-LQxJNTI/Tx7dxNri1OI/AAAAAAAAAho/cSWIvn78xRo/s72-c/UnblockFile.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-210076290998081314</id><published>2012-01-02T16:53:00.002-05:00</published><updated>2012-01-02T16:59:50.617-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PLINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='TPL'/><category scheme='http://www.blogger.com/atom/ns#' term='Asynchronous Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='asynchronous'/><title type='text'>Leveraging Parallelism in the .NET Framework 4.0 for Asynchronous Programming</title><content type='html'>&lt;span style="font-family:arial;"&gt;As I have mentioned in some of my previous previous posts it's amazing how easy it is to preform asynchronous processing in the later versions of the .NET Framework especially in .NET 4.0. The abstractions provided within the framework expose methods and libraries to be able to easily parallelize your queries or run tasks in parallel without all the hassle of managing your own threads. The idea is to harness the power and avalaibale threads on multi-core platforms today without having to actual manage the thread allocation and use yourself. This functionality is exposed in PLINQ (Parallel Language Integrated Query) and the TPL (Task Parallel Library) and are what I will be highlighting today.&lt;br /&gt;&lt;br /&gt;1st let's take a look at parallelizing your existing LINQ query's with PLINQ. We are going to work with a simple 'Employee' class that has a few properties  and dummy methods (implementation code for dummy methods is not the focus here) and another class named 'Payroll' with a method named 'CalculatePayRate' as shown below:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;Public Class Employee&lt;br /&gt;   Public Function FindAll() As List(Of Employee)&lt;br /&gt;     'Notice the use of collection initializers that were added in VS.NET 2010 for VB.NET&lt;br /&gt;     Dim Employees = New List(Of Employee) From&lt;br /&gt;      {&lt;br /&gt;       New Employee() With {.FirstName = "John", .LastName = "Smith", .JobCode = 2, .ServiceYears = 1, .Age = 25, .IsActive = True},&lt;br /&gt;       New Employee() With {.FirstName = "Allen", .LastName = "Conway", .JobCode = 4, .ServiceYears = 8, .Age = 32, .IsActive = True},&lt;br /&gt;       New Employee() With {.FirstName = "Jane", .LastName = "Hulu", .JobCode = 6, .ServiceYears = 12, .Age = 40, .IsActive = True},&lt;br /&gt;       New Employee() With {.FirstName = "Clark", .LastName = "Griswold", .JobCode = 1, .ServiceYears = 4, .Age = 52, .IsActive = False},&lt;br /&gt;       New Employee() With {.FirstName = "Paul", .LastName = "Jacks", .JobCode = 15, .ServiceYears = 70, .Age = 93, .IsActive = True}&lt;br /&gt;      }&lt;br /&gt;     Return Employees.ToList()&lt;br /&gt;   End Function&lt;br /&gt;&lt;br /&gt;   Public Property Age As Integer&lt;br /&gt;   Public Property FirstName As String&lt;br /&gt;   Public Property IsActive As Boolean&lt;br /&gt;   Public Property LastName As String&lt;br /&gt;   Public Property JobCode As Integer&lt;br /&gt;   Public Property PayRate As Decimal&lt;br /&gt;   Public Property ServiceYears As Integer&lt;br /&gt;&lt;br /&gt;   Public Sub DoSomething1()&lt;br /&gt;     'Code&lt;br /&gt;   End Sub&lt;br /&gt;&lt;br /&gt;   Public Sub DoSomething2()&lt;br /&gt;     'Code&lt;br /&gt;   End Sub&lt;br /&gt;&lt;br /&gt;   Public Sub DoSomething3()&lt;br /&gt;     'Code&lt;br /&gt;   End Sub&lt;br /&gt;&lt;br /&gt;   Public Function GetEmployeeList1() As List(Of Employee)&lt;br /&gt;     'Code here&lt;br /&gt;   End Function&lt;br /&gt;&lt;br /&gt;   Public Function GetEmployeeList2() As List(Of Employee)&lt;br /&gt;     'Code here&lt;br /&gt;   End Function&lt;br /&gt;&lt;br /&gt;   Public Function GetEmployeeList3() As List(Of Employee)&lt;br /&gt;     'Code here&lt;br /&gt;   End Function&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;Public Class Payroll&lt;br /&gt; Public Function CalculatePayRate(ByVal JobCode As Integer, ByVal YearsOfService As Integer, ByVal Age As Integer) As Decimal&lt;br /&gt;   If (JobCode &amp;gt;= 1 And JobCode &amp;lt;= 5) And (YearsOfService &amp;lt;= 5) Then       Return 10.5    ElseIf (JobCode &amp;gt;= 1 And JobCode &amp;lt;= 5) And (YearsOfService &amp;gt; 5) Then&lt;br /&gt;      Return 12&lt;br /&gt;   ElseIf (JobCode &amp;gt; 5 And JobCode &amp;lt;= 10) And (YearsOfService &amp;lt;= 5) Then       Return 22.5    ElseIf (JobCode &amp;gt; 5 And JobCode &amp;lt;= 10) And (YearsOfService &amp;gt; 5) Then&lt;br /&gt;      Return 25&lt;br /&gt;   ElseIf (JobCode &amp;gt; 10) And (Age &amp;gt; 90) Then&lt;br /&gt;      'Reward hard work!&lt;br /&gt;      Return 150&lt;br /&gt;   Else&lt;br /&gt;      Return 8&lt;br /&gt;   End If&lt;br /&gt; End Function&lt;br /&gt;End Class&lt;br /&gt;&lt;/pre&gt;I have set up a simple method below named 'EmployeeCalcPayRateUsingPLINQ' which will demonstrate getting a list of active Employees using LINQ and then calling the 'CalculatePayRate' both synchronously the traditional way using a For-Each loop (commented out in code) and then using PLINQ to make the same call in parallel.&lt;br /&gt;&lt;br /&gt;All you need to do to parallelize your LINQ queries is to add the 'AsParallel' call at the end of your query. This will expose several of the PLINQ extension methods like the one we will be using today: 'ForAll'. The ForAll(Of TSource) parallel extension method will take a lambda expression that defines the code or delegate of the method to be called in parallel. We can use .ForAll() when we need to perform some action on every item in the source. In our case we need to manipulate the Employee's .PayRate value. This could be done synchronously, but is a prime candidate to be done in parallel because 1 employee’s payrate has no bearing on another’s so they can be calculated and processed in parallel. Let's take a look at the code:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;Public Sub EmployeeCalcPayRateUsingPLINQ()&lt;br /&gt;   Dim Employees As List(Of Employee) = Nothing&lt;br /&gt;   Dim myPayroll As New Payroll&lt;br /&gt;   Dim myEmployee As New Employee&lt;br /&gt;&lt;br /&gt;   'Get a list of all employees&lt;br /&gt;   Employees = myEmployee.FindAll()&lt;br /&gt;&lt;br /&gt;   'Using LINQ to Objects, create a query that contains all 'Active' employees&lt;br /&gt;   Dim ActiveEmpQuery = From Emp In Employees&lt;br /&gt;     Where Emp.IsActive&lt;br /&gt;     Select Emp&lt;br /&gt;&lt;br /&gt;   'Using brute-force syncronous loop processing to calculate and set the payrate for each Employee object:&lt;br /&gt;   'Uncomment to try syncronous loop version&lt;br /&gt;   'For Each Emp As Employee In ActiveEmpQuery&lt;br /&gt;   '    Emp.PayRate = myPayroll.CalculatePayRate(Emp.JobCode, Emp.ServiceYears, Emp.Age)&lt;br /&gt;   'Next&lt;br /&gt;&lt;br /&gt;   'Parallelize the LINQ query by calling the .ForAll extension method.&lt;br /&gt;   'Pass in a Lambda Expression that defines the delegate to be called in parallel&lt;br /&gt;   'that will calculate the payrate on each Employee instance.&lt;br /&gt;   ActiveEmpQuery.AsParallel.ForAll(Sub(Emp)&lt;br /&gt;                          Emp.PayRate = myPayroll.CalculatePayRate(Emp.JobCode, Emp.ServiceYears, Emp.Age)&lt;br /&gt;                            End Sub)&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;As you can see with the example above, the PLINQ code and the traditional For-Each loop are the same line of code. However, the real gain here is in the time to process. If the list of active employees is 5000, the PLINQ .ForAll method will be able to use any available threads to run in parallel vs. the traditional loop which will process all 5000 records 1 at a time. The net gain is in the reduction of processing time since the PLINQ will run in parallel.&lt;br /&gt;&lt;br /&gt;The Task Parallel Library (TPL) is another technology available in the .NET 4.0 Framework and is exposed in a set of APIs in the System.Threading and System.Threading.Tasks namespaces. The TPL will allow us to parallelize 'Tasks'. We can use the TaskFactory.StartNew(Action) method to start a task in parallel. This allows us to call several method in parallel that otherwise would have been to called synchronously. For example if we have (3) methods to call all which are unrelated and non-dependent of each other but must be called to complete processing, TPL can assist greatly. Especially if the call to the 1st method is longer running and blocks subsequent calls for being made. Using TaskFactory.StartNew(Action) is good for calling methods that return a result, and I will also highlight the Parallel.Invoke() method for calling methods with no return value in parallel. So let's 1st look at the code to create Tasks to be run in parallel and then extract their results:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;Public Sub EmployeeProcessingUsingTPLTasks()&lt;br /&gt;   Dim Results1 As List(Of Employee) = Nothing&lt;br /&gt;   Dim Results2 As List(Of Employee) = Nothing&lt;br /&gt;   Dim Results3 As List(Of Employee) = Nothing&lt;br /&gt;   Dim AllEmployeeData As New List(Of List(Of Employee))&lt;br /&gt;   Dim Emp As New Employee()&lt;br /&gt;&lt;br /&gt;   'Create a Task that will call the Employee.GetEmployeeList1() method having its results dumped into 'Task1'&lt;br /&gt;   Dim Task1 = Task(Of List(Of Employee)).Factory.StartNew(Function() Emp.GetEmployeeList1())&lt;br /&gt;   'Create a Task that will call the Employee.GetEmployeeList2() method having its results dumped into 'Task2'&lt;br /&gt;   Dim Task2 = Task(Of List(Of Employee)).Factory.StartNew(Function() Emp.GetEmployeeList2())&lt;br /&gt;   'Create a Task that will call the Employee.GetEmployeeList3() method having its results dumped into 'Task3'&lt;br /&gt;   Dim Task3 = Task(Of List(Of Employee)).Factory.StartNew(Function() Emp.GetEmployeeList3())&lt;br /&gt;&lt;br /&gt;   'Note: each call to [Task].Result ensures that the asynchronous operation is complete before returning (built in functionality)&lt;br /&gt;   'Add the List from the Task1.Result to the collection in location '0'&lt;br /&gt;   AllEmployeeData.Insert(0, Task1.Result)&lt;br /&gt;   'Add the List from the Task2.Result to the collection in location '1'&lt;br /&gt;   AllEmployeeData.Insert(1, Task2.Result)&lt;br /&gt;   'Add the List from the Task3.Result to the collection in location '3'&lt;br /&gt;   AllEmployeeData.Insert(2, Task3.Result)&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;In the example code below Tasks are started and run and their results are available from calling the Task.Result() property. Note that a call to [Task].Result ensures that the asynchronous operation is complete before returning (built in functionality). So this is where a synchronous behavior could appear if accessing a Result from a function that had not yet completed; the thread would block until its results were available. However the Tasks themselves were all run in Parallel and you could use this method to also call methods that have no return value, and which the .Result property didn't need to be accessed.&lt;br /&gt;&lt;br /&gt;The last example I will show is using the Parallel.Invoke method to run 1..n methods in parallel. The code is pretty straight forward so let's look at calling a few methods on the Employee class in parallel:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;Public Sub EmployeeProcessingUsingTPLParallelInvoke()&lt;br /&gt;   Dim Emp As New Employee()&lt;br /&gt;&lt;br /&gt;   'Make parallel individual calls via the TPL's Parallel.Invoke     &lt;br /&gt;   Parallel.Invoke(Sub() Emp.DoSomething1(),&lt;br /&gt;                   Sub() Emp.DoSomething2(),&lt;br /&gt;                   Sub() Emp.DoSomething3())&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;As you can see individual 'DoSomething()' methods were called in parallel and handled by the TPL. I think this can be helpful when needing to call several individual non-dependent methods but yet to another process behave as an aggregate or composite of calls needed to complete a single operation.&lt;br /&gt;&lt;br /&gt;I have just discussed and provided a few examples of using PLINQ and the TPL in the .NET Framework 4.0. These examples barely scrape the surface of these topics and some of the lower level performance relationships that exist in relationship to the hardware the code it is trying to expose. I recommend trying out these examples and then building upon them. At any rate you can see how powerful just a few lines of code can be to any of your .NET applications.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-210076290998081314?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/210076290998081314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2012/01/leveraging-parallelism-in-net-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/210076290998081314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/210076290998081314'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2012/01/leveraging-parallelism-in-net-framework.html' title='Leveraging Parallelism in the .NET Framework 4.0 for Asynchronous Programming'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-260347212270721615</id><published>2011-12-03T21:23:00.005-05:00</published><updated>2011-12-03T21:37:54.336-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Training'/><category scheme='http://www.blogger.com/atom/ns#' term='VSLive'/><title type='text'>Visual Studio Live Orlando is almost here – December 5-9. Are you planning to go?</title><content type='html'>&lt;span class="Apple-style-span" &gt;&lt;a href="http://4.bp.blogspot.com/-aeD30lyQmqc/TtrcItzJaNI/AAAAAAAAAhI/E-dlUFlXVyc/s1600/VSLive2011Orlando.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 65px;" src="http://4.bp.blogspot.com/-aeD30lyQmqc/TtrcItzJaNI/AAAAAAAAAhI/E-dlUFlXVyc/s400/VSLive2011Orlando.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5682095922172487890" /&gt;&lt;/a&gt;&lt;br /&gt;Visual Studio Live Orlando is just about here, and if you have not attended before or are a past attendee, check it out!&lt;br /&gt;&lt;br /&gt;It’s a great opportunity to interact one-on-one with industry experts and Microsoft insiders, like Rachel Appel, Andrew Brust, Scott Cate, Billy Hollis and Rocky Lhotka on everything from .NET 4/Visual Studio 2010 and Silverlight to cloud computing, Windows Phone 7 development and HTML5.  Plus, why wouldn’t you want to escape the December cold and be here in sunny Florida? Can you handle the ordered up weather below for this upcoming week at the conference?&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-0x57H9SIRMo/TtrcM9_OnNI/AAAAAAAAAhU/cAfzqajod-4/s1600/VSLive2011OrlandoWeather.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 370px; height: 247px;" src="http://2.bp.blogspot.com/-0x57H9SIRMo/TtrcM9_OnNI/AAAAAAAAAhU/cAfzqajod-4/s400/VSLive2011OrlandoWeather.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5682095995237604562" /&gt;&lt;/a&gt;&lt;br /&gt;This will be my 4th time to VSLive! and I think the knowledge and networking opportunities gained are worth the conference price 10 fold. I am asked so often how from new or junior programmers about how they can grow and advance their career. Attending a 1st class conference like this and learning from the experts is definitely a step in the right direction.&lt;br /&gt;&lt;br /&gt;Interested in attending? There is still time, and if you are a programmer local to Central Florida come and see just how great this conference really is. Check out the special group rates offered for companies that bring 3 or more people. Register today at http://bit.ly/VSLOL11Reg. &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-260347212270721615?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/260347212270721615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/12/visual-studio-live-orlando-is-almost.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/260347212270721615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/260347212270721615'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/12/visual-studio-live-orlando-is-almost.html' title='Visual Studio Live Orlando is almost here – December 5-9. Are you planning to go?'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-aeD30lyQmqc/TtrcItzJaNI/AAAAAAAAAhI/E-dlUFlXVyc/s72-c/VSLive2011Orlando.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-5693567960357045268</id><published>2011-11-15T23:57:00.013-05:00</published><updated>2011-11-29T10:24:25.495-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Opinion Piece'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>What Happened To Windows Desktop Gadgets And Why Did Microsoft Abandon Them?</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;span class="Apple-style-span"&gt;A quick opinion entry here post bowling night (Yes I do have other hobbies besides programming!). Anyways &lt;em&gt;&lt;strong&gt;back on topic&lt;/strong&gt;&lt;/em&gt; I was quite disappointed to see a Tweet come across a few days ago stating that Windows Gadgets were being retired and the Gallery hosting them was no more. What?!?! I actually have always been a big fan of those things. I mean as a developer that sits in front of a machine with multiple screens for 8+ hours a day, I like all the information those things provide me at quick glance. After all we are in the information overload age (i.e. Smartphones, tablets, computers, etc.) and the gadgets fit right in to that role. Desktop gadgets were 1st made popular on Macs, then Yahoo came out with their "Yahoo Widgets", and finally Windows got in the game to offer support natively in the OS beginning with Windows Vista. However the gallery has been retired and support has quickly shifted away. Here is the official Microsoft Link on the status of the retired gallery and discontinued support: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://windows.microsoft.com/en-US/windows/downloads/looking-for-gadgets" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Looking for gadgets?&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Here is an excerpt from the above link stating it all:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;"The Windows Live Gallery has been retired. In order to focus support on the much richer set of opportunities available for the newest version of Windows, Microsoft is no longer supporting development or uploading of new Gadgets." &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;OK I get it. Microsoft is positioning itself for Windows 8 and its new design including a focus on 'Metro Style Apps'. Windows Gadgets don't fit at all into that new design and really hinder in some ways the competing and improved look of Windows 8. You need folks to forget about these little anchored desktop apps and focus on Metro Apps in Windows 8. This could not be as strong of a directive with these 'dead weight' mid 2000 type apps lingering around (not really my thoughts, but probably the view at a meeting at Microsoft when the decision came to retire these widgets). I had already noticed a lack of developer interest and I understand this as well. It's not the sexy thing to spend time on in present day. If you were about to sit down and create a little weather app, would you make a Desktop Gadget or a Windows Phone 7 app for the marketplace? Easy enough answer. But even the minimal support was welcomed and still created a huge portfolio of selectable and free fun, productive, entertaining, and cool apps to have on the desktop. However I think the decision to retire the gallery and discontinue support is a bit premature and let me explain why. It is not often I disagree with Microsoft because I live for the technology they pump out of Redmond, but I am not on the same page with them on this decision.&lt;br /&gt;&lt;br /&gt;There was a time from say 1993ish to 2005ish where it was almost a necessity to buy a new computer every few years to keep the hardware up with what the applications could do. Even simple tasks like having a browser open and Microsoft Word could be dauntingly slow on an older machine. So what does one do? Buy a new computer so multitasking became a possibility and didn't drive the user nuts. Also during this time period, the cutting edge industry development and the hardware were not that far apart. Using a Windows 98 box with VB5, Access, C++, etc. and building the best apps (excluding gaming) using the latest technology didn't require any special hardware. Using a standard home PC would allow one to create, build, and deploy these types of apps.&lt;br /&gt;&lt;br /&gt;Now we have gotten to a point where I think us in the development community and those in the R&amp;amp;D sector moving the ball forward may not realize the disconnect that is upon us. The cutting edge technology and its expectations in my opinion will not excite a large portion of the market share. Sometime around the mid 2000's, PC hardware began to outpace the software running on it for the 1st time which helped drive costs down on PCs and allowed the consumer to breath a bit and not have to rush out to get the new OS and machine. "Hey if I can run my browser, email my family, and write Word documents, I am set!" Not everyone is 16 years old and rushing out to get the newest piece of hardware that supports the cutting edge technology, which we were all forced to do in years passed. Microsoft could rely on the fact that users would continue to buy newer, faster, smaller PCs and along with that the newest OS too. It was a nice harmony because the software and hardware naturally moved together and everyone (users and developers) had to keep up with the same pace. You didn't find too many Windows 95 users in 2003, 8 years after it came out, but you can certainly find a large portion of home PCs (and businesses too) that are still running Windows XP 10 years after release. This is because that stable, easy to use, machine doesn't warrant being replaced. In current day Microsoft can no longer expect the average user is going to buy a new piece of hardware to support the newest OS; that hand is not naturally being forced as it once was 10-15 years ago. Therefore support of what may be deemed 'legacy' technology or software (even if it is only 5 years old) has to be taken into consideration to keep the masses happy.&lt;br /&gt;&lt;br /&gt;So what in the heck does that background have to do with Desktop Gadgets going away you ask? Well, I think for starters a lot of late migrators to Windows Vista or Windows 7 will be disappointed when they buy the computer and see one of the 'neat' features, Gadgets, is retired even before some had a chance to use them. But more prevalent than worrying about people who are behind in technology (hey you snooze you don't get to experience it like those of us that bought it on time, Ha!), is I wonder if Microsoft is going a little hard to place all their eggs in 1 basket with Windows 8. I don't think the masses will move quickly but this is not apparent by those of us in the technical community. We will all have it as soon as it is released to Beta and installed on Day 1. But that is a bad impression for the general use market share. I don't think everyone is going to abandon their PC for a tablet running Windows 8. And don't get me wrong; I don't think Microsoft is thinking this will happen either, but I do think some feel this is what "Everyone will be doing in 5 years..." I am not so convinced. I will be all over Windows 8 because of what I do and how much I like the technology, but I am not sure about Sister, Mom, Dad, Grandma, Friend 1, and Friend 2.&lt;br /&gt;&lt;br /&gt;So I liken retiring the Windows Gadgets the start of Microsoft's reposition for its new OS, and is just the tip of the iceberg. I hope Microsoft doesn't continue to make decisions like this to slowly force people into buying Windows 8 because their nice, stable, Windows 7, Vista, or XP machine has 20% of its features retired or not supported. It's an aggressive stance and I get the feeling from the Build conference that Microsoft will be pursuing Windows 8 harder than any OS since maybe Windows 95. I just hope it does not come back to haunt Microsoft by leaving a bad taste in people's mouth by being unwillingly shuffled along faster than they care to. It's a fine line to walk.&lt;br /&gt;&lt;br /&gt;This isn't the only instance were they suttly or explicitly phased out technology. For example, VS.NET 2010 will not support Windows CE development. Hold the horses!! I don't recommend making new CE apps at this point in time, but I have 1st hand experience working on a current 3rd party product that uses a propriatary device runnign on Windows CE. Makes total sense why Microsoft would not support CE development in VS.NET 2010: DO WP7 DEVELOPEMENT! But once again it's these decisions that I think don't agree with the masses as evident by the feedback from this Microsoft Connect entry:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://connect.microsoft.com/VisualStudio/feedback/details/595712/no-support-for-windows-ce-and-compact-framework-development-in-vs2010" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;No support for Windows CE and Compact Framework development in VS2010&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So maybe a bit profound for the analyzation of why the Desktop Gadets went away, but I think there is a bigger picture here. And yes personally I am disappointed and don't think it would have slowed down Windows 8's new sexy features too much. You can still search the net for the individual gadgets if you are looking for a particular one, but they are already difficult to find so zip them up and save off the .gadget files on your machine. It will not matter beyond Windows 7 though because they will not be supported in Windows 8, so enjoy them on your already out-of-date Windows 7 PC (a little tongue-and-cheek there obviously). Or you can still use Yahoo Widgets which you can check out here, and they have a massive widget library:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://widgets.yahoo.com/" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Yahoo! Widgets&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Well the nice thing about this blog is hopefully I can come back in a few years and maybe 'eat crow' showing I was all wrong. But for the time being I am disappointed to see the desktop widgets essentially discontinued, and I feel Microsoft may have missed the bulls-eye a bit on this decision.&lt;br /&gt;&lt;br /&gt;Anyone reading this feel free to post links to websites, SkyDrive locations etc, to share .gadget files if you wish.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-5693567960357045268?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/5693567960357045268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/11/what-happened-to-windows-desktop.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5693567960357045268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5693567960357045268'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/11/what-happened-to-windows-desktop.html' title='What Happened To Windows Desktop Gadgets And Why Did Microsoft Abandon Them?'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1010272011827956670</id><published>2011-11-09T23:25:00.001-05:00</published><updated>2011-11-10T11:29:38.321-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Expression Encoder'/><title type='text'>How To: Create A Thumbnail Image From A Video Using The Microsoft Expression Encoder SDK</title><content type='html'>&lt;span style="font-family:arial;"&gt;In the modern day of the web, video players of all sorts of technology are being used from Flash, Windows Media Player, Silverlight, HTML, and many more. Commonly we will use a preview image (like seen on YouTube for example) to give a still image of what the video visually represents. You can accomplish the creation of this video thumbnail dynamically in .NET using the Expression Encoder SDK.&lt;br /&gt;&lt;br /&gt;The idea is to load a video into a 'AudioVideoFile' object and then create a still image file based on a provided interval within the video. This gives managing video thumbnails a hands-off approach to creation saving a lot of time as opposed to someone needing to &lt;em&gt;manually&lt;/em&gt; create this file from the Encoder product directly. Using the right naming convention, once created you could just load the thumbnail into your video player automatically without ever needing to touch the video.&lt;br /&gt;&lt;br /&gt;To being you need to install Microsoft Expression Encoder and applicable service packs. As of this post the current version is Expression Encoder 4 SP2. The Expression Encoder 4 SDK and the documents are installed with the application. You can access the SDK from the Start menu by clicking All Programs and then clicking Microsoft Expression. The links below have the installations needed:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=18974" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Microsoft Expression Encoder 4&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.microsoft.com/download/en/details.aspx?id=27870" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Microsoft Expression Encoder 4 SP2&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This method of creating a thumbnail is best suited for a WCF service or directly within a ASP.NET web application because of the required Encoder components. It &lt;em&gt;must&lt;/em&gt; be installed on each server or machine where the code is ran. Therefore unless you have a limited user base, this may not work well within a WinForms or WPF application. In this case porting the functionality to a WCF service and having the remote applications call it to create the thumbnail would work best. This reduces the locations where the components need installed.&lt;br /&gt;&lt;br /&gt;An interesting fact is you &lt;em&gt;need&lt;/em&gt; the full version of Expression Encoder installed on the machine or server that has the code to generate the thumbnails, but you never &lt;em&gt;actually&lt;/em&gt; need to open or use the Encoder product itself. In the past, I did have success installing a trial version of Encoder and having the code continue to run successfully with the SDK, but you will need to confirm or deny this independently. The SDK alone is not enough to allow the code to work; it relies on the Expression Encoder product being installed. For the purposes of this code here, you never actually have to open Expression Encoder.&lt;br /&gt;&lt;br /&gt;After you have Expression Encoder, any current service packs, and the SDK installed you are ready to being. I recommend just making a little test harness in a web app or WPF app locally to see how it works. Then you can port it out to a service or in an actually application.&lt;br /&gt;&lt;br /&gt;To being add the following references to your application from the following location (assuming you are using the Expression Encoder 4 SDK) "C:\Program Files\Microsoft Expression\Encoder 4\SDK\":&lt;br /&gt;&lt;br /&gt;Now add the following 'Imports' or 'using' statements to your code:&lt;br /&gt;&lt;pre class="brush: vbnet"&gt;Imports System.IO&lt;br /&gt;Imports System.Drawing&lt;br /&gt;Imports System.Drawing.Imaging&lt;br /&gt;Imports Microsoft.Expression.Encoder&lt;br /&gt;&lt;/pre&gt;Next let's make a method named 'GenerateVideoThumbnailImage' that takes some input parameters about the location of the video, the size of the thumbnail to generate, and the path to save the generated thumbnail image. The code below shows using the Expression Encoder SDK to generate the thumbnail:&lt;br /&gt;&lt;pre class="brush: vbnet"&gt;Private Sub CreateVideoThumnailImage(ByVal VideoPath As String,&lt;br /&gt;                                     ByVal SecondIntervalForThumbCapture As Integer,&lt;br /&gt;                                     ByVal ThumbnailWidth As Integer,&lt;br /&gt;                                     ByVal ThumbnailHeight As Integer,&lt;br /&gt;                                     ByVal ThumbnailSavePath As String)&lt;br /&gt;&lt;br /&gt; 'Create the AudioVideoFile object which stems from the Expression Encoder SDK .dlls&lt;br /&gt; Dim avFile As New AudioVideoFile(VideoPath)&lt;br /&gt;&lt;br /&gt; 'Create a value equal to the length of the video&lt;br /&gt; Dim FileDuration As Double = avFile.Duration.TotalSeconds&lt;br /&gt; 'Set thumbnail value to second interval indicated by argument passed in:&lt;br /&gt; Dim ThumbnailLocation As Double = SecondIntervalForThumbCapture&lt;br /&gt;&lt;br /&gt; 'If the interval passed in is at a location longer than the video, then redefine an interval to the mid-point of the video. &lt;br /&gt; If ThumbnailLocation &amp;gt; FileDuration Then&lt;br /&gt;    ThumbnailLocation = (FileDuration / 2)&lt;br /&gt; End If&lt;br /&gt;&lt;br /&gt; 'Create the formatted filename to append on to the VideoFile (Format = "VideoFileName_thumb.png")&lt;br /&gt; 'Note: You can change this logic to be a passed in value or whatever you would like. This is not critical to generating the thumbnail image.&lt;br /&gt; Dim FormattedFileName As String = Path.GetFileName(VideoPath)&lt;br /&gt; 'Strip off the video file extension and add an "_thumb" and the format extension (.Png will be used) to be saved to.&lt;br /&gt; FormattedFileName = Path.GetFileNameWithoutExtension(FormattedFileName)       &lt;br /&gt; FormattedFileName += "_thumb." &amp;amp; ImageFormat.Png.ToString().ToLower()&lt;br /&gt;&lt;br /&gt; 'Create ThumbnailGenerator object to get thumbs from AudioVideoFile. Use the Width and Height arguments passed in to determine the size to Save.&lt;br /&gt; Dim ThumbnailImageGenerator As Microsoft.Expression.Encoder.ThumbnailGenerator = avFile.CreateThumbnailGenerator(New System.Drawing.Size(ThumbnailWidth, ThumbnailHeight))&lt;br /&gt; 'Create the thumbnail image based on interval set above&lt;br /&gt; Dim ThumbnailImage As Bitmap = ThumbnailImageGenerator.CreateThumbnail(TimeSpan.FromSeconds(ThumbnailLocation))&lt;br /&gt; 'Save the file to the ThumbnailSavePath argument passed in with the formatted file name (above) added:&lt;br /&gt; ThumbnailImage.Save(ThumbnailSavePath &amp;amp; FormattedFileName, ImageFormat.Png)&lt;br /&gt;&lt;br /&gt; 'Clean up&lt;br /&gt; ThumbnailImage.Dispose()&lt;br /&gt; ThumbnailImageGenerator.Dispose()&lt;br /&gt;&lt;br /&gt;End Sub&lt;/pre&gt;Here is a sample call to the above method that will output "MyVideo_thumb.png":&lt;br /&gt;&lt;pre class="brush: vbnet"&gt;'Make a call to generate a thumbnail of the video at the '10' second interval (size will be 150x150) and save it to the same directory:&lt;br /&gt;CreateVideoThumnailImage("C:\Videos\MyVideo.wmv", 10, 150, 150, "C:\Videos\")&lt;br /&gt;&lt;/pre&gt;Previously I have used the 'MediaItem' object and its 'GetThumbnail' method within the SDK to generate the thumbnail. I had success using this on Windows Server 2003 and the Encoder 2 SDK, but could *never* get it to work on Windows Server 2008 with either the Encoder 2 or Encoder 4 SDK. It works so long as the code is directly run within your application, but if you try to port it out to a service (i.e. WCF) regardless of the hosting type (IIS or Windows Service) and regardless of the user context (Administrator), the service would always throw the following exception:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;"Microsoft.Expression.Encoder.InvalidMediaFileException: File type isn't supported. ---&amp;gt; Microsoft.Expression.Encoder.UnableToAnalyzeFileException: Exception from HRESULT: 0x80040218"&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;I had a lengthy MSDN post that was never resolved and can be read about &lt;a href="http://social.expression.microsoft.com/Forums/en/encoder/thread/164b521e-f2c5-433f-9fc5-b9a077e31f3b" target="_blank"&gt;here&lt;/a&gt;, but my strong recommendation is to port any use of the 'MediaItem' object over to using a 'AudioVideoFile' object. There seemed to be some underlying caching of credentials or some other oddity with trying to load the video file into the MediaItem constructor that I could never get to work properly. However with the code above, I can successfully implement it in a WCF service hosted by IIS or as a Windows Service. Just make sure to run the app pool hosting the IIS site or Windows Service under the &lt;strong&gt;LocalSystem&lt;/strong&gt; or other Administrator account to make sure the service has the proper permissions.&lt;br /&gt;&lt;br /&gt;Lastly, you may run into issues if you try and generate a thumbnail image from a video in which your machine does not have the codec installed. For information on this, please see one of my older posts that is listed below:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://allen-conway-dotnet.blogspot.com/search/label/Expression%20Encoder" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Fixing the "File type isn't supported" Error When Working With Expression Encoder SDK&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1010272011827956670?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1010272011827956670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/11/how-to-create-thumbnail-image-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1010272011827956670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1010272011827956670'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/11/how-to-create-thumbnail-image-from.html' title='How To: Create A Thumbnail Image From A Video Using The Microsoft Expression Encoder SDK'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-4019106502053511000</id><published>2011-10-25T23:46:00.002-04:00</published><updated>2011-10-25T23:49:45.491-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Smart Phones'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='Non .NET Related'/><title type='text'>Rooting a Motorola MB502 Charm On Android 2.1 Eclair to Store Apps On SD Card</title><content type='html'>&lt;div&gt;&lt;font face="arial"&gt;Another post here outside the '.NET Realm' but I wanted to post some information to help users with the same or similar phone and issue. So I recently got a new unlocked Motorola Charm MB502 for $99 from NewEgg.com (&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16875209267" target="_blank"&gt;here&lt;/a&gt;) so I don't have to be under contract for another 2 years with AT&amp;amp;T. This was my 1st experience with an Android based phone and I quickly found out its idiosyncrasies. However overall this is a fantastic phone for its capabilities and price so I am happy with it.&lt;br /&gt;&lt;br /&gt;The phone has a miniscule 200mb or so internal memory and came with no MicroSD card. I starting going hog wild downloading all kinds of cool apps (for free of course) and in no time the phone memory was full. It was to the point where the phone would freeze and I couldn't even send or receive texts. So I had already planned to get a MicroSD Card so I got a Class 10 32GB PNY MicroSD card from NewEgg (&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820178401" target="_blank"&gt;this model&lt;/a&gt;). The card is amazing and has some crazy read/write speeds. So that's it I am all fixed right? 32GB is &lt;em&gt;plenty&lt;/em&gt; of space. WRONG!&lt;br /&gt;&lt;br /&gt;The Android 2.1 platform (codenamed Eclair and released January of 2010) only allows storing apps on the internal memory, and music and pictures can go on the external memory. Well that's a bit limiting, but there is a work around. Android 2.2 streamlines this quite a bit to a single command line statement, but on 2.1 it’s quite a bit more involved. However, everything I read for was a complete mess of steps and awfully written walk-throughs so I am mostly writing this post in case search engines pick it up to help out users of this phone or with a phone containing Android 2.1.&lt;br /&gt;&lt;br /&gt;So let’s begin with the overall steps that have to take place to allow the phone to store apps downloaded to the external SD card:&lt;br /&gt;&lt;br /&gt;1. Download the USB drivers for your phone and install them.&lt;br /&gt;2. Buy a MicroSD card&lt;br /&gt;3. Partition the MicroSD card into 2 parts using 'Mini Tool Partition'&lt;br /&gt;4. Install the MicroSD card into the device.&lt;br /&gt;5. Place the phone in 'Debug' mode when connected via USB&lt;br /&gt;6. Connect the phone to the computer via the USB cable.&lt;br /&gt;7. Root the phone with 'Super One Click'&lt;br /&gt;8. Reboot the phone&lt;br /&gt;9. Link the apps to the SD card using 'Link2SD'&lt;br /&gt;&lt;br /&gt;It’s not that difficult to accomplish (can all be done in order in &amp;lt; 30 minutes depending on partitioning size on card), but the forum posts detailing these steps are incomplete. This process was compiled by about 6-8 different sources. &lt;em&gt;&lt;font color="#ff0000"&gt;Before getting started it is important to note, that while this is not an overly difficult procedure it is probably not for you if you do not have some savvy working with computers and mobile devices. The potential exists here to completely screw up your phone and have a mess on your hands. I am just posting this 'as-is' and have no real expertise on Android phones, so advanced follow up questions for anything related here are better directed to one of the Droid forums and not here.&lt;/font&gt;&lt;/em&gt; So let's get into each step: &lt;/font&gt;&lt;br /&gt;&lt;font face="arial"&gt;&lt;/font&gt;&lt;br /&gt;&lt;font face="arial"&gt;&lt;strong&gt;&lt;font color="#3333ff"&gt;1. Download the USB drivers for your phone and install them:&lt;/font&gt;&lt;/strong&gt; You need to connect your phone to your computer and have it recognized. For the MB502 Charm, you can download the USB drivers at the following link -&amp;gt; &lt;a href="http://www.motorola.com/consumers/v/index.jsp?vgnextoid=bda09ec8009a0210VgnVCM1000008806b00aRCRD" target="_blank"&gt;Drivers for MB502&lt;/a&gt; After installing the drivers, go ahead and connect the phone to the computer and make sure it worked.&lt;br /&gt;&lt;br /&gt;&lt;font color="#3333ff"&gt;&lt;strong&gt;2. Buy a MicroSD card:&lt;/strong&gt;&lt;/font&gt; If you are only planning on installing apps and taking a few pictures then 8GB or 16Gb is &lt;em&gt;plenty&lt;/em&gt; of space. However if you plan on dropping the entire MP3 library on your phone (as I did) then go for the 32GB size. As for Class? I recommend a Class 10 card because of the 10mb/s write speeds. Nice for transferring MP3 files to the phone and reducing lag time after taking a picture when being written to the device. If just doing simple apps and no music a Class 4 or 6 should suffice. I &lt;em&gt;highly&lt;/em&gt; recommend getting a SD card adapter or something to plug in the MicroSD card via USB for partitioning &lt;em&gt;outside&lt;/em&gt; the device in Step # 3.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;font color="#3333ff"&gt;3. Partition the MicroSD card into 2 parts using 'Mini Tool Partition':&lt;/font&gt;&lt;/strong&gt; Download the 'Mini Tool Partition' (for Windows not the phone) utility to partition the MicroSD card from this here: &lt;a href="http://www.partitionwizard.com/free-partition-manager.html" target="_blank"&gt;Download Mini Tool Partition&lt;/a&gt; Once downloaded and installed, insert your SD Card adapter into a USB slot containing the MicroSD Card so it can be partitioned. The card must contain &lt;strong&gt;2&lt;/strong&gt; partitions: 1 for the main externally written files (pictures and music), and the 2nd partition is for the downloaded apps. Before partitioning make sure to copy off an data on the card (unless it's new and has nothing on it). Open up Mini Tool Partition, right click on the drive representing the card (make sure you select the right drive!!) and say 'Delete'. Now let's make our (2) partitions. The 1st should be named 'primary' and be set as a 'Primary' partition. As for the 'File System': if you have a MB502 Charm then you have to use FAT32 for both partitions. The phone does not recognize the other format types. On other Android phones you can try ext2, ext3, or ext4. It is not a limitation of the Super One Click program, but rather the individual phone. As for size, most say 500mb to 1GB is enough for the apps since they are so small. I did 25GB for my primary, and did 5GB for the apps. You can divide the partitions how you feel is needed. Below are the properties for Partition 1:&lt;br /&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/-GRzMMf3bmpg/TqbGPS9I7EI/AAAAAAAAAgY/ktRwI19Sd7Q/s1600/Partition1Primary.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 400px; DISPLAY: block; HEIGHT: 183px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5667435147180960834" border="0" alt="" src="http://2.bp.blogspot.com/-GRzMMf3bmpg/TqbGPS9I7EI/AAAAAAAAAgY/ktRwI19Sd7Q/s400/Partition1Primary.png" /&gt;&lt;/a&gt;&lt;br /&gt;Now create the 2nd partition; I named it 'Apps_Data'. It too must be created as a 'Primary' partition as displayed below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-ydOM7Z_NxFk/TqbGX_0esrI/AAAAAAAAAgk/cBrIwHTJeoo/s1600/Partition2Apps.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 400px; DISPLAY: block; HEIGHT: 158px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5667435296663188146" border="0" alt="" src="http://2.bp.blogspot.com/-ydOM7Z_NxFk/TqbGX_0esrI/AAAAAAAAAgk/cBrIwHTJeoo/s400/Partition2Apps.png" /&gt;&lt;/a&gt;&lt;br /&gt;Finally, when all selections have been made select 'Apply' in the upper-left hand corned to have the partitions made on the MicroSD card.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;font color="#3333ff"&gt;4. Install the MicroSD card into the device:&lt;/font&gt;&lt;/strong&gt; Easy enough. Take the back cover off the MB502 and install the MicroSD card. It is not a requirement but I powered off my device, inserted the card, and then turned the power back on just to do the process cleanly.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;font color="#3333ff"&gt;5. Place the phone in 'Debug' mode when connected via USB:&lt;/font&gt;&lt;/strong&gt; Consult your manual on how to do this. For the MB502 on the home screen tap the 'Menu' button (left soft key) and select 'Settings'. Scroll to and select 'Applications', select 'Development', and then turn on (check) 'USB Debugging'.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;font color="#3333ff"&gt;6. Connect the phone to the computer via the USB cable:&lt;/font&gt;&lt;/strong&gt; I usually have my phone unlocked and on when I connect via USB. Give it a few minutes and make sure Windows (or whatever OS) recognizes the device.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;font color="#3333ff"&gt;7. Root the phone with 'Super One Click':&lt;/font&gt;&lt;/strong&gt; In order for apps to eventually be placed on the MicroSD card, we need to have 'SuperUser' permissions for the Link2SD app. In order to gain this level of access we 'Root' the phone. Rooting the phone also allows you to uninstall any 'System' installed apps. I quickly learned one of the apps I downloaded installed a ton of junk as system apps, and I couldn't uninstall them...until I rooted the phone that is. The easiest way to do this is with an app named 'Super One Click' which runs on Windows (not the phone). Download the application from here: &lt;a href="http://www.shortfuse.org/" target="_blank"&gt;Download Super One Click&lt;/a&gt; Install the application and open it up in Windows. All you have to do is press the 'Root' button (displayed below). When asked if you want to install the app, I stated 'Yes' which allows SuperUser to work on the device. Once complete the device will be rooted. For a full list of phones which Super One Click works with, check out the following link: &lt;a href="http://lifehacker.com/5789397/the-always-up+to+date-guide-to-rooting-any-android-phone" target="_blank"&gt;Compatibility List for Super Once Click&lt;/a&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-66wQ25QaOhM/TqbGod2aw1I/AAAAAAAAAgw/_8TCnCyweLY/s1600/SuperOneClickRoot.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 154px; DISPLAY: block; HEIGHT: 132px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5667435579602289490" border="0" alt="" src="http://4.bp.blogspot.com/-66wQ25QaOhM/TqbGod2aw1I/AAAAAAAAAgw/_8TCnCyweLY/s400/SuperOneClickRoot.png" /&gt;&lt;/a&gt;&lt;font face="arial"&gt;&lt;br /&gt;&lt;strong&gt;&lt;font color="#3333ff"&gt;8. Reboot the phone:&lt;/font&gt;&lt;/strong&gt; If the Super One Click does not prompt for a reboot after disconnecting the USB cable, then go ahead and disconnect the USB cable after the rooting process is complete, and power off and back on the phone.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;font color="#3333ff"&gt;9. Link the apps to the SD card using 'Link2SD':&lt;/font&gt;&lt;/strong&gt; Go to the Market, and search and download 'Link2SD'. This application will allow you to manually select installed apps and move them over to the SD card. This process does &lt;em&gt;not &lt;/em&gt;happen automatically, so make sure to move apps over to the SD card after installation. Sounds like it might be a pain, but it is really easy and takes only about 5 seconds to do. Once 'Link2SD' is installed, open it up. It is going to go through a series of steps to gain 'SuperUser' access and may ask you to reboot the phone after creating some boot scripts to be used. Follow all on-screen instructions including reboot if required. These steps are only 1 time and not required after completed successfully. I think the 1st time I tried Link2SD it didn't work so I rebooted the phone and tried again and it worked, so keep this in mind. After Link2SD finishes it configuration (including reboot), you are done! Open up the Link2SD app and scroll to any app you want to move over to the SD card and select it. Scroll down to select 'Create Link', and the press 'OK'. You will see a message about Link2SD getting 'SuperUser' access and then your app will be moved to the SD card! You can also use Link2SD to uninstall those pesky spam installed system apps if this happened to you. An app is installed on the system if you see its path start with &lt;font color="#000099"&gt;/system/app/....&lt;/font&gt; Don’t uninstall important apps, but it is useful to uninstall something that was never originally wanted.&lt;br /&gt;&lt;br /&gt;That's it! If it didn't work, you probably want to go back through step by step and make sure everything worked properly. The Link2SD app is very picky about those partitions so make sure to get them right. If it is not working it might be because it does not recognize the type of partition you created. FAT32 is the safest bet and the only working one I found on the MB502 Charm. If you need more help, I recommend seeking out one of the Android User Forms where you can ask questions and get further help. ...or just fork out the money and buy a newer phone. &lt;font color="#000099"&gt;:P&lt;/font&gt;&lt;/font&gt; &lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-4019106502053511000?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/4019106502053511000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/10/rooting-motorola-mb502-charm-on-android.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4019106502053511000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4019106502053511000'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/10/rooting-motorola-mb502-charm-on-android.html' title='Rooting a Motorola MB502 Charm On Android 2.1 Eclair to Store Apps On SD Card'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-GRzMMf3bmpg/TqbGPS9I7EI/AAAAAAAAAgY/ktRwI19Sd7Q/s72-c/Partition1Primary.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-3890550923544493039</id><published>2011-10-13T21:50:00.000-04:00</published><updated>2011-10-13T21:50:11.049-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Internet Explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Specifying Document Compatibility Modes for ASP.NET Intranet Sites using IE8</title><content type='html'>&lt;div&gt;&lt;font face="arial"&gt;I noticed some oddities on the way an ASP.NET website I was working with was rendering on the &lt;strong&gt;&lt;em&gt;intranet&lt;/em&gt;&lt;/strong&gt;, but not through the Cassini development server in VS.NET 2010. This of course makes sense because the development server does not parse and render identical to IIS, but it was still puzzling.&lt;br /&gt;&lt;br /&gt;After a bit of research I found that the following setting in Internet Explorer 8: Tools -&amp;gt; Compatibility View Settings -&amp;gt; ‘Display intranet sites in Compatibility View' was checked by default. This ends up having your site render in IE7 mode and was the cause of the odd rendering in my case (i.e. entire dropdowns scrolling along with the screen, HTML header tags not sizing properly, etc.).&lt;br /&gt;&lt;br /&gt;The initial thought is just to deselect the option and allow the browser to work in IE8 standards mode. However since we are discussing 'intranet' applications, this problem would persist to all clients of the application unless a mass update was pushed out via group policy which is unlikely.&lt;br /&gt;&lt;br /&gt;The easiest fix is to set the document compatibility mode for the site in the Master Page(s) or main page of the site to the browser standard you wish to use. The post is almost outdated as soon as it was published because it is speaking about a browser that is 2.5 years old, but as many enterprises are still on IE8 because of Windows XP, this unintended switch may not be favorable to the developer. All that must be done is add the following meta tag in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&amp;lt;!-- Enable IE8 Standards mode --&amp;gt;&lt;br /&gt;&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=8" /&amp;gt;&lt;br /&gt;&lt;/pre&gt;After updating the site on the IIS server and bringing it back up in IE8, you will notice your site render properly even with the default IE8 settings to display 'intranet' sites in ‘Compatibility View’. This topic is actually much more involved than the specific piece of advice covered here, so look to the following if you need any further information.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline; color:#0000ff;"&gt;Defining Document Compatibility&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/font&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-3890550923544493039?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/3890550923544493039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/10/specifying-document-compatibility-modes.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3890550923544493039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3890550923544493039'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/10/specifying-document-compatibility-modes.html' title='Specifying Document Compatibility Modes for ASP.NET Intranet Sites using IE8'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1643299036084783097</id><published>2011-09-23T21:37:00.002-04:00</published><updated>2011-09-23T21:39:52.508-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Expression Blend'/><title type='text'>Begin StoryBoard Animation Within A DataTemplate In Silverlight</title><content type='html'>&lt;div&gt;&lt;font face="arial"&gt;Animations in Silverlight are a great way to add a dynamic feel to the aesthetics of your Silverlight page or control. Within Silverlight, using a DataTemplate to define a control’s properties and look when a control will be repeatedly used or displayed is the perfect solution. However if you add an Animation to the DataTemplate, trying to set it in motion from the code behind is not as straight forward as it initially seems.&lt;br /&gt;&lt;br /&gt;Let's say you have a simple animation and you want it to run when the 'MouseEnter' event fires. In VB.NET, the traditional thinking is to go into this event that is exposed by the created DataTemplate and call 'MyAnimationStoryboard.Begin()'. Guess what though, the app will build, run, hit the event upon having the mouse enter, but the animation will not begin. No exception is thrown, it is just nothing happens.&lt;br /&gt;&lt;br /&gt;It turns out that the StoryBoard is only locally known to the object containing it within the DataTemplate, so we must 1st access that control's resources where the storyboard exists, and &lt;em&gt;then&lt;/em&gt; we will be able to begin the animation.&lt;br /&gt;&lt;br /&gt;So here is a DataTemplate with a Grid control and a StoryBoard. The code is being kept simple because the solution for this is in the code behind.&lt;br /&gt;&lt;pre class="brush: xml"&gt;&amp;lt;DataTemplate x:Key="MyTemplate"&amp;gt;&lt;br /&gt;  &amp;lt;Grid Width="100" Height="100" &lt;br /&gt;       Opacity="0.75"&lt;br /&gt;       MouseEnter="MyGrid_MouseEnter" &amp;gt;   &lt;br /&gt; &amp;lt;Grid.Resources&amp;gt;&lt;br /&gt;  &amp;lt;Storyboard x:Name="MyTemplateAnimate"&amp;gt;&lt;br /&gt;   &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[4].(GradientStop.Offset)" &lt;br /&gt;   Storyboard.TargetName="path"&amp;gt;&lt;br /&gt;   &amp;lt;EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.296"/&amp;gt;&lt;br /&gt;   &amp;lt;EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0.384"/&amp;gt;&lt;br /&gt;   &amp;lt;EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.475"/&amp;gt;&lt;br /&gt;   &amp;lt;EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0.529"/&amp;gt;&lt;br /&gt;  &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;&lt;br /&gt;  &amp;lt;/Storyboard&amp;gt;&lt;br /&gt; &amp;lt;/Grid.Resources&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;Path x:Name="path" Data="M0,0L50,0L25,50L0,0L0,50L0,0"&amp;gt;&lt;br /&gt;  &amp;lt;Path.Fill&amp;gt;&lt;br /&gt;    &amp;lt;LinearGradientBrush EndPoint="-0.419,0.662" &lt;br /&gt;   MappingMode="RelativeToBoundingBox" &lt;br /&gt;   StartPoint="1.051,-0.137"&amp;gt;&lt;br /&gt;   &amp;lt;GradientStop Color="#FF18250A" Offset="1"/&amp;gt;&lt;br /&gt;   &amp;lt;GradientStop Color="#FF18250A"/&amp;gt;&lt;br /&gt;   &amp;lt;GradientStop Color="#FF345016" Offset="0.725"/&amp;gt;&lt;br /&gt;   &amp;lt;GradientStop Color="#FF345016" Offset="0.275"/&amp;gt;&lt;br /&gt;   &amp;lt;GradientStop Color="#FF779F4C" Offset="0.5"/&amp;gt;&lt;br /&gt;    &amp;lt;/LinearGradientBrush&amp;gt;&lt;br /&gt;   &amp;lt;/Path.Fill&amp;gt;&lt;br /&gt;  &amp;lt;/Path&amp;gt; &lt;br /&gt;&lt;br /&gt;  &amp;lt;TextBlock x:Name="TextBlock1"&amp;gt;        &lt;br /&gt;  &amp;lt;/TextBlock&amp;gt;         &lt;br /&gt; &amp;lt;/Grid&amp;gt; &lt;br /&gt;&amp;lt;/DataTemplate&amp;gt;&lt;/pre&gt;The DataTemplate &lt;em&gt;does&lt;/em&gt; expose the needed 'MouseEnter' event in the code behind but the problem is the StoryBoard is in the child 'Grid' control. Therefore we have (2) options: use the VisualTreeHelper class to find the right child control, or simple define a 'MouseEnter' event on the actual Grid control. I went for the latter option as it is the easiest.&lt;br /&gt;&lt;br /&gt;Let's add the event we declared on the Grid in the XMAL named 'MyGrid_MouseEnter' to the code behind. We need to cast the sender which is the Grid itself, and then find the StoryBoard object within the Grid's resources. Once we have acquired and casted the exact StoryBoard, then we can call the .Begin() method.&lt;br /&gt;&lt;pre class="brush: vb"&gt;Private Sub MyGrid_MouseEnter(sender As Object, e As System.Windows.Input.MouseEventArgs)&lt;br /&gt;  'Cast the sender to an object of type Grid, so we can find the StoryBoard&lt;br /&gt;  Dim MyTemplateGrid As Grid = DirectCast(sender, Grid)&lt;br /&gt;  If MyTemplateGrid IsNot Nothing Then&lt;br /&gt;    'Find the StoryBoard by name and then begin its animation sequence.&lt;br /&gt;    Dim StyBrd As Storyboard = TryCast(MyTemplateGrid.Resources("MyTemplateAnimate"), Storyboard)&lt;br /&gt;    StyBrd.Begin()&lt;br /&gt;  End If&lt;br /&gt;End Sub&lt;/pre&gt;That's it, run the Silverlight app, and the StoryBoard within the DataTemplate will now run. If the controls in this example were not exactly what you have, the principal is you need to drill down to find the containing parent object of the StoryBoard to then get access to the storyboard. If you need, you can use the VisualTreeHelper to drill down to the proper child control. If you need a sample of using this class please refer to the following link: &lt;/font&gt;&lt;a href="http://forums.silverlight.net/t/99891.aspx"&gt;&lt;font face="arial"&gt;http://forums.silverlight.net/t/99891.aspx&lt;/font&gt;&lt;/a&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1643299036084783097?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1643299036084783097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/begin-storyboard-animation-within.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1643299036084783097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1643299036084783097'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/begin-storyboard-animation-within.html' title='Begin StoryBoard Animation Within A DataTemplate In Silverlight'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-555299948723426498</id><published>2011-09-21T23:08:00.008-04:00</published><updated>2011-09-21T23:15:06.204-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bindings'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Exposing Multiple Binding Types For The Same Service Class In WCF</title><content type='html'>&lt;div&gt;&lt;font face="arial"&gt;Have you ever wanted to expose multiple binding types in WCF for the same service class? Well I have but it is not directly apparent on how to accomplish this. My thought was, “I have a single service and I want it to be consumable by both net.tcp and http bindings. Not a big deal, right?” Well in the end the code needed to make this happen is not all that complex, but getting to the solution took some work as usual.&lt;br /&gt;&lt;br /&gt;My thought process initially was to try and figure out how to make the WCF configuration allow this condition with a single service, but this method has some side effects. My 1st attempt was to create a single service with multiple endpoints and mex configurations, with each endpoint configuration having a different binding type (http and net.tcp). This &lt;em&gt;actually&lt;/em&gt; works, but comes along with a side effect which I did not care for. The problem was when a client would consume my service (either via net.tcp or https) &lt;em&gt;both&lt;/em&gt; endpoint configurations were added to the client. This isn't a huge deal, but I wanted the service configurations to deploy independently to prevent any confusion. Also if the client requests only the http binding endpoint, then that is all I want them to get; not the net.tcp configuration as well or vice versa.&lt;br /&gt;&lt;br /&gt;Next I wanted to try using (2) different service configurations within the same single WCF service. However, a WCF service class can at most be exposed once in configuration by a single service configuration. If you try and configure (2) separate services differing only in endpoint binding configuration but attempt to consume the same service class for both services, you are going to get an error. "A child element named 'service' with same key already exists at the same configuration scope. Collection elements must be unique within the same configuration scope". Simply changing the 'name' property on the service configuration is not an option, because the 'name' property represents the class that implements the service contract. Arbitrarily changing the name will break the service.&lt;br /&gt;&lt;br /&gt;The solution I came up with that solves all of these requirements is to have the single main service class that contains the implemented logic, Implement (2) additional new Interfaces that will allow distinction or uniqueness for the endpoint contract configuration. We will also add (2) new service contract classes that inherit the main service class and provide uniqueness for service class configuration. This masquerade allows making the services appear to be unique in consumption, but really point back to the same logic which was what was the original requirement.&lt;br /&gt;&lt;br /&gt;As I mentioned before I do not want to expose multiple endpoints from a single service implementing a single contract due to the unwanted side effects, but rather have multiple services &lt;em&gt;each&lt;/em&gt; with a single endpoint, implementing the same contract. To do this each service needs to be unique, but when attempting to make separate services each serve up the same service class implementing the contract, there is no uniqueness. The 'ServiceEndpointElement.Name Property' in configuration must point to a class within the service. Because we want (1) unique endpoint per service, we need a unique service class as well. The new classes Inherit from the primary Service class providing all the main service functionality, but yet provides a unique service class entry point for the ServiceEndpointElement.Name Property. Again, the reason we do not want a single service exposing multiple bindings, is because upon client consumption all (1...n) binding configurations for a single service are downloaded and configured even if the client only wanted say the 'net.tcp' binding. To reduce confusion, each service configured ultimately exposes the identical functionality but provides a separate service class value for the ServiceEndpointElement.Name Property.&lt;br /&gt;&lt;br /&gt;Let's take a look at how to implement this solution. To begin, here are the (3) main service contracts:&lt;br /&gt;&lt;pre class="brush: vbnet"&gt;&amp;lt;ServiceContract()&amp;gt;&lt;br /&gt;Public Interface IMyWcfServiceTcp&lt;br /&gt;    Inherits IMyWcfService&lt;br /&gt;&lt;br /&gt;End Interface&lt;br /&gt;&lt;br /&gt;&amp;lt;ServiceContract()&amp;gt;&lt;br /&gt;Public Interface IMyWcfServiceHttp&lt;br /&gt;    Inherits IMyWcfService&lt;br /&gt;&lt;br /&gt;End Interface&lt;br /&gt;&lt;br /&gt;&amp;lt;ServiceContract()&amp;gt;&lt;br /&gt;Public Interface IMyWcfService&lt;br /&gt;&lt;br /&gt;    &amp;lt;OperationContract(Name:="MyMethod1")&amp;gt;&lt;br /&gt;    Sub MyMethod1()&lt;br /&gt;&lt;br /&gt;    &amp;lt;OperationContract(Name:="MyMethod2")&amp;gt;&lt;br /&gt;    Sub MyMethod2()&lt;br /&gt;&lt;br /&gt;    &amp;lt;OperationContract(Name:="MyMethod3")&amp;gt;&lt;br /&gt;    Sub MyMethod3()&lt;br /&gt;&lt;br /&gt;End Interface&lt;/pre&gt;Next are the (3) classes which WCF configuration will use in the service configuration:&lt;br /&gt;&lt;pre class="brush: vbnet"&gt;Public Class MyWcfServiceTcp&lt;br /&gt;   Inherits MyWcfService&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;Public Class MyWcfServiceHttp&lt;br /&gt;   Inherits MyWcfService&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;Public Class MyWcfService&lt;br /&gt;   Implements IMyWcfServiceTcp, IMyWcfServiceHttp&lt;br /&gt;&lt;br /&gt;   Public Sub MyMethod1() Implements IMyWcfService.MyMethod1&lt;br /&gt;   End Sub&lt;br /&gt;&lt;br /&gt;   Public Sub MyMethod2() Implements IMyWcfService.MyMethod2&lt;br /&gt;   End Sub&lt;br /&gt;&lt;br /&gt;   Public Sub MyMethod3() Implements IMyWcfService.MyMethod3&lt;br /&gt;   End Sub&lt;br /&gt;&lt;br /&gt;End Class&lt;/pre&gt;And finally, here is the WCF service configuration:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&amp;lt;!--*****WCF Hosted Service Endpoints*****--&amp;gt;&lt;br /&gt;&amp;lt;services&amp;gt;&lt;br /&gt;  &amp;lt;service behaviorConfiguration="MyWcfServiceTcpBehavior" name="MyWcfServiceTcp"&amp;gt;&lt;br /&gt;    &amp;lt;endpoint address="" binding="netTcpBinding" bindingConfiguration="MyWcfServiceTcpEndpoint"&lt;br /&gt;          name="MyWcfServiceTcpEndpoint" bindingName="MyWcfServiceTcpEndpoint"&lt;br /&gt;          contract="IMyWcfServiceTcp" /&amp;gt;&lt;br /&gt;    &amp;lt;endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" /&amp;gt;&lt;br /&gt;    &amp;lt;host&amp;gt;&lt;br /&gt;      &amp;lt;baseAddresses&amp;gt;&lt;br /&gt;        &amp;lt;add baseAddress="net.tcp://localhost:8000/MyServices/MyWcfService" /&amp;gt;&lt;br /&gt;      &amp;lt;/baseAddresses&amp;gt;&lt;br /&gt;    &amp;lt;/host&amp;gt;&lt;br /&gt;  &amp;lt;/service&amp;gt;&lt;br /&gt;  &amp;lt;service behaviorConfiguration="MyWcfServiceHttpBehavior" name="MyWcfServiceHttp"&amp;gt;&lt;br /&gt;    &amp;lt;endpoint address="" binding="wsHttpBinding" bindingConfiguration="MyWcfServiceHttpEndpoint"&lt;br /&gt;          name="MyWcfServiceHttpEndpoint" bindingName="MyWcfServiceHttpEndpoint"&lt;br /&gt;          contract="IMyWcfServiceHttp" /&amp;gt;&lt;br /&gt;    &amp;lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&amp;gt;&lt;br /&gt;    &amp;lt;host&amp;gt;&lt;br /&gt;      &amp;lt;baseAddresses&amp;gt;&lt;br /&gt;        &amp;lt;add baseAddress="http://localhost:8001/MyServices/MyWcfService" /&amp;gt;&lt;br /&gt;      &amp;lt;/baseAddresses&amp;gt;&lt;br /&gt;    &amp;lt;/host&amp;gt;&lt;br /&gt;  &amp;lt;/service&amp;gt;&lt;br /&gt;&amp;lt;/services&amp;gt;&lt;/pre&gt;Notice how each service configuration points to its own class, and each endpoint points to its own individual contract. However we know under the covers, both services expose the identical functionality. The difference: choice of binding type, and ability to only get the single binding's configuration added to the client (not both types) upon consumption.&lt;br /&gt;&lt;br /&gt;Take note - if having your client getting multiple binding configurations for requesting a single endpoint does not bother you then procedure is not needed. Just define a single service with multiple endpoint configurations and multiple mex endpoints and you are done. However, if exposing your service with multiple binding types and having the client only receive the single endpoints configuration is important, then this should help fulfill the requirement. &lt;/font&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-555299948723426498?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/555299948723426498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/exposing-multiple-binding-types-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/555299948723426498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/555299948723426498'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/exposing-multiple-binding-types-for.html' title='Exposing Multiple Binding Types For The Same Service Class In WCF'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-6388723708824901448</id><published>2011-09-16T22:31:00.001-04:00</published><updated>2011-09-16T22:38:00.631-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Metro Apps'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 8'/><category scheme='http://www.blogger.com/atom/ns#' term='Conference'/><title type='text'>My Initial Thoughts on Windows 8 And The Build Windows Conference</title><content type='html'>&lt;div&gt;&lt;font face="arial"&gt;If you are a developer of any type and have interest in any type of Windows based development then you probably knew the &lt;font color="#009900"&gt;'&lt;/font&gt;&lt;a href="http://www.buildwindows.com/"&gt;&lt;strong&gt;&lt;font color="#009900"&gt;Build Windows&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;font color="#009900"&gt;'&lt;/font&gt; event was taking place in Anaheim, CA this past week from Sep.13-16. I was not in attendance, but like hundreds of thousands of other developers I tapped into the site which almost with perfection streamed the keynotes and Channel 9 video via a Silverlight player. Wait! Silverlight and not a HTML5 video player!! I thought SL was dead to Microsoft (says the peanut gallery and technical blogs). Nope, and it was a nice touch to show how Silverlight works so well.&lt;br /&gt;&lt;br /&gt;I have not had a chance to watch all of the archived video, but I had it playing in the background often this past week to try and pick up a tid bit here and there. It is obvious to me that Windows 8 is the 1st revolutionary mind bender that we have to a user’s interaction, application development, and from a OS perspective in quite some time. Phrases and words like 'Metro Apps', 'Fast and Fluid', 'Touch First', and 'WinRT' were used time and time again. Windows 8 takes a 'Touch First' approach and is no surprise to me at all. With the onslaught of tablet and touch technology we have seen in the last 4-5 years and especially from front runner Apple with the iPad, iPhone, and iTouch products, it is apparent to me that Microsoft is firing back on the offensive to get in and hopefully dominate the market share in this new technology age.&lt;br /&gt;&lt;br /&gt;Think about it - the way the Build conference and mainstream technology presents technology today, you would feel that the mouse, keyboard, desktop and laptop PC might be dead! Not necessarily, but the days of the classic 'Start' button OS, static desktop, mouse and keyboard environment may be numbered. We have the mobile and tablet world to thank for this (in a good way I think).&lt;br /&gt;&lt;br /&gt;Windows 8 appears to have taken a lot of the good features from Windows Phone 7 and incorporated them into the OS. If you have seen or used a Windows Phone 7 device, then you will be comfortable with viewing Windows 8. This style of application development deemed 'Metro Apps' are the applications that run on the forefront of Windows 8. This appears to be Microsoft's approach to help make any type of developer have the potential to be marketable by selling apps in the ‘Windows Marketplace’. I heard numerous times from presenters about how Microsoft wants the developer to make money and come up with the new 'Angry Birds'. They are pushing us to be Windows Developers of Metro style apps on Windows 8 probably for a few reasons: they hope we will get excited about coming up with an app to sell and make money, and in the meantime we have the hook in deep to Microsoft technologies. I don't really have any issue with this at all. Microsoft is a business and they are positioning themselves to be profitable and current or even better 'leading' the industry and right now touch, tablets, smart phones, mobile, and cloud development and applications reign supreme. The only thing I am thinking about is don't forget the professional developer doing Enterprise Development.&lt;br /&gt;&lt;br /&gt;Don't get me wrong, Metro apps look cool and will probably be a great success. Metro apps were mentioned to not be a 'one-size-fits-all' solution, but yet still seemed to be touted as the future of application development on Windows. Mainstream large applications seemed to be mentioned or represented as a footnote to Metro apps. Well I have to say not everything reasonable in software development can be crammed into a social networking twitter app, a silly (but clever) Angry Birds game, or a grocery shopping list app-let. Some presentations nowadays makes it seem like the only apps used are Twitter, Facebook, Email, and the Internet and everything else is a second class citizen. I may have to modify this post in a few years, but I don't think automating complex business rules can be simplified into the touch of a finger and a Metro style app. I know Microsoft knows this, and so did all of the other developers that were in attendance. However I want to make sure that Microsoft continues to push hard as they have been in the last 10 years with technologies in .NET to create solutions for large Enterprise applications that solve complex business solutions. A Facebook and Twitter stream combo Metro app and a cloud syncing picture app are not going to drive the business. But they will excite 16 year old kids that will buy a Windows 8 tablet and buy lots of little stuff like this from the Marketplace. Microsoft is smart for recognizing this and positioning themselves to make money. They guys like me that develop in .NET for a living off a license purchased every few years is probably only enough $ to keep the lights on in Redmond. Therefore I say I understand everything Microsoft is doing and the direction they are going, I just hope they continue to be just as strong with .NET moving forward as they have been in the past.&lt;br /&gt;&lt;br /&gt;There were some strong .NET presentations given on Channel 9 and by people like Scott Guthrie which got me really excited about moving forward. These are the pioneers of the .NET Framework and continue to move it forward at Microsoft. I look forward to the Async Framework in .NET 4.5 and they also mentioned some language specific enhancements like VB.NET getting Iterators like C# has had since .NET 3.5. I don't want the flavor of this post to make it sound like Microsoft is trying to box us into being Windows developers only making Metro apps, but it was hard not to think like this at times based on the content I watched. The Channel 9 content kept me breathing easy and feeling like the 10 million of us that are profession developers out of 100 million estimated developers worldwide (Steve Ballmer's numbers) still have a strong presence in Microsoft. However I do not blame Microsoft trying to cater and market stronger to the 90 million non-professional developers that will be making Metro style apps trying to come up with the next dynamic weather app or Angry Birds game. It is the smart thing to do from a business perspective as opposed to standing up on stage going on and on about the Async framework or other .NET enhancement that is catering to the 10 million professional developers.&lt;br /&gt;&lt;br /&gt;To sum up the conference from my viewpoint (and again, I was &lt;em&gt;not&lt;/em&gt; there so I didn't get the full content), I am excited for Visual Studio 11, .NET Framework 4.5, Windows 8, and touch first technology. Although I still get the feeling that everything they &lt;em&gt;said&lt;/em&gt; at the conference makes sense, but it does not make sense for everybody. Grasp that? Regardless I look forward to Windows 8 and the future.&lt;br /&gt;&lt;br /&gt;For developers interested in the new WinRT APIs in Windows 8, have a look at the following article which describes it best I have seen thus far:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://tirania.org/blog/archive/2011/Sep-15.html" target="_blank"&gt;&lt;font style="TEXT-DECORATION: underline" color="#0000ff"&gt;WinRT demystified&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-6388723708824901448?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/6388723708824901448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/my-initial-thoughts-on-windows-8-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6388723708824901448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6388723708824901448'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/my-initial-thoughts-on-windows-8-and.html' title='My Initial Thoughts on Windows 8 And The Build Windows Conference'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-2036470028749170689</id><published>2011-09-14T22:38:00.005-04:00</published><updated>2011-09-14T22:43:06.755-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TSQL'/><title type='text'>Finding Duplicate Rows Using TSQL</title><content type='html'>&lt;span style="font-family:arial;"&gt;Ok so here is a tired old post that has been blogged about since the internet’s inception, right? Well sort of... I am not going to yammer on here too much about a topic that is covered exhaustively on technical blogs like mine, nor do I claim to be a 'SQL Guru' of any sorts, but I noticed a lot of the sites offering help on this topic always did so for a very basic and simple example. Well I too am going to use a simple example but expand on its usefulness to hopefully help out a few wondering the search engines in need of help. Your typical 'find duplicate rows in a table by ID' example is shown below:&lt;br /&gt;&lt;pre class="brush: sql"&gt;&lt;br /&gt;SELECT ID&lt;br /&gt;FROM Books&lt;br /&gt;GROUP BY ID&lt;br /&gt;HAVING COUNT(ID) &amp;gt; 1&lt;/pre&gt;Another example using a varchar column:&lt;br /&gt;&lt;pre class="brush: sql"&gt;&lt;br /&gt;SELECT Title&lt;br /&gt;FROM Books&lt;br /&gt;GROUP BY Title&lt;br /&gt;HAVING COUNT(Title) &amp;gt; 1&lt;/pre&gt;Ok the above is great for small tables, to manually track down records, or maybe as part of a larger query or subquery. However odds are you are going to need additional columns of data and probably the actual duplicate rows themselves. Well initial thought might be to expand the simple example query above to include the additional fields, but you will quickly find out that the query will yield no results. This is because the query above groups on the columns in question having a count greater than 1. Well if you add additional columns to the query that do not contain duplicates, then this condition is no longer 'True' and thus no results are returned.&lt;br /&gt;&lt;br /&gt;The fix is to Join in another copy of the same table. One table's purpose is to focus on the duplicate rows, and the second table's purpose is to focus on the additional columns needed in the results. When joining on the same table an Alias must be given to distinguish between the two. Here is the expanded example from above, that will return all of the *actual* duplicate rows, and any additional information that was sought:&lt;br /&gt;&lt;pre class="brush: sql"&gt;&lt;br /&gt;SELECT bAll.ID, bAll.PublishDate, bAll.Title, bAll.Price&lt;br /&gt;FROM Books bAll&lt;br /&gt;INNER JOIN (SELECT Title&lt;br /&gt;     FROM Books&lt;br /&gt;     GROUP BY Title&lt;br /&gt;     HAVING COUNT(Title) &amp;gt; 1) bDups&lt;br /&gt;       ON bAll.Title = bDups.Title&lt;br /&gt;ORDER BY bAll.Title&lt;/pre&gt;Lastly, here is a template of the above query that you might want to keep handy as sort of a 'fill-in-the-blanks' template (remove brackets - they are just placeholders and not required syntax) for your own 'finding duplicate rows' needs:&lt;br /&gt;&lt;pre class="brush: sql"&gt;&lt;br /&gt;SELECT [AliasAllTable].[Field1], [AliasAllTable].[Field2], [AliasAllTable].[Field3]&lt;br /&gt;FROM [MainTable] [AliasMainTable]&lt;br /&gt;INNER JOIN (SELECT [DuplicateFieldName]&lt;br /&gt;     FROM [MainTable]&lt;br /&gt;     GROUP BY [DuplicateFieldName]&lt;br /&gt;     HAVING COUNT([DuplicateFieldName]) &amp;gt; 1) [AliasDuplicateTable]&lt;br /&gt;       ON [AliasAllTable].[DuplicateFieldName] = [AliasDuplicateTable].[DuplicateFieldName]&lt;br /&gt;ORDER BY [AliasAllTable].[DuplicateFieldName]&lt;/pre&gt;I welcome any SQL experts to comment on streamlined ways to accomplish the identical task; I can certainly update the post with additional information. However with the plethora of examples available, too many seemed to be of the basic flavor example and I wanted to introduce the additional functionality that is probably often sought after.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-2036470028749170689?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/2036470028749170689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/finding-duplicate-rows-using-tsql.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2036470028749170689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2036470028749170689'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/finding-duplicate-rows-using-tsql.html' title='Finding Duplicate Rows Using TSQL'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-2186327655474690199</id><published>2011-09-11T22:51:00.008-04:00</published><updated>2011-09-14T22:54:03.395-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='History'/><title type='text'>9/11 - 10 Years Later</title><content type='html'>&lt;span style="font-family:arial;"&gt;Traditionally I do not write about anything on my blog outside the realm of programming, but the 10th Anniversary of the tragedy that occurred on September 11th, 2001 is certainly worth mentioning and reflecting upon.&lt;br /&gt;&lt;br /&gt;To most of us concerned with reading this blog, we are of an age where we probably remember exactly what we were doing and where we were 10 years ago today. At the time I was living in Charlotte, NC where I was in my last semester at U.N.C. Charlotte and preparing for a large job fair on campus. It was also exactly 1 month after my wedding which was celebrated in Puerto Rico with my wife's and my family on August 11, 2001, and also in which we also just celebrated our 10 year wedding Anniversary last month. It was a new and transitioning period in my life. At the time I was vying for my 1st job and it was right after the ".com bust" and programming jobs were few and far between. We had companies like Alltel come to campus and have 200 people show up to a brief announcement, for only 2 open positions. I was dressed to the nines and headed to Kinkos to make copies of my resume for the job fair. My wife called me and with a bit of confusion told me, "Some hotels in New York City had been blown up...", but I wasn't really sure what she was talking about. When I arrived at Kinkos I knew something even bigger was occurring when I read a sign on the door that said: &lt;em&gt;"We are closing at noon due to the recent events."&lt;/em&gt; I went back to my apartment and turned on the TV as was everyone else. The rest is a sad part in our nations history.&lt;br /&gt;&lt;br /&gt;I read the tributes made in our local paper today and it was shocking and eye-opening to once again see the names of all of the people that lost their lives on 9/11. It was a bit jaw dropping when looking at what was about a 5 point font used to fit all of the names in on roughly 3 pages. I remember it was about 3,000 people, but seeing it in print was a reminder of what happened on that tragic day. Of course this does not include all of the men and women of our military who have made the ultimate sacrifice since in the wars abroad.&lt;br /&gt;&lt;br /&gt;Once such individual that continues to serve and is in Afghanistan as of this writing is my brother-in-law Captain Brain Huysman who is the Company Commander of Weapons Company: 1st Battalion, 5th Marines (&lt;a href="http://www.i-mef.usmc.mil/external/1stmardiv/5thmarregt/1-5/subunits/subunits.jsp"&gt;http://www.i-mef.usmc.mil/external/1stmardiv/5thmarregt/1-5/subunits/subunits.jsp&lt;/a&gt;). On this day and every day I salute you Brian and all that serve in our military that continue to protect our nation. Thank you.&lt;br /&gt;&lt;br /&gt;So on this 10th Anniversary, I reflect on something that changed our nation forever and I too will "Never Forget."&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-2186327655474690199?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/2186327655474690199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/911-10-years-later.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2186327655474690199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2186327655474690199'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/911-10-years-later.html' title='9/11 - 10 Years Later'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1657659769098912768</id><published>2011-09-06T23:54:00.002-04:00</published><updated>2011-09-07T16:01:11.968-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Training'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>September MSDN Webcast Training For Newbie ASP.NET Developers</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you are just getting into .NET and specifically ASP.NET, then the following (2) MSDN Webcasts would be worth attending. They are free, so search and check the site often for other topics that interest you as well. The (2) below are level 200 webcasts that are geared for new ASP.NET developers.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032493558&amp;amp;culture=en-US" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;font-size:85%;color:#0000ff;"  &gt;MSDN Webcast: ASP.NET 4.0 Soup to Nuts (Part 1): Introduction to ASP.NET (Level 200)&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032493561&amp;amp;culture=en-US" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;MSDN Webcast: ASP.NET 4.0 Soup to Nuts (Part 2): Website Basics (Level 200)&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1657659769098912768?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1657659769098912768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/september-msdn-webcast-training-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1657659769098912768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1657659769098912768'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/09/september-msdn-webcast-training-for.html' title='September MSDN Webcast Training For Newbie ASP.NET Developers'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-8070887481873695741</id><published>2011-08-31T23:17:00.005-04:00</published><updated>2011-09-01T17:35:54.807-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>Help! My ASP.NET page is generating a JavaScript "Object Expected" Error Now That I Am Using jQuery, Plus A Little On URLs In ASP.NET</title><content type='html'>&lt;span style="font-family:arial;"&gt;So you are all excited and just got into this jQuery thing! You build your code, run the ASP.NET site, and IT IS SO Cool...wait. You look down and see a JavaScript error in the status bar of the browser indicating the following:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;strong&gt;"Object Expected"&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Well let's begin by stating this is about a generic error message as they come and there could be 1 million different reasons for it. However if you just got into writing jQuery and are running into this error, then odds are you have not properly referenced the jQuery scripts for your application to use. I hope at least you know there are scripts that must be incuded. If you are thinking "No I didn't know", then you need to go back to jQuery 101 videos on setup.&lt;br /&gt;&lt;br /&gt;However getting the scripts properly added to your ASP.NET application does have some nuances which make it easy to mess them up. The most common pitfall is if you have a ASP.NET site that uses a MasterPage. If this is the case, then your content pages are probably not adding the scripts individually, and the most appropriate place to register them in in the MasterPage's &amp;lt;Head&amp;gt; block.&lt;br /&gt;&lt;br /&gt;You have (2) main options for referencing the jQuery scripts: download the scripts and include them with your project or from a CDN (Content Delivery Network) (i.e. Google or Microsoft). The upside to using a CDN is you do not have to worry about downloading the scripts into a folder and then finding that &lt;em&gt;perfect&lt;/em&gt; path in the MasterPage to reference them. The downside is if you were working in an Intranet environment and outside access was limited or denied, then you would not be able to dynamically access those scripts.&lt;br /&gt;&lt;br /&gt;Regardless, the 1st step in seeing if the original error described above is caused by improperly added scripts, let's go ahead and reference the jQuery scripts from Microsoft's CDN like displayed below:&lt;br /&gt;&lt;/span&gt;&lt;pre class="brush: xml"&gt;&amp;lt;script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;If using the script reference from the CDN above fixed the issue then great! If you want, you can leave it like that and be done. If you still want to download the scripts and have them within your project to be referenced, then we have to dig a bit deeper as to the referenced path you use for the scripts.&lt;br /&gt;&lt;br /&gt;Odds are your jQuery scripts are in a folder named 'Scripts', your pages in another folder named 'Pages' and maybe you have multiple levels of organizing your code files making it difficult sometimes for the proper path to be resolved. One of the BIGGEST pitfalls I see is using the Intellisense dialog when pressing the "=" sign after 'src' in a tag and navigating to the files/scripts manually. Well you would think VS.NET would give you the proper path, correct? Not always. In fact it will use a dot-dot notation (../Path/File) which seems proper, but at runtime does not resolve correctly.&lt;br /&gt;&lt;br /&gt;In VS.NET there are going to be a few ways you can reference a path to a file and this is where things get confusing sometimes. Let's look at the (4) main ways to reference a path from the page's source:&lt;br /&gt;&lt;br /&gt;(1.) use a relative path: using a series of backslashes "\" you can provide a path in reference or relative to your current location.&lt;br /&gt;&lt;/span&gt;&lt;pre class="brush: xml"&gt;&amp;lt;script src="/Scripts/jquery-1.4.4.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;(2.) 'dot-dot' notation: this indicates, "Navigate up to the parent directory" from the path provided.&lt;br /&gt;&lt;/span&gt;&lt;pre class="brush: xml"&gt;&amp;lt;script src="../Scripts/jquery-1.4.4.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;(3.) tilde (~) character: this represents the root directory of the application in ASP.NET. The caveat is it can only be used in conjunction with server controls *not* script tags (without some server-side code help shown below). This method is not going to work well by default.&lt;br /&gt;&lt;/span&gt;&lt;pre class="brush: xml"&gt;&amp;lt;script src="~/Scripts/jquery-1.4.4.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;(4.) ResolveURL (System.Web.UI) method: This is a server-side command to convert a URL into one that is usable on the requesting client. Notice the use of the server-side code escape tags so this method can be called. This is the method I prefer and dynamically resolves the URL to the proper path. I recommend using it if you are going to reference local project script files.&lt;br /&gt;&lt;/span&gt;&lt;pre class="brush: xml"&gt;&amp;lt;script src='&amp;lt;%# ResolveUrl("~/Scripts/jquery-1.4.4.min.js") %&amp;gt;' type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;My recommendation is to either reference the scripts from a reputable CDN like Google or Microsoft, or use Option # 3 above with the 'ResolveUrl' method. This will ensure your custom JavaScript and jQuery files are properly registered with your ASP.NET application.&lt;br /&gt;&lt;br /&gt;There are some good resources for explaining how to resolve path's in MasterPages and in traditional pages. Below I have included some links if you would like to investigate further or bookmark for reference.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://weblogs.asp.net/fmarguerie/archive/2004/05/05/avoiding-problems-with-relative-and-absolute-urls-in-asp-net.aspx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Avoiding problems with relative and absolute URLs in ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.asp.net/master-pages/tutorials/urls-in-master-pages-vb" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;URLs in Master Pages&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.baseadmn%2Fdoc%2Fbaseadmndita%2Fdir_pathnames.htm" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Directory path names&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.asp.net/ajaxlibrary/cdn.ashx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Microsoft Ajax Content Delivery Network &lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-8070887481873695741?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/8070887481873695741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/08/help-my-aspnet-page-is-generating.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8070887481873695741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8070887481873695741'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/08/help-my-aspnet-page-is-generating.html' title='Help! My ASP.NET page is generating a JavaScript &quot;Object Expected&quot; Error Now That I Am Using jQuery, Plus A Little On URLs In ASP.NET'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1503974559213762947</id><published>2011-08-24T23:45:00.007-04:00</published><updated>2011-08-24T23:59:29.717-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Asynchronous Programming'/><title type='text'>Asynchronous Programming In .NET Is No Longer 'The Big Bad Ugly'</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Let's face it, the word 'Asynchronous' still conjures up thoughts of low-level multithreading challenges and words like 'mutex' and 'deadlocked' for those of us that have been developing long before the world of .NET and even early on in the day's of .NETs inception. However, no longer should this fear or concern be so prevalent like it was in years past.&lt;br /&gt;&lt;br /&gt;Why? Well the good folks in Redmond have added so many layers of abstractions atop of the System.Threading namespace and on Asynchronous programming techniques in general, that the developer no longer needs to know how every gear under the hood works anymore. These abstractions of Asynchronous processing have evolved in many different forms including but not limited to 'Asynchronous Delegates' (Framework 1.1), 'Background Workers' &lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;(Framework 2.0)&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;, 'Asynchronous Lambdas' &lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;(Framework 3.0 C#)&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;, 'PLINQ' &lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;(Framework 3.5)&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;, 'TPL' &lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;(Framework 3.5)&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;, and now the 'Async Framework' (CTP).  All of these abstractions have a similar theme: allow the developer to quickly and efficiently create processes that execute concurrently with typically less code and a smaller chance for failure caused by improper coding that could occur when manually spawning threads attempting to achieve the same outcome. What's the result? The same one that a race car driver has when he steps into a car he didn't build himself: he doesn't need to know every detail of how the engine or car was built, but just how to drive it and finish 1st! Now it's not to say that basic or even mid-level knowledge of how these asynchronous processing abstractions (as I like to call them) are not required. In fact, if you go beyond just scratching the surface of simple asynchronous programming, the knowledge is important on how to proceed to more advanced topics and methods available. However, this still is far from the requirement of understanding everything about spawning and managing your own system threads.&lt;br /&gt;&lt;br /&gt;One of the main draws to harnessing the potential of asynchronous processing now more than ever is the advancement in hardware that has occurred in the last 5 years. You might still have a dinosaur PC at home with a single core CPU, but odds are you have 2,4,6, or even 8 cores on your newest machine (like the 8 I have on mine, thank you Intel I7 -&amp;gt; read here: &lt;/span&gt;&lt;a href="http://allen-conway-dotnet.blogspot.com/2011/06/my-new-computer-developers-dream.html" target="_blank"&gt;&lt;span class="Apple-style-span"  style="color:#0000ff;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;My New Computer: A Developers Dream&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;) and have bandwidth to spread processing out among available cores. This basic knowledge of the number of cores or threads available in your environment where the application will be run, can help you decide on which technique to use or if the processing time will actually be reduced. However it is most likely that your environment has at least a dual-core CPU and bandwidth available to run some processing asynchronously. The end result will be you can look like a hero in a few lines of code by running long running or redundant tasks concurrently with a relatively small understanding of all of the true complexities involved in multithreading and asynchronous processing.&lt;br /&gt;&lt;br /&gt;So for now, I will leave this discussion here and going forward will have several posts aimed to introduce or familiarize you with using some of these asynchronous programming techniques available. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1503974559213762947?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1503974559213762947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/08/asynchronous-programming-in-net-is-no.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1503974559213762947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1503974559213762947'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/08/asynchronous-programming-in-net-is-no.html' title='Asynchronous Programming In .NET Is No Longer &apos;The Big Bad Ugly&apos;'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-6786711648109391650</id><published>2011-07-22T22:09:00.005-04:00</published><updated>2011-07-22T22:17:09.523-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Training'/><category scheme='http://www.blogger.com/atom/ns#' term='VSLive'/><title type='text'>Visual Studio Live! is coming back to the Microsoft Redmond Campus, October 17-21</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;5 days of practical and immediately-applicable training for developers, programmers, software engineers and architects in Visual Studio, Silverlight, WPF, .NET and more. And it all takes place on the Microsoft Campus in Redmond, October 17-21! Check it out at: &lt;/span&gt;&lt;strong&gt;&lt;a href="http://tinyurl.com/3bn4by9"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;http://tinyurl.com/3bn4by9&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/strong&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;If you are a .NET Developer I &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;highly &lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;recommend any of the VSLive! conferences, and where better to be then in Redmond with the gang from Microsoft.&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://vslive.com/events/redmond-2011/home.aspx" target="_blank" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 220px;" src="http://1.bp.blogspot.com/--XhPgDszZus/TiouXlL2jVI/AAAAAAAAAe0/AiOeqLwrkxc/s400/VSLiveRedmond.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5632365266633919826" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-6786711648109391650?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/6786711648109391650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/07/visual-studio-live-is-coming-back-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6786711648109391650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6786711648109391650'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/07/visual-studio-live-is-coming-back-to.html' title='Visual Studio Live! is coming back to the Microsoft Redmond Campus, October 17-21'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/--XhPgDszZus/TiouXlL2jVI/AAAAAAAAAe0/AiOeqLwrkxc/s72-c/VSLiveRedmond.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7981190443120904175</id><published>2011-07-22T21:46:00.004-04:00</published><updated>2011-07-22T21:52:05.676-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSDN'/><title type='text'>Get the MSDN Magazine for a Reduced Price</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;I am not sure how long this promotion will last, but check out the link below to subscribe to the MSDN magazine at a reduced 20% off price:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://download.1105media.com/MSDN/MSDNV2LP.html" target="_blank"&gt;&lt;span class="Apple-style-span"  style="color:#0000ff;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;MSDN magazine at 20% reduced price&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;If you have a MSDN subscription, then you already qualify to get the magazine. Just log onto your MSDN account and fill out the required information to get the magazine as part of your paid MSDN subscription.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7981190443120904175?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7981190443120904175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/07/get-msdn-magazine-for-reduced-price.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7981190443120904175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7981190443120904175'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/07/get-msdn-magazine-for-reduced-price.html' title='Get the MSDN Magazine for a Reduced Price'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-4237248179910739538</id><published>2011-07-13T23:40:00.002-04:00</published><updated>2011-07-13T23:43:30.572-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><title type='text'>Debugging Code Techniques In VS.NET 2010</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;OK so you have a problem in code either during development, testing, or production and do not know exactly how it is occurring. What do you do? For those of you that are thinking your code does not have problems or there should never be problems in the 1st place, please click &lt;/span&gt;&lt;a href="http://lmgtfy.com/?q=Developers+Ego" target="_blank"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;TEXT-DECORATION: underline;color:#0000ff;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;. For the rest of us in the real world, you might be thinking about a new tool like 'Intellitrace' to track down exactly when the error occurred. But not everyone has that environment created and even with using it, you still need to figure out *why* it occurred. How do we do this... DEBUG the code!&lt;br /&gt;&lt;br /&gt;So now a lot reading this might think, "Well yeah I know all about debugging, simple stuff." That may be all and true but it surprises me how many developers out there based on questions I see asked a lot from an array of environments only know (2) buttons on the keyboard when it comes to debugging: [F10] and [F11] (Step Over &amp;amp; Step Into with default key mapping). Oh yeah and [F5], Start!&lt;br /&gt;&lt;br /&gt;To be good at debugging and playing detective to track down problems or anomalies that cause problems, Microsoft has provided us with a plethora of debugging options within VS.NET. Most of the techniques have been around for multiple versions of VS.NET and *some* of the techniques still not known by a faction of developers stretches all the way back to the old VB Visual Studio IDE.&lt;br /&gt;&lt;br /&gt;So let's review the (3) most basic debugging techniques: Step Into [F11], Step Through [F10], and Step Out [Shift + F11]. Step Into [F10] will execute each line of code, going into any method, property, etc. call. This is the most granular way to trace each line of code. Step Through [F10] will *not* go into code that makes up a property, method, etc. and rather execute that code completely without executing line by line, returning control to the developer to debug the next immediate line of code after execution has completed. The last one I mentioned, 'Step Out' [F11] is one I find under used even though this is functionality that stretches back to VBA and VB6 (ever watch someone hold down the F10 key or press it like they are tapping on a snare drum to exit out of a method?). What this does is allow the developer debugging to exit out of the method immediately allowing control to be passed back to the next line of code &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;after&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; the calling code to the current method was made, but still completes execution of the current method, property, etc.. This works well for the following example - let's say you have a method you are debugging and it is 50 lines of code. You need to understand what is happening between lines 5-10 and the rest is not important for what you need to know. What you would do is press [F11] to step into the method to debug and gather the information needed, but once you were finished observing lines 5-10 you want to return execution back to the caller but yet finish execution of the current method. You can do this by 'Stepping Out' of the routine by pressing [Shift + F11]. A lot better than placing a break point the line after the caller and pressing [F5] or trying to press [F10] another 30x to finish the method.&lt;br /&gt;&lt;br /&gt;This really so far is super basic stuff and hopefully a bore or quick review to any intermediate or seasoned developer. But you know as well as I that the hard to track down issues, 'anomalies' happen all too often and there are a lot of other ways to debug and track down issues. One way I discussed previously is by using conditional breakpoints which I talked about in the following post: &lt;/span&gt;&lt;a href="http://allen-conway-dotnet.blogspot.com/2009/09/how-to-set-conditional-breakpoint-in.html" target="_blank"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;TEXT-DECORATION: underline;color:#0000ff;"&gt;How to: Set a conditional breakpoint in VS.NET&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; Ever press [F5] over and over hovering over a single variable value until the last name is 'Smith' or the value is 'x'? Well setting conditions on breakpoints to only stop execution when that condition is = True is well worth reviewing.&lt;br /&gt;&lt;br /&gt;There are also several 'helper' tools that go along with debugging to help make the debugging process more efficient. So let's begin with a few tools to help with debugging. The 1st is 'Debug Labels'. Labels on debug points are useful to define descriptions or add attributes to help with individual breakpoints to provide information about it. This will carry over and be quite useful when exporting breakpoints as I will show next. So to begin, bring up the breakpoints window. The easiest way to do this is to press [Ctrl] + [Alt] + [B] on the keyboard. The window below shows this:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/-N2djVgiGZd8/Th5Xg1WOxRI/AAAAAAAAAbA/vg7B0sBNHH4/s1600/BreakpointsWindow.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 105px;" src="http://2.bp.blogspot.com/-N2djVgiGZd8/Th5Xg1WOxRI/AAAAAAAAAbA/vg7B0sBNHH4/s400/BreakpointsWindow.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629032805847450898" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;The Windows shows all active breakpoints and provides several sorting options and customizable features for breakpoints directly in the window. I will not go through them all here, so take a look and explore yourself. One &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;very&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; important feature to take note of in this window, is that any action you select to preform on the breakpoints will only be carried out on the actively displayed breakpoints as a result of any searches you have made. So If you have 10 total breakpoints, and preform a search that reduces the list down to 3 breakpoints, only those 3 in the search results will be acted upon. To clear any search criteria, press the 'X' to the right of the 'In Column' selection list.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-BNr7LT9ISEk/Th5g_5UH7fI/AAAAAAAAAcY/-cck3Wauc3g/s1600/SampleCode.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 263px; height: 96px;" src="http://3.bp.blogspot.com/-BNr7LT9ISEk/Th5g_5UH7fI/AAAAAAAAAcY/-cck3Wauc3g/s400/SampleCode.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629043235092950514" /&gt;&lt;/a&gt;&lt;br /&gt;In the block of code above I have set (2) breakpoints and notice they both display down in the Breakpoint Window displayed previously. What I want to do is create a label and assign it to this breakpoint. There are (2) ways to do this: either right click the breakpoint in the code editor or in the Breakpoint Window to bring up its options Window and select '&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Edit Labels...&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;'&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/-QWr1Tj9J3VU/Th5X7RKV0oI/AAAAAAAAAbI/netxgitp0fY/s1600/EditBreakpointLabels.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 260px; height: 231px;" src="http://3.bp.blogspot.com/-QWr1Tj9J3VU/Th5X7RKV0oI/AAAAAAAAAbI/netxgitp0fY/s400/EditBreakpointLabels.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629033259990372994" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;To add a label, type in a description or attribute, and press 'Add' as shown below. There is a 64 character limit, and you can not have commas. You can add as many label descriptions through the window at a given time, and assign as many labels as you want signified by the checkbox(s) selected to the left of the requested label(s). These labels &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;will&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; be available for assignment to other breakpoints as well:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/-zG5mTp-Swsw/Th5ZUUH5mMI/AAAAAAAAAbQ/5YA7b_zP_I4/s1600/EditBreakpointLabelsBox.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 328px; height: 306px;" src="http://3.bp.blogspot.com/-zG5mTp-Swsw/Th5ZUUH5mMI/AAAAAAAAAbQ/5YA7b_zP_I4/s400/EditBreakpointLabelsBox.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629034789793798338" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;Once a label is created it can be assigned to 1..n breakpoints. Maybe you have a set of breakpoints that are similar and all need the same label. Another possibility is you have some sort of numeric order description. In this case the sorting ability in the Breakpoint Window is nice. Just sort the column to get the label description in order. This can help with a set of imported breakpoints or for walking through your own defined breakpoints. From this window you can search through the breakpoint labels as well. Just change the '&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;In Column&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;' value to 'Labels', and type in the search criteria. The list will filter down based on the search results.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/-b6BdmamZD8U/Th5akJJRl3I/AAAAAAAAAbY/gPoO5sYv9sA/s1600/BreakpointLabelSorting.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 59px;" src="http://2.bp.blogspot.com/-b6BdmamZD8U/Th5akJJRl3I/AAAAAAAAAbY/gPoO5sYv9sA/s400/BreakpointLabelSorting.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629036161236309874" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;The next feature available from the Breakpoints Windows is the ability to Import and Export the breakpoints. Have you ever had that app you get out of source control and think "&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Ok I need to place (x) # of key breakpoints here, here, and here to do some task.&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;" Well what you should be doing is exporting your breakpoints and saving that file in source control. This is also really useful to pass along to other developers that might be working on your project. How nice for them to have descriptive (labels) pre-defined breakpoints already defined for debugging. The task is trivial: just press the save disk icon from the Breakpoints Window and the debug breakpoints will be exported to an .xml file. The import is just as simple. Just press the Import icon and select the .xml file where the breakpoints are defined. Don't forget to add these files to Source Control.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-A0iYRcQfl2c/Th5kDKiVg5I/AAAAAAAAAcg/I1zg_cnCRFQ/s1600/BreakpointsImportExport.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 66px;" src="http://2.bp.blogspot.com/-A0iYRcQfl2c/Th5kDKiVg5I/AAAAAAAAAcg/I1zg_cnCRFQ/s400/BreakpointsImportExport.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629046589790454674" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;The next debugging technique helps with monitoring specific values but not having to stop execution to do so. They are called 'Tracepoints'. Have you ever been in a situation where you need to monitor a value of a variable and began writing 'Debug.Writeline' statements? Errrrr, No. Just use a tracepoint and monitor the same Output Window. This way you don't have to clutter up your code with debugging lines that later you might clear out or have to wrap in conditional #Debug statements. To create a tracepoint right-click on the actual breakpoint in the code editor or from the Breakpoints Window and select '&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;When Hit...&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;'.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/-1S6uiCfJ3UY/Th5b3xBulAI/AAAAAAAAAbg/HD-NVlwW7CM/s1600/BreakpointWhenHit.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 264px; height: 228px;" src="http://2.bp.blogspot.com/-1S6uiCfJ3UY/Th5b3xBulAI/AAAAAAAAAbg/HD-NVlwW7CM/s400/BreakpointWhenHit.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629037597871215618" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;This will bring up a dialogue that allows you to type in some expressions to output needed information.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/-0u782lldKLQ/Th5cFyyoEFI/AAAAAAAAAbo/URMvN5vaqlg/s1600/WhenBreakpointIsHit.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 337px;" src="http://4.bp.blogspot.com/-0u782lldKLQ/Th5cFyyoEFI/AAAAAAAAAbo/URMvN5vaqlg/s400/WhenBreakpointIsHit.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629037838862913618" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;For example look at the following basic loop below.&lt;pre class="brush: vb.net"&gt;For i As Integer = 1 To 10&lt;br /&gt;&lt;br /&gt;Next&lt;br /&gt;&lt;/pre&gt;I want to place a tracepoint on the variable to see it's output in the loop. The expression I will use is as follows:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;The value of i = {i}&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;In my case I will leave the option checked to 'Continue execution', so I can view the output, but not have to stop execution. Notice after adding the expression your traditional breakpoint is now a tracepoint which is displayed as a diamond.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/-Yjhi8CpHk-A/Th5c0AUAhyI/AAAAAAAAAbw/-ieQtrMr2yk/s1600/TracePoint.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 286px; height: 58px;" src="http://1.bp.blogspot.com/-Yjhi8CpHk-A/Th5c0AUAhyI/AAAAAAAAAbw/-ieQtrMr2yk/s400/TracePoint.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629038632766572322" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;Before executing the code, make sure to have the 'Command Window' present. If it is not, you can access it by pressing [Ctrl] + [Alt] + [O]. Now execute the code that will run through the configured Trace Point. Notice execution will not halt, but the expression you provided will be output to the Command Window. Notice for the simple loop, it output all of the values.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/-NyMpTphG4QU/Th5dJUAPbDI/AAAAAAAAAb4/FERbt59DWFI/s1600/TracepointOutput.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 159px; height: 189px;" src="http://1.bp.blogspot.com/-NyMpTphG4QU/Th5dJUAPbDI/AAAAAAAAAb4/FERbt59DWFI/s400/TracepointOutput.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629038998829624370" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;Pretty nice and all done through a tracepoint. No need for custom logging, Writeline statements, etc. This is an especially good technique for watching values during their lifetime throughout an application and helps solve the old "&lt;i&gt;I swear I clear that value out...&lt;/i&gt;", or "&lt;i&gt;Why does that variable loose value here but have value over there...&lt;/i&gt;', and many, many more examples.&lt;br /&gt;&lt;br /&gt;The last (but by &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;far&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; not the last available technique) topic I am going to cover are 'Pinned Data Tips' while debugging. Ever hover over a value and have to remember it for later in execution, or jot down some notes about a particular debugged line of code? Well this feature is for you then. Begin by placing a traditional breakpoint on a line, and being execution of code until the breakpoint is hit. When you hover over the variable you will get it's current value. Ever notice there is a push pin on the end of the value? Yeah, go ahead and press it as displayed below.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/-hJhVyES6Yio/Th5dkBBYPDI/AAAAAAAAAcA/ETlRxO_sF4g/s1600/DataTips.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 176px; height: 56px;" src="http://1.bp.blogspot.com/-hJhVyES6Yio/Th5dkBBYPDI/AAAAAAAAAcA/ETlRxO_sF4g/s400/DataTips.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629039457590590514" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;To move the data tip around, just click and hold the pin to drag it off to the side if needed where there is more white space. You can also add comments to that data tip. Just press the down arrows, to get a text box for typing brief comments.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/-1J6g7p_8mYo/Th5d_Hb_ybI/AAAAAAAAAcI/ZJpTkaPHtew/s1600/PinnedDataTipsWithComments.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 289px; height: 131px;" src="http://4.bp.blogspot.com/-1J6g7p_8mYo/Th5d_Hb_ybI/AAAAAAAAAcI/ZJpTkaPHtew/s400/PinnedDataTipsWithComments.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629039923169315250" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Notice as execution continues, &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;or&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; when you being a new debugging session the pinned data tip is still present! How cool, no more stickys on the screen or desk with random notes, values, etc. Notice how you will see it displayed as a blue horizontal push-pin in the pane where breakpoints are assigned in the editor. If it is on the same line as a breakpoint it will be mostly hidden.&lt;br /&gt;&lt;br /&gt;As mentioned, once you being debugging again (even after stopping execution), you defined push-pins will reappear but there is &lt;i&gt;one more&lt;/i&gt; useful added feature. Notice how the push-pin will display the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;last&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; debugging session's value. This can be really useful to see how the code reacts to different input possibly, and doesn't require you to keep track of what the value was from the last time code ran through this breakpoint. The last value is displayed below:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/-ZWFFYBnGfYk/Th5eqD8NNrI/AAAAAAAAAcQ/9Atgm4ON7yM/s1600/PinnedDataTipsLastValue.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 244px; height: 103px;" src="http://2.bp.blogspot.com/-ZWFFYBnGfYk/Th5eqD8NNrI/AAAAAAAAAcQ/9Atgm4ON7yM/s400/PinnedDataTipsLastValue.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5629040660965045938" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Note: to clear any data tips, right-click the push-pin in the code editor and select 'Clear'.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;These debugging techniques are just a &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;small&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; sampling of all of the available features. Feel free to add comments for any other features you find useful as well. The main point to drive home is that to be successful in software development &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;will&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; at one time or another require 'playing detective' and tracking down unknown issues, anomalies, or maybe just learning how code behaves line by line. To do these tasks well you have to be efficient at debugging. So if you are one of the few that admits they only knew about (2) or (3) Function keys used for debugging, try some of these and many other documented debugging techniques to help you expand your problem solving abilities in VS.NET.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-4237248179910739538?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/4237248179910739538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/07/debugging-code-techniques-in-vsnet-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4237248179910739538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4237248179910739538'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/07/debugging-code-techniques-in-vsnet-2010.html' title='Debugging Code Techniques In VS.NET 2010'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-N2djVgiGZd8/Th5Xg1WOxRI/AAAAAAAAAbA/vg7B0sBNHH4/s72-c/BreakpointsWindow.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-3758858933141715898</id><published>2011-06-28T22:22:00.001-04:00</published><updated>2011-06-28T22:23:45.968-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Create A Self-Signed SSL Certificate Using IIS 7</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;If you are a .NET developer that creates IIS or self-hosted WCF services, then you will probably have the need at some point to secure the transport with a SSL certificate if using a http binding type. If you have a WCF service hosted by IIS, applying a SSL certificate is a bit more trivial because the endpoint configuration does not dictate the URL. The virtual directory in IIS will create the URL for your endpoint. However, if you are hosting your WCF service in a Windows Service, you dictate the endpoint and applying the SSL certificate is a little more involved. Because of this you may want to create a self-signed SSL certificate while still in development to ensure that your 'https' endpoint works correctly. With IIS websites, legacy .asmx services, or WCF hosted services, applying a SSL certificate happens after the fact via IIS and the initial testing with a SSL certificate may not even be desired. Regardless of your situation, the following tutorial shown you a simple procedure to create a self-signed certificate on your local machine.&lt;br /&gt;&lt;br /&gt;So what is a self-signed SSL certificate you may ask. A 'CA' or Certificate Authority is a trusted provided to generate a SSL certificate. Your local machine is a CA, but unfortunately and as expected the CA on your machine is not trusted (as should be) by any outside party, so any SSL certificate generated locally is good and trusted just there: locally! To get a SSL certificate generated by a trusted CA, you need to go to a commercial provider like 'GoDaddy' or 'Verisign' and purchase a SSL certificate. These Certificate Authorities are trusted on the internet and are able to provide SSL certificates with a set expiration time (i.e. 2 years out). Once applied, you can view the SSL certificate information of a secure site by pressing the secure lock icon in most browsers next to the URL, and will see who issued the SSL certificate, its expiration, and other public details like the public key.&lt;br /&gt;&lt;br /&gt;If you happen to be on an Active Directory domain doing 'intranet' or internal software development, you may have a CA on the domain that will issue certificates which will be trusted within the domain. This is the way to go so one does not have to buy a GoDaddy or Verisign SSL certificate for every internal WCF service or hosted ASP.NET site. Check with your server folks (unless that's you!) to see if there is a CA that issues SSL certificates trusted by all on the domain.&lt;br /&gt;&lt;br /&gt;If you don't have IIS7, generating a SSL certificate is still possible. You just do the similar steps under the 'Directory Security' tab in IIS for a given site. Using IIS to create the certificate does not mean we have to host our service in IIS. It just has a convenient 'wizard' style interface to generate certificates and place them in the proper 'stores'. You can manually decide which stores your certificate is placed in and trusted by using the Certificate Manager MMC snap-in. That is really off topic for this post, but good to see how local and purchased certificates are managed. The snap-in is not under the administrator tools by default so look to the following link if interested in adding or accessing this MMC utility:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/library/bb123831(EXCHG.65).aspx"&gt;How to Add Certificate Manager to Microsoft Management Console&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To begin a new certificate request, open IIS7 and click on the root element which is your machine or server node. Locate the 'Server Certificates' icon and double click it:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-op559BKDWw0/TgqJ-md8O_I/AAAAAAAAAYo/aJrMaN3vSFQ/s1600/ServerCertificates.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 92px; height: 85px;" src="http://3.bp.blogspot.com/-op559BKDWw0/TgqJ-md8O_I/AAAAAAAAAYo/aJrMaN3vSFQ/s400/ServerCertificates.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5623458793296509938" /&gt;&lt;/a&gt;On the right-hand side of the screen select the 'Create Self-Signed Certificate' link which will display the following dialog:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-he1xm6l7hM8/TgqKJJoL4HI/AAAAAAAAAYw/wq5H77RXCDc/s1600/CreateSelfSignedSSL.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 321px;" src="http://4.bp.blogspot.com/-he1xm6l7hM8/TgqKJJoL4HI/AAAAAAAAAYw/wq5H77RXCDc/s400/CreateSelfSignedSSL.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5623458974533410930" /&gt;&lt;/a&gt;This is the important part which is dictating the friendly-name of your certificate. For local WCF development you really have (2) choices: name the certificate 'localhost' or the name of your machine. I recommend the name of your machine as it is more explicit. So in the example below my machine name is 'DevMachine1234'. The name is important for hosting WCF services and applying a SSL certificate to the exposed endpoint. If the SSL name does not match the domain of the hosted service it will not work. In the case of local development, name the certificate the same name as your machine.&lt;br /&gt;&lt;br /&gt;After completing the request you will see the SSL certificate has been generated by the local machines CA, the friendly name, and the certificate hash.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-LqtK4rQS27Y/TgqKS1h1bCI/AAAAAAAAAY4/jtSeUz99-5M/s1600/IISServerCertificates.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 58px;" src="http://1.bp.blogspot.com/-LqtK4rQS27Y/TgqKS1h1bCI/AAAAAAAAAY4/jtSeUz99-5M/s400/IISServerCertificates.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5623459140936756258" /&gt;&lt;/a&gt;The hash value will be important in the next post about applying this self-signed certificate to a port number that is dictated in the WCF configuration for a service hosted by a Windows Service. If you are applying the SSL certificate to a IIS hosted service or site, all you have to do is select it from the dropdown when configuring the 'https' binding in IIS7.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-3758858933141715898?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/3758858933141715898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/06/create-self-signed-ssl-certificate.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3758858933141715898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3758858933141715898'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/06/create-self-signed-ssl-certificate.html' title='Create A Self-Signed SSL Certificate Using IIS 7'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-op559BKDWw0/TgqJ-md8O_I/AAAAAAAAAYo/aJrMaN3vSFQ/s72-c/ServerCertificates.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-8627772658739826033</id><published>2011-06-14T22:19:00.032-04:00</published><updated>2011-06-14T23:27:59.675-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computer Hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='Custom Built PC'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><title type='text'>My New Computer: A Developers Dream</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Well call me old school, but I still like a bangin' desktop for my main home PC. For the general user mostly not moving beyond the bounds of the web for computer use any machine from a laptop, netbook, tablet, or heck even a smart phone will suffice. However any serious users doing coding in .NET with VS.NET, video transfer + editing, gaming, photo editing, etc. you really need a *real* machine that can handle the load. Nothing more scalable and well built then a sweet looking mid-tower loaded with lots of horsepower.&lt;br /&gt;&lt;br /&gt;Recently I began assembling my new main home PC and I love it! I have found that building a PC and maybe updating just memory, video card, or even CPU will last much, much longer than purchasing any kind of store bought machine. Case in point, the last PC I built was in the fall of 2003. It was a Socket 478 Asus Motherboard mid-tower. It lasted me until I built this new machine just a few weeks ago. How? I upgraded from a Celeron to a P4 Extreme Edition, updated the RAM, updated the video card, and got almost 8 years out of it. Still a fantastic machine I gave to my brother-in-law because it still ran XP really well. Hopefully I get several years out of my new machine as well.&lt;br /&gt;&lt;br /&gt;Because of this gap I never experimented with any RAID configuration, etc to increase the PCs main bottleneck: the magnetic disk hard drive. With my new build I wanted all of the best but yet still be on a budget. I was determined to use a Solid State Drive  (SSD) for the primary OS drive, and a decent HDD for the additional space needs. Once I caught wind of the new Intel i7 'Sandy Bridge' line of processors, I knew it was time to build. Not only are the Sandy Bridge Generation 2 i7 processors about 1/2 the cost of good Generation 1 i7 processors, they are faster too.&lt;br /&gt;&lt;br /&gt;My budget was to be around $1000-$1200. The hands-down best place anywhere to get good deals on computer hardware is http://www.newegg.com Between their 'Shell-Shocker' deals, coupon codes, sales, and overall low prices, I was able to build my new machine for under $1200. I am not including the OS because that is a given. My build was using Windows 7 64-bit Ultimate. So let's get to the parts -&amp;gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16811112320"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;LIAN LI Lancool PC-K63 Black Steel ATX Mid Tower Computer Case&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;  - Cost $99 via 'Shell-Shocker' deal. The case is fantastic! There really are no screws, everything snaps into place. Cable management is routed through guides so there isn't a big mess. There are several blue LED fans which make the case stand out too.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16813131705"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;ASUS P8P67 (REV 3.0) LGA 1155 Intel P67 SATA 6Gb/s USB 3.0 ATX Intel Motherboard&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $154 with coupon code. I love Asus motherboards. There is so much configurability and expansion. This is the entry level P8P67 ATX board, but since I am not doing dual graphics cards needing SLI support, this board works great for me.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16817121068"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;KINGWIN Lazer LZ-1000 1000W Modular 80 PLUS BRONZE Certified Active PFC W/ 3-Way LED Switch and Universal Modular Connector Power Supply&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $119 via 'Shell-Shocker' deal. 1000 watts, enough said? Bronze certified, modular connections, and a blue LED fan to match the case. Perfect choice for me.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16819115071"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;Intel Core i7-2600 Sandy Bridge 3.4GHz (3.8GHz Turbo Boost) 4 x 256KB L2 Cache 8MB L3 Cache LGA 1155 95W Quad-Core Desktop Processor BX80623I7260&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $285 with coupon code. This i7 CPU as of this post is about the fastest CPU on the market right now. Combine this with a SSD, and Windows 7 64-bit and you will get some BLAZING fast speeds.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820139113"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;Kingston SSDNow V+ Series SNVP325-S2B/128GB 2.5" 128GB SATA II MLC Internal Solid State Drive (SSD)&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $165 after mail-in rebate. This is the 1st SSD I have ever owned and it is about the best PC component purchase I have ever made. It is only SATA II and the speed is amazing. These deals are going to make magnetic drives obsolete in a few years once the price comes down a bit more.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822136794"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;Western Digital Caviar Black WD7502AAEX 750GB 7200 RPM 64MB Cache SATA 6.0Gb/s 3.5" Internal Hard Drive -Bare Drive&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $59 after coupon code. The 'Black Caviar' Wester Digital drives have the best warranty in class at (3) years, and are the most durable of the green,blue,black line of drives. SATA III 6Gb/s this drive is super fast for a traditional HDD. I just hope WD gets going with SSDs so they don;t end up like Blockbuster video wondering what happened with NetFlix.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16814102878"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;SAPPHIRE 100297L Radeon HD 5830 1GB 256-bit GDDR5 PCI Express 2.1 x16 HDCP Ready CrossFireX Support Video Card w/ ATI Eyefinity Technology&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $139 after coupon code. This has already come down further in price since I bought it (big surprise right?) but it is a solid, well preforming, 256-bit GDDR5 board that will handle a plethora of modern day gaming and video needs.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820145324"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;CORSAIR XMS 8GB (2 x 4GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) Desktop Memory Model CMX8GX3M2A1600C9&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $75 after mail-in rebate. Fast, compatible, easy installation. I don;t get too much into memory overclocking so this memory is working fine for me. Honestly in all of the memory research I did, I really started to wonder if the whole 'heat-sink' super duper memory x2 in price for same speed had negligible performance gains and was probably a gimmick. I say get what's compatible and as much as you can.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16827118040"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;Sony Optiarc CD/DVD Burner 24X DVD+R 8X DVD+RW 12X DVD+R DL 24X DVD-R 6X DVD-RW 16X DVD-ROM 48X CD-R 32X CD-RW 48X CD-ROM Black SATA Model AD-7261S-0B LightScribe Support&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $24 after coupon code. Fast, quiet, Sony brand, LightScribe. If you have never used LightScribe I recommend getting it. Turn over the DVD or CD after burning a LightScribe disk and burn some really cool text or images to the disk. It's been around for years but not too many know about using it.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16835100007"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff;"&gt;Arctic Silver 5 Thermal Compound - OEM&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $7 after coupon code. Get some as it is a good idea when installing the CPU to transfer heat best.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16823126043&amp;amp;cm_re=logitech_illuminated-_-23-126-043-_-Product"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;color:#0000ff"&gt;Logitech 920-000914 Black 106 Normal Keys USB Wired Ultra-thin Illuminated Keyboard&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; - Cost $45 Refurbished (eBay purchase). This was the only product I did not buy from NewEgg; I got it on eBay for about 2/3 the cost. The Refurbished product was in perfect condition, and I am using it right now! An illuminated keyboard is a purchase I am wondering why I didn;t have about 5-10 years ago. I really like it a lot.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Total cost: $1171. Now some pictures:&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/-dV7A90iHv7w/TfgkCVPpn4I/AAAAAAAAAXM/ZkIa4Mv5fI8/s1600/100_4938.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://1.bp.blogspot.com/-dV7A90iHv7w/TfgkCVPpn4I/AAAAAAAAAXM/ZkIa4Mv5fI8/s400/100_4938.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618280157625819010" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/-LWalWNt22p4/Tfgj-6U8Z1I/AAAAAAAAAXE/5_O1tOlBuq0/s1600/100_4941.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://2.bp.blogspot.com/-LWalWNt22p4/Tfgj-6U8Z1I/AAAAAAAAAXE/5_O1tOlBuq0/s400/100_4941.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618280098860656466" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/-7NWyoKY4_c0/Tfgj7hEN-rI/AAAAAAAAAW8/mjCttSisd0E/s1600/100_4943.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://2.bp.blogspot.com/-7NWyoKY4_c0/Tfgj7hEN-rI/AAAAAAAAAW8/mjCttSisd0E/s400/100_4943.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618280040540011186" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/-X9uYfpEjvs0/TfgjloCXWCI/AAAAAAAAAWc/nqZIhI_unxw/s1600/100_4944.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 300px; height: 400px;" src="http://4.bp.blogspot.com/-X9uYfpEjvs0/TfgjloCXWCI/AAAAAAAAAWc/nqZIhI_unxw/s400/100_4944.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618279664454162466" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/-riT99z_UzjE/TfgjihVqyoI/AAAAAAAAAWU/PGXNddWs0V0/s1600/100_4945.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 300px; height: 400px;" src="http://3.bp.blogspot.com/-riT99z_UzjE/TfgjihVqyoI/AAAAAAAAAWU/PGXNddWs0V0/s400/100_4945.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618279611116472962" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/-8JsKKV23-Tc/TfgjfxMzECI/AAAAAAAAAWM/erWK_UPli7E/s1600/100_4955.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 300px; height: 400px;" src="http://1.bp.blogspot.com/-8JsKKV23-Tc/TfgjfxMzECI/AAAAAAAAAWM/erWK_UPli7E/s400/100_4955.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618279563834626082" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/-nS1EdM_wB9A/Tfgjc4UOPqI/AAAAAAAAAWE/yVqRNoO0dHE/s1600/100_4963.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 300px; height: 400px;" src="http://4.bp.blogspot.com/-nS1EdM_wB9A/Tfgjc4UOPqI/AAAAAAAAAWE/yVqRNoO0dHE/s400/100_4963.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618279514205208226" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/-hMqWzE6mEDk/TfgjZ0Ad6eI/AAAAAAAAAV8/Aw8Wkib0kCA/s1600/100_4964.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 300px; height: 400px;" src="http://3.bp.blogspot.com/-hMqWzE6mEDk/TfgjZ0Ad6eI/AAAAAAAAAV8/Aw8Wkib0kCA/s400/100_4964.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618279461508999650" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/-6EJbbkGS1z0/TfgjWhS2kCI/AAAAAAAAAV0/1u5ZQDhJ59c/s1600/100_4965.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 300px; height: 400px;" src="http://3.bp.blogspot.com/-6EJbbkGS1z0/TfgjWhS2kCI/AAAAAAAAAV0/1u5ZQDhJ59c/s400/100_4965.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618279404946231330" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/-UhQbKfs30ug/TfgjTnw7DwI/AAAAAAAAAVs/zX59NKGLrhY/s1600/100_4973.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 300px; height: 400px;" src="http://4.bp.blogspot.com/-UhQbKfs30ug/TfgjTnw7DwI/AAAAAAAAAVs/zX59NKGLrhY/s400/100_4973.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618279355143360258" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/-YN8v4NQb694/TfgiqydK_iI/AAAAAAAAAVk/cmOISn1iohk/s1600/100_4977.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/-YN8v4NQb694/TfgiqydK_iI/AAAAAAAAAVk/cmOISn1iohk/s400/100_4977.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618278653638671906" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;Well how is the overall performance when benchmarked? Well I don;t have any fancy tools, but using Windows 7's 'Windows Experience Index' the machine scored a 7.0 on a possible 7.9 scale:&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/-2zhNFhFF3n4/Tfgki8rXNZI/AAAAAAAAAXU/hMRjGClokBw/s1600/Windows%2BScore.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 210px;" src="http://1.bp.blogspot.com/-2zhNFhFF3n4/Tfgki8rXNZI/AAAAAAAAAXU/hMRjGClokBw/s400/Windows%2BScore.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5618280717966849426" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;The end result? Windows 7 64-bit installed in 12 minutes, the machine boots to desktop ready for use in about 15 seconds, and shut down time is about 4 seconds. Opening applications like VS.NET 2010? Almost instant. AWESOME! Hope this machine lasts me 8 years like my last one, to get everything out of it. I think every developer should have a machine like this. If you get a chance to build one similar, I highly recommend it.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-8627772658739826033?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/8627772658739826033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/06/my-new-computer-developers-dream.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8627772658739826033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8627772658739826033'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/06/my-new-computer-developers-dream.html' title='My New Computer: A Developers Dream'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-dV7A90iHv7w/TfgkCVPpn4I/AAAAAAAAAXM/ZkIa4Mv5fI8/s72-c/100_4938.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-8723151407452377461</id><published>2011-05-16T23:29:00.008-04:00</published><updated>2011-05-17T10:17:01.708-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sentiment Analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Natural Language Processing'/><title type='text'>Sentiment Analysis Processing For .NET Solutions</title><content type='html'>&lt;span style="font-family:arial;"&gt;Sentiment Analysis is the process of determining 'tone' within the context of a given text. In today's world of CRM systems, blogging, and social networking has sparked an interest in being able to harness the overall sentiment of that content (positive, negative, neutral, etc). The algorithmic computations and processing required to perform sentiment analysis is based on the field of Natural Language Processing, which it and SA can make someone's career all on thier own. Needless to say it is probably not something a .NET developer wants to attempt from scratch.&lt;br /&gt;&lt;br /&gt;The trend tends to be publicly available RESTful APIs that are both free or with a cost that allow a developer to send data to, have SA processing preformed against the submitted data, and have the resulting sentiment information returned.&lt;br /&gt;&lt;br /&gt;There are typically (2) main approaches to processing the data to determine sentiment: trained systems using custom data sets (not ADO.NET datasets, actual text data), and out-of-the-box non-trained systems using a default data set. The latter is the simplest approach because you can be up and processing data in a matter of minutes. The downside is much less accurate results (my tests averaged about 60-70% average accuracy across the board using non-trained systems). A trained system using custom data sets with terminology and keywords specific to your need or industry would be the best approach and yield the most accurate results. The downside to this is it is much more time consuming, involved, and will most likely be associated only with paid solutions.&lt;br /&gt;&lt;br /&gt;When 1st researching sentiment analysis in relation to .NET applications, I tell you truthfully I knew nothing about it (or what sentiment analysis was even termed) and was looking for an out-of-the-box widget from CodePlex or something in the form of a .dll, etc. Wrong! But I did learn about the different APIs available and composed a list. Below are the names and links of several Sentiment Analysis APIs that could be used for .NET applications, and really for other programming languages too because most are RESTful APIs. (I apologize for the URL data below being an image, but formatting it all or doing it manually was going to be a nightmare)&lt;br /&gt;&lt;p align="center"&gt;&lt;a href="http://1.bp.blogspot.com/-IzA-uWf5Vsk/TdKDI-tRT_I/AAAAAAAAATE/qzQqc-LUDYI/s1600/SentimentAnalysisAPI.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 500px; height: 360px;" src="http://1.bp.blogspot.com/-IzA-uWf5Vsk/TdKDI-tRT_I/AAAAAAAAATE/qzQqc-LUDYI/s400/SentimentAnalysisAPI.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5607688676324757490" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Table 1.0: Sentiment Analysis (&lt;strong&gt;CLICK ON PICTURE FOR LARGER DETAIL&lt;/strong&gt;)&lt;/span&gt;&lt;/p&gt;&lt;div align="left"&gt;As I mentioned before this isn't such a straight forward need that I can tell you, "Pick this 1 &lt;em&gt;best&lt;/em&gt; sentiment analysis API." You really need to try them out independently as I did and become familiar with each tool and its capabilities. A lot of these tools depending on load can get &lt;em&gt;very&lt;/em&gt; expensive. If you are just randomly processing a few blog articles or some basic customer feedback you can probably use any of the solutions for free or close to it. However the minute you want to process the data stored in a CRM system or from a social networking site like Facebook or Twitter, you could be looking at a multi-thousand dollar on going investment. For this reason you should research, become familiar with, and test each API listed to see how it performs.&lt;br /&gt;&lt;br /&gt;Lastly I am no expert on this subject and the purpose of this article was really just to create a more organized starting point which I did not have. The following (2) links below will give a decent high level description of both Sentiment Analysis and Natural Language Processing. I also welcome any comments on additional APIs others may have used and the details about them.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Sentiment_analysis" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Sentiment analysis&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Natural_language_processing" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Natural language processing&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-8723151407452377461?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/8723151407452377461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/05/sentiment-analysis-processing-for-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8723151407452377461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8723151407452377461'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/05/sentiment-analysis-processing-for-net.html' title='Sentiment Analysis Processing For .NET Solutions'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-IzA-uWf5Vsk/TdKDI-tRT_I/AAAAAAAAATE/qzQqc-LUDYI/s72-c/SentimentAnalysisAPI.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-6272901739587213612</id><published>2011-04-30T01:58:00.001-04:00</published><updated>2011-04-30T10:01:50.485-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='101 Topics'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Decompiling'/><title type='text'>What is Decompiling an Assembly in .NET and Some Good Tools To Do It</title><content type='html'>&lt;div&gt;&lt;font face="arial"&gt;From time to time I like to mix some new information with some basic concepts. I am not always going to compete with the bleeding edge blogs that have full drill down articles 5 minutes after WebMatrix was announced. And what I always remember is not every developer out there is pushing the envelope or is seasoned in this field yet. So I like to cover some basic concepts occasionally to hopefully add a fresh perspective on something more junior devs out there may not understand.&lt;br /&gt;&lt;br /&gt;Decompiling. What is it in reference to .NET assemblies? Well in the most abstract form of description, it is the process of reverse engineering MSIL or Microsoft Intermediate Language back into a more familiar, readable set of code to which it was developed. But wait (some might say)! I thought once I compiled my .NET project, the output library was cryptic and unreadable low-level machine code just like my old VB6 or C++ .dlls. Not in our case when doing .NET Managed code development. When you compile a .NET assembly, it is compiled into the afore mentioned intermediate language named MSIL. The MSIL is then compiled to native machine code via a Just-In-Time (JIT) compiler; in our case the .NET Framework JIT compiler is used.&lt;br /&gt;&lt;br /&gt;Some of you might remember (or maybe not if you are newer to the industry which is OK), all the buzz around all the different *.NET* languages when the Framework 1.0 was 1st released in late 2001. All this talk about VB.NET, C#, COBOL.NET, Fortran.NET, etc. and everyone scratching their heads going, huh? Well this was because the equation was simpler now:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;font color="#000099"&gt;[Language X] + [.NET Compiler for Language X] = MSIL&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;So with all of these languages, the goal is to have them compiled to this intermediate language named MSIL. Since MSIL can be interpreted by a JIT compiler and is not unreadable in itself, also presented the opportunity to go the opposite direction and turn the MSIL back into readable code. Hence a 'Decompiler'.&lt;br /&gt;&lt;br /&gt;With a decompiler tool, you can open a compiled .NET assembly (i.e. a .dll from the /bin directory) and reverse engineer the MSIL back into more readable code close it its original uncompiled version (some tools are much better at this than others). Why is this useful to me (you might ask)? You will not use it all the time, but imagine if you got a 3rd party .dll without the source code and wanted to see how it worked? Use a decompiler. What if a rogue developer jumped ship and took all the .NET source code with him, only leaving the installed assemblies behind. Use a decomplier. What if you wanted to see how Microsoft builds the very Framework .dlls we use daily (like System.Text, System.NET, etc.; non-meta data versions only)? Use a decompiler.&lt;br /&gt;&lt;br /&gt;VS.NET actually shipped with a decompiler tool named ILDASM.exe. This tool was not that bad early on, and I used it for several years. If you ever want to try it out it is located in C:\Program Files\Microsoft Visual Studio [Version]\SDK\v2.0\Bin. I believe the tool was only shipped through VS.NET 2008, but to be honest it was so primitive it really isn’t worth investigating too far, because there are much, much better tools available.&lt;br /&gt;&lt;br /&gt;However I wanted to briefly mention (2) very nice *free* tools available for decompiling those compiled .NET assemblies. The 1st is made by a company called RedGate and is named .NET Reflector. Now I mentioned *free*, and there has been a lot of upset devs out there because RedGate announced it was going to be charging $35 once version 7 was available. However, because the community reeled, they made an announcement this past week stating that all version 6 users would get an update with a perpetual free license. You can read about the announcement here: &lt;b&gt;&lt;a href="http://eon.businesswire.com/news/eon/20110426007021/en/.NET-Reflector/Reflector/Red-Gate" target="_blank"&gt;&lt;font style="TEXT-DECORATION: underline" color="#0000ff"&gt;http://eon.businesswire.com/news/eon/20110426007021/en/.NET-Reflector/Reflector/Red-Gate&lt;br /&gt;&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can still download version 6 of .NET Reflector, and then have it auto-update itself to the latest version of 6 (6.8 as of this post). Although at $35, version 7 is not a bad price either, but apparently they upset a lot of devs claiming to always make Reflector free, and ended up deciding to charge. Once you have installed .NET Refelctor it will give you the option of integrating itself into any installed version of VS.NET you have on your machine. This gives the developer the option of actually debugging assemblies referenced in your project which is a really nice feature.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-EmBMlD-CtHQ/TbsmUwSjy4I/AAAAAAAAARE/5eiCwNptt5k/s1600/ReflectorIntegration.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 267px; DISPLAY: block; HEIGHT: 188px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5601112699567328130" border="0" alt="" src="http://4.bp.blogspot.com/-EmBMlD-CtHQ/TbsmUwSjy4I/AAAAAAAAARE/5eiCwNptt5k/s400/ReflectorIntegration.png" /&gt;&lt;/a&gt;&lt;br /&gt;At the perfect time a company named Telerik (well known for their 3rd party rich controls and reporting tools for different .NET Technologies) pounced in this week with their own decompiler named "Just Decompile". And as they state on their webpage: "Powerful, Free Decompiling. Forever." Notice the 'Forever'. A nice little dig at RedGate and .NET Reflector I am sure. Anyway, this is a nice decompiler as well, but it is in Beta and not as mature or well working to my experience as Reflector. You know what I say though, "Get both, they are free!!"&lt;br /&gt;&lt;br /&gt;To use either decompiler, open the shortcut to which ever tool you want to use; the shortcut probably on the desktop, or you might have to go to installation directory:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-svZX8J06_jw/TbsmMPyU0cI/AAAAAAAAAQ8/Chl7DnYUP70/s1600/Decompilers.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 188px; DISPLAY: block; HEIGHT: 129px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5601112553403240898" border="0" alt="" src="http://2.bp.blogspot.com/-svZX8J06_jw/TbsmMPyU0cI/AAAAAAAAAQ8/Chl7DnYUP70/s400/Decompilers.png" /&gt;&lt;/a&gt;&lt;br /&gt;Once the decompiler tool is open, they all function similarly. Select "Open" and browse to any compiled .NET .dll. Once opened, you typically navigate the binary on the left, and when selecting a method, property, etc. from the left, you will be able to see the code on the right:&lt;br /&gt;&lt;br /&gt;Reflector:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-rEe3Nyg9b9c/Tbsl8zG9srI/AAAAAAAAAQs/JDDCzSKccQw/s1600/Reflector.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 400px; DISPLAY: block; HEIGHT: 164px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5601112288007140018" border="0" alt="" src="http://2.bp.blogspot.com/-rEe3Nyg9b9c/Tbsl8zG9srI/AAAAAAAAAQs/JDDCzSKccQw/s400/Reflector.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;JustCompile:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-sLVwIdYAuXk/TbsmEukE_MI/AAAAAAAAAQ0/CS9AdNZJeFM/s1600/JustDecompile.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 400px; DISPLAY: block; HEIGHT: 186px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5601112424226028738" border="0" alt="" src="http://4.bp.blogspot.com/-sLVwIdYAuXk/TbsmEukE_MI/AAAAAAAAAQ0/CS9AdNZJeFM/s400/JustDecompile.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now hopefully some things have become clearer on the topics of .NET compiled binaries and how to decompile them. With this understanding, you do not want to place things like passwords, connection string, secret proprietary algorithms, etc into a .NET .dll that will be shipped out or sold. This is because anyone with a little knowledge could decompile your code and see what is inside of it.&lt;br /&gt;&lt;br /&gt;One way to complicate the decompiling process is to "Obfuscate" the compiled code. This renames and rearranges the code to make it difficult to decompile and read, but not impossible. There are some good obfuscation tools available like Dotfuscator, but they can get quite pricey for a full version. A better solution to hiding values you do not want seen or hacked, is to place them in your application’s .config file and then use a tool like aspnet_regiis to encrypt them. Nothings bullet proof, but anything is probably better than Dim MySecrectPassword As String = "VeryToughPwd123"&lt;br /&gt;&lt;br /&gt;So there isn’t much to loose. Go ahead and download both decompilers and give them a try!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.telerik.com/products/decompiling.aspx" target="_blank"&gt;&lt;font style="TEXT-DECORATION: underline" color="#0000ff"&gt;Telerik JustDecompile&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;(you will have to search and find a freeware site to download Reflector version 6 since RedGate does not offer it for obvious reasons from thier site directly anymore) &lt;/font&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-6272901739587213612?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/6272901739587213612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/04/what-is-decompiling-assembly-in-net-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6272901739587213612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6272901739587213612'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/04/what-is-decompiling-assembly-in-net-and.html' title='What is Decompiling an Assembly in .NET and Some Good Tools To Do It'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-EmBMlD-CtHQ/TbsmUwSjy4I/AAAAAAAAARE/5eiCwNptt5k/s72-c/ReflectorIntegration.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-8347525843869274594</id><published>2011-04-30T00:43:00.006-04:00</published><updated>2011-04-30T10:01:33.172-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><title type='text'>The 'My' Namespace in a VB.NET Application is Missing Members</title><content type='html'>&lt;span style="font-family:arial;"&gt;OK I ran across this little snag in a VB.NET application, and thought I might share an easy solution to the problem. If you ever have a .NET solution that originated in a previous version other than 2010 and has been upgraded, you might have some difficulty accessing members of the 'My' namespace. Specifically I was missing the auto generated 'MyWebExtensions.vb' code file displayed below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-bT80KsWXQFo/TbsjYUdm8TI/AAAAAAAAAQE/abKBsNCtvZA/s1600/MyWebExtensions.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 211px; height: 55px;" src="http://1.bp.blogspot.com/-bT80KsWXQFo/TbsjYUdm8TI/AAAAAAAAAQE/abKBsNCtvZA/s400/MyWebExtensions.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5601109462282072370" /&gt;&lt;/a&gt;&lt;br /&gt;This resulted in the "'Application' is not a member of 'My'" error:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-7VX9aMCIs2k/TbsjfKn11rI/AAAAAAAAAQM/R78TeYKBYz4/s1600/MyNamespaceMemberMissing.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 216px; height: 46px;" src="http://3.bp.blogspot.com/-7VX9aMCIs2k/TbsjfKn11rI/AAAAAAAAAQM/R78TeYKBYz4/s400/MyNamespaceMemberMissing.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5601109579899721394" /&gt;&lt;/a&gt;&lt;br /&gt;There are probably a few tricks you could make to the solution (.sln) file by opening it in Notepad and fixing the appropriate settings, but the easiest way to fix the error is to remove the 'My' extension and add it back into the project. To do this open the project's properties of the project where the error is occurring, and click on the "My Extensions" tab.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-HGBORuQwetw/TbsjmejwOoI/AAAAAAAAAQU/jU7iFFhPj0k/s1600/MyExtensions.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 187px;" src="http://3.bp.blogspot.com/-HGBORuQwetw/TbsjmejwOoI/AAAAAAAAAQU/jU7iFFhPj0k/s400/MyExtensions.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5601109705510369922" /&gt;&lt;/a&gt;&lt;br /&gt;The 'My' extension you need for your project is dependent on the type of project you have created (Web, WPF, etc.), so make sure to select the proper one when re-adding. First though, right-click the current extension already added and select “Remove Extension”&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-KAPdR8priiI/Tbsk7IZXP-I/AAAAAAAAAQk/NYrqf1KGtg8/s1600/RemoveExtension.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 225px; height: 67px;" src="http://1.bp.blogspot.com/-KAPdR8priiI/Tbsk7IZXP-I/AAAAAAAAAQk/NYrqf1KGtg8/s400/RemoveExtension.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5601111159850090466" /&gt;&lt;/a&gt;&lt;br /&gt;Then press the "Add Extension" button in the bottom right-hand corner, and add the appropriate extension back into your project. This should auto-generate the 'MyWebExtensions.vb' code file and fix any previously non-accessible members in the 'My' namespace. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-krOhD12e02o/TbskB9P4nAI/AAAAAAAAAQc/nVXmXDV0xZs/s1600/AddMyNamespace.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 275px;" src="http://1.bp.blogspot.com/-krOhD12e02o/TbskB9P4nAI/AAAAAAAAAQc/nVXmXDV0xZs/s400/AddMyNamespace.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5601110177605000194" /&gt;&lt;/a&gt;&lt;br /&gt;For more information on the 'My' namespace, check out the (2) MSDN links below:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/vbasic/ms789188" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline; color:#0000ff;"&gt;My Namespace&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms172698.aspx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline; color:#0000ff;"&gt;How My Depends on Project Type (Visual Basic)&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-8347525843869274594?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/8347525843869274594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/04/my-namespace-in-vbnet-application-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8347525843869274594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8347525843869274594'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/04/my-namespace-in-vbnet-application-is.html' title='The &apos;My&apos; Namespace in a VB.NET Application is Missing Members'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-bT80KsWXQFo/TbsjYUdm8TI/AAAAAAAAAQE/abKBsNCtvZA/s72-c/MyWebExtensions.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7382895474125841460</id><published>2011-04-28T11:08:00.006-04:00</published><updated>2011-04-28T11:33:27.331-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Awards'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Honored to Receive the "Microsoft Community Contributor Award"</title><content type='html'>&lt;span style="font-family:arial;"&gt;I received a wonderful email today that I have been recognized with the 2011 "&lt;strong&gt;Microsoft Community Contributor Award&lt;/strong&gt;"! This entry is not to toot my own horn, but rather to say thank you to Microsoft for the recognition. I have used Microsoft products and software almost my entire life, and now am very proud to make my career and hobby in software engineering revolve around Microsoft and the .NET Framework technologies. As I continue to hone and grow my own skills, I will continue to share and contribute that knowledge to help others in our community in whatever way I can. It might be a small token of recognition, but one that I am proud and happy about. Thank you Microsoft. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;table style="width:100%" feat="'embedwebsite"&gt;&lt;tbody&gt;&lt;tr align="center"&gt;&lt;td align="center"&gt;&lt;img src="https://lh5.googleusercontent.com/_o-C99bmODDI/Tbl9SPzfRsI/AAAAAAAAAOQ/0V58t5hL9yk/s288/MCC11_Logo_Horizontal_Full-color.jpg" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7382895474125841460?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7382895474125841460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/04/honored-to-receive-microsoft-community.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7382895474125841460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7382895474125841460'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/04/honored-to-receive-microsoft-community.html' title='Honored to Receive the &quot;Microsoft Community Contributor Award&quot;'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh5.googleusercontent.com/_o-C99bmODDI/Tbl9SPzfRsI/AAAAAAAAAOQ/0V58t5hL9yk/s72-c/MCC11_Logo_Horizontal_Full-color.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-5500289327771212331</id><published>2011-03-22T23:52:00.001-04:00</published><updated>2011-03-23T00:35:18.458-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>ASP.NET Web Forms vs. ASP.NET MVC</title><content type='html'>&lt;span class="Apple-style-span" &gt;So it has been a few years now since Microsoft introduced the ASP.NET MVC Framework which is Microsoft's implementation of the MVC Architecture for ASP.NET. No the MVC (Model-View-Controller) architecture is not a new concept; just Microsoft's implementation of it in the .NET Framework. There has been a lot of buzz around whether to continue to use ASP.NET web forms which have been around since 2001, or to go with this "hot" new technology in ASP.NET MVC... or something else! There is no 'Silver-Bullet' answer to this, and with most situations, 'it depends'.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Oh I know, you might have "Googled" the exact phrase of this blog post and were hoping to get some answer to exactly which one is better. Nope. I just want to highlight a few of the strengths and weaknesses of both from an abstract point of view, and briefly mention some other alternatives too.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;To begin, I am going to repeat a stat that Andrew Duthie (Twitter handle: @devhammer) brought up on this topic at an ASP.NET Firestarter event in Orlando last December. He showed a stat that somewhere in the range of 80%+ dev shops were still using ASP.NET web forms for their bread and butter applications, and that ASP.NET web forms were &lt;b&gt;not going away!&lt;/b&gt; Anyone trying to spread a rumor like that needs to check with the folks direct from Redmond 1st, because it simply isn't true. To this end, folks shouldn't feel like they missed the last train to MVC euphoria because everyone hasn't boarded yet. I am not building up an article against MVC; I just want to point out that it is a misnomer that ASP.NET MVC has completely replaced an outdated web forms architecture that some may speak convincingly of on forums and blogs.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;So maybe you are leading a team of developers and are looking to decide the pros and cons of MVC, or maybe you are about to build a site for a friend/family member as fast as possible, or involved in a large scale enterprise application that will be web based. Whatever the scenario, you want to know the details of which architecture to choose. After all it will be quite difficult to change between the two once the code begins to flow. Making the right decision up front is important in any of these scenarios no matter how small or large the project.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Let's 1st speak to the advantages of the MVC framework. 1st and foremost in my book is the Architecture itself: M-V-C. It is going to be tough to break this model and rearrange how the application is built. Having your or your team's hand forced into a stable and mature architecture like MVC is&lt;i&gt; a good thing&lt;/i&gt;. Raise your hand (like anyone can see...) if you have ever seen or maybe written one of those spaghetti sandwich ASP.NET web forms application that has raw SQL right behind "btnSave_Click()". Blah! Awful nasty, all code-behind the forms, non-scalable mess of an application. So 'point' to MVC for guiding developers to a decent architecture. You &lt;i&gt;can &lt;/i&gt;adhere to several good architectures using ASP.NET, but it is up to the developer or team of developers to be disciplined enough to stick to the architecture and not lay back on a fat UI layer. Separation of concerns is a key Object Oriented Concept and a real winner for the MVC architecture. Each layer has its own responsibility, and placing the proper code in its responsible layer will make for a much better code base to scale, maintain, inherit, etc.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Next ASP.NET MVC allows the developer to have "Full Control" over the rendered HTML. For now I am going to leave this as an advantage for MVC, but caution that not everyone fully understands what this means, and it might not be advantageous for a vast majority of applications not needing this type of control.  Let me elaborate a bit; that wonderful winter of 2001 when many of our lives took a turn for the better as Scott Guthrie (Twitter handle: @scottgu) came up with what is ASP.NET web forms, and decided while sipping hot cocoa that if you drug a label onto a web form, it would get rendered as a DIV tag. He made this decision (or Microsoft) and not you. You pick the ASP.NET server controls you want to drag onto a web form, but don't have control over what HTML elements actually get rendered on the client as a result. You just know that when a Gridview is dragged onto a form, it will be displayed on the client. You don't know (or need to in many situations) that it might be a series of DIVs and Input HTML controls. This abstraction is actually an advantage for ASP.NET web forms. For many web applications built, we have relied on this drag and drop capability, and trusted the final output that will be rendered to ASP.NET. However, if you have ever found the way the ASP.NET sever controls get rendered is not &lt;i&gt;exactly &lt;/i&gt;how you want or need it, then MVC is a better choice as it will allow you to have control over the final rendering. If you do not have any main issues with how ASP.NET web form server controls get rendered in your applications, then this might not be an "advantage" that you can sell to your tech manager or team when trying to build the next project using MVC.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Another advantage of using ASP.NET MVC that ties back into the individual layers is testability, specifically unit testing. Because the application is loosely coupled with code in its separate layers, the ability to create unit tests increases greatly. The event based ASP.NET pages that rely on things like Session, Context, Response, etc are quite difficult to effectively test because of the inability to isolate specific page functionality due to its nature of being spread out and external dependencies as well. MVC improves on this greatly, and is architected to be testable. 'Point' MVC.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;So let's examine ASP.NET web forms for a minute. As I mentioned they were born sometime in late 2001, so maturity and a rich tool set (both from Microsoft and 3rd party) is a big advantage. These "tools", or ASP.NET server controls make up a style of development referred to often when speaking of ASP.NET web forms called RAD or Rapid Application Development. "Hey I can drag a few ASP.NET text boxes, some labels, this Gridview thingy, press publish, and WHAT??!! I have a website!" Now that website might be junk, but hey its done already. On to the next project, right? Well not quite. 'Fast', especially in our field doesn't mean better. That site might be done, but as eluded to prior, its design is junk and it will not maintain or scale well. But what if you &lt;i&gt;know &lt;/i&gt;the scope is a single, simple page? Well then a tool like web forms is probably perfect, and MVC might be overkill if speed of development is of the essence. Don't be fooled, web forms + data binding, etc. will be faster to generate just based on the drag-and-drop + wizardry capabilities. Just don't have a code review and everything will be fine! So the RAD capabilities of ASP.NET web forms can be a double edged sword. A quality ASP.NET web forms with a pre-determined architecture (3-layer, Domain Driven Design, MVP, etc.) that uses developers with discipline to adhere to it, is a much better choice when creating ASP.NET web form applications.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Along these lines is another advantage with web forms and that is 'Experience'; specifically in relation to a developer's experience with the technology. Again with web forms being a mature technology going on 10 years, there is a solid developer core with ample experience. If you are leading a team of 8-10 developers, you are the only one with MVC experience, and everyone else knows web forms, then this needs to play into your decision of which technology to use. Are you prepared to take the financial impact of formal MVC training through remote seminars, current books, or on-sight training? Can you afford the 1-3 month setback while the team gets up to speed on ASP.NET MVC to say a beginner/intermediate level? If these are not an issue, and the advantages of ASP.NET MVC mentioned previously are present, then it may be the better choice regardless of the upfront cost in time, money, etc. If however, you need to begin writing code immediately with a team of web form rich experience developers and are under a tight deadline, then maybe holding off on using MVC is the better decision. In the end you need to weigh the factors to make the best decision.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;There are some other disadvantages to the web forms technology that I will mention briefly here as well. The web form's postback model uses client side generated '_doPostBack()' events for each server callback. If JavaScript is disabled this will cause several problems for the web forms application. It is also difficult to manipulate manually if writing your own client side scripts. MVC improves on this using REST based URLs. The next disadvantage with web forms is ViewState. Referring back to my comments about poorly designed web form applications, a bloated ViewState can cause pages to be larger and slower than they need to be. ViewState stores a base64 encoded string with information about controls state to persist postbacks and to help combat the stateless nature of the web. This however becomes a disadvantage for web forms when abused.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Now let's throw a cog into the wheel and add in another choice for web development in the .NET realm: Silverlight. Oh yeah, and honestly my favorite when it comes to rich UI content. However, you still need a hosting application and Silverlight can be integrated into either ASP.NET web forms or ASP.NET MVC applications. And I don't want to confuse anyone either because Silverlight is not an entire 'web' Framework onto its own and only works alone as individual controls. The Silverlight controls integrate into a web forms or MVC application as just another control and can co-exist with controls of either technology. However, since Silverlight can't invoke the controller class in MVC, or directly postback to the server when using web forms, you will need to use services (WCF) to accomplish this task. Anyone using Silverlight previously knows that WCF services can bridge the gap between the Silverlight control and the server.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Decisions, decisions, which technology to pick? There is a lot to weigh when it comes to these two technologies: ASP.NET web forms or ASP.NET MVC. Are you trying to draw a line in the sand and say, "Only MVC web apps from here on out!!" Personally I would not do that, because it wasn't like 10 years ago when we moved from classic ASP to ASP.NET and &lt;i&gt;were &lt;/i&gt;able to be that bold. Now ASP.NET MVC has to be looked at as another tool (a very powerful and cool one) in the proverbial toolbox.  There will be a time when MVC is the proper decision, and a time when web forms is the proper one. I &lt;i&gt;&lt;b&gt;strongly &lt;/b&gt;&lt;/i&gt;urge those picking web forms to at a minimum not fall into the trap of bad or poorly architected code, and be disciplined to use an architecture that is more scalable and maintainable (check my review of the book &lt;u&gt;&lt;a href="http://allen-conway-dotnet.blogspot.com/2010/11/book-review-professional-aspnet-design.html"&gt;Professional ASP.NET Design Patterns&lt;/a&gt;&lt;/u&gt;). And lastly and maybe most importantly, be a 'realist' and not a 'purist' when making this decision. Do what is best and right, and not just which one theoretically is better in argument. This will help you decide. Either way its great to be a .NET developer with such a plethora of technologies to choose from.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-5500289327771212331?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/5500289327771212331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/03/aspnet-web-forms-vs-aspnet-mvc.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5500289327771212331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5500289327771212331'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/03/aspnet-web-forms-vs-aspnet-mvc.html' title='ASP.NET Web Forms vs. ASP.NET MVC'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-616698640051598248</id><published>2011-03-09T23:04:00.000-05:00</published><updated>2011-03-10T08:06:33.178-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How To: Encode a JavaScript string in .NET To Escape Characters (i.e. Single Quotes) Automatically</title><content type='html'>&lt;span style="font-family:arial;"&gt;There is a handy new Utility method new to the .NET Framework 4.0 found in the System.Web.HttpUtility namepsace called HttpUtility.JavaScriptStringEncode. It allows you the developer to create any string needed and URL encodes it to be usable by JavaScript.&lt;br /&gt;&lt;br /&gt;Ever tried making a Utility method to create a script to be registered with the page in ASP.NET that will popup a JS alert box and takes a message? Ever see what happens when you try and place a single quote in the value like "The value 'x' is not allowed"? The JS will error out on the page with a " Expected ')' " type error message. If you use the utility mentioned above, the encoding is done for you and injects any needed escape characters. The line of code below shows how this might be done in .NET code:&lt;/span&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Dim Message As String = "The value 'x' is not allowed"&lt;br /&gt;'URL Encode the message prior to registering with the page&lt;br /&gt;Dim JsAlert As String = "alert('""" &amp;amp; HttpUtility.JavaScriptStringEncode(Message) &amp;amp; """');"&lt;br /&gt;ClientScript.RegisterStartupScript(Page.GetType(), "AlertJsFunction", JsAlert)&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-616698640051598248?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/616698640051598248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/03/how-to-encode-javascript-string-in-net.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/616698640051598248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/616698640051598248'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/03/how-to-encode-javascript-string-in-net.html' title='How To: Encode a JavaScript string in .NET To Escape Characters (i.e. Single Quotes) Automatically'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-3102375589654706587</id><published>2011-02-28T22:00:00.001-05:00</published><updated>2011-03-01T10:02:32.944-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Training'/><category scheme='http://www.blogger.com/atom/ns#' term='VSLive'/><title type='text'>Visual Studio Live! is coming up soon (April 18-22) in Las Vegas</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you’ve never been to Visual Studio Live, it offers developers, programmers, software engineers and architects an unbiased blend of practical and immediately-applicable training in Visual Studio, Silverlight, WPF, .NET and more. Plus, there will be 2 new tracks on mobile development and HTML5 this year! Check out the Visual Studio Live! Agenda at &lt;a href="http://bit.ly/VSLiveTrks"&gt;http://bit.ly/VSLiveTrks&lt;/a&gt;. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-3102375589654706587?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/3102375589654706587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/02/visual-studio-live-is-coming-up-soon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3102375589654706587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3102375589654706587'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/02/visual-studio-live-is-coming-up-soon.html' title='Visual Studio Live! is coming up soon (April 18-22) in Las Vegas'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-8826090803167666986</id><published>2011-02-28T21:50:00.001-05:00</published><updated>2011-03-01T09:56:58.616-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VSS'/><title type='text'>Legacy SourceSafe: How To Find Checked Out Files By User</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you still happen to be using Microsoft SourceSafe, stop and use Team Foundation Server ;) No all kidding aside, you may still use VSS or be ready to migrate to a newer platform like TFS and need to do some cleanup or preparation first. One common task is to find out all of the files checked out by an individual user.&lt;br /&gt;&lt;br /&gt;You can accomplish this using the &lt;strong&gt;SS.exe&lt;/strong&gt; tool that is installed alongside SourceSafe. It is located in the following directory:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C:\Program Files\Microsoft Visual Studio\VSS\win32&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To open the tool, open a command prompt (I used Visual Studio .NET's Command Line Tool) and change directories to the location of SS.exe like below (if your files do truly exist on the C:\ drive):&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CD C:\Program Files\Microsoft Visual Studio\VSS\win32&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now you are ready to issue commands to the SS.exe tool. You might wonder why you can’t just open it directly, but if you try only the screen flashes and the VSS help for the tool is opened. You must run commands against the tool in an existing command window session.&lt;br /&gt;&lt;br /&gt;The command to fins all checked out files in VSS by user is as follows:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ss.exe Status $/ -R -U &amp;lt;username&amp;gt; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The 'Status' command extracts checked out file information, the '-R' switch dictates the search will be recursive to subprojects, and the "-U" switch specifies a user name. So if we had a username "jsmith" we could update the command to be more specific as follows:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ss.exe Status $/ -R -U &lt;span style="color:#009900;"&gt;jsmith&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Upon pressing enter, please be patient. The search process can take quite some time, especially if there are a lot of files in VSS. The result set will show the project and files checked out by the user specified. If needed, you can copy all of the results into notepad, by right-clicking on the window title, and selecting &lt;strong&gt;Edit&lt;/strong&gt; -&gt; &lt;strong&gt;Select All&lt;/strong&gt; ...and then &lt;strong&gt;Edit&lt;/strong&gt; -&gt; &lt;strong&gt;Copy&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;For more detailed information on the SS.exe command tool and its Command Options, please check out the links below: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/hsxzf2az(v=vs.80).aspx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;MSDN: Command Options&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/5ws92cw2(v=vs.80).aspx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;MSDN: SS Utility&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-8826090803167666986?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/8826090803167666986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/02/legacy-sourcesafe-how-to-find-checked.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8826090803167666986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8826090803167666986'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/02/legacy-sourcesafe-how-to-find-checked.html' title='Legacy SourceSafe: How To Find Checked Out Files By User'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-8870373427753435433</id><published>2011-02-16T23:32:00.002-05:00</published><updated>2011-02-16T23:49:43.761-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Workaround For VS.NET ASP.NET Design Tab Not Rendering Controls</title><content type='html'>&lt;span style="font-family:arial;"&gt;As of recent, most all of the projects I have been working on are in VS.NET 2010 using .NET Framework 4.0, and several are upgrades from .NET Framework 3.5 VS.NET 2008 solutions. I &lt;em&gt;rarely&lt;/em&gt; use the 'Designer' tab to preview the generated controls of my ASP.NET pages, but in some instances I want to see the wizard of a control for configuration (i.e. Object Data Source Control). Not that there isn't code I couldn't just create by hand, but sometimes it is faster to have the code auto-generated for me. In this case I needed to have the control render in Design view.&lt;br /&gt;&lt;br /&gt;On this note I will say I am not a big fan of the 'Design' tab to view auto-generated pages. I do not believe VS.NET uses the same rendering engine to show the auto-generated pages as is when the page is rendered in IIS. Therefore early on I found inconsistencies and nuances that showed visual differences between the two (design and run time), so I all but abandoned using the IDE 'Design' view. In fact I think one becomes a more proficient ASP.NET and web developer in general when you can begin to visualize the web pages during coding without needing a 'picture' to see after every line of code is written. Then run the page either in either the local dev server through VS.NET or in IIS to have it render properly, and then use any of the following to break down a page when needed: IE Developer Tools (IE), &lt;a href="http://getfirebug.com/firebuglite#Stable"&gt;FireBug Lite &lt;/a&gt;(IE or FireFox), Chrome Developer Tools (Chrome).&lt;br /&gt;&lt;br /&gt;Back to the problem at hand - I noticed that ALL of my pages (content pages of a single simple Master page) show the message "&lt;span style="color:#ff0000;"&gt;response is not available in this context&lt;/span&gt;" for all of my controls when accessing via the design view. I had tried deleting the page from my project, adding a new page, and copying back in the source and code; same error. I also tried cutting out controls 1 at a time, and clicking "Refresh" in the designer but that was not working either. Clearing all cached pages in the Temporary ASP.NET directories did fix the problem either.&lt;br /&gt;&lt;br /&gt;Having all of my pages with the same issue, helped direct me to a class that all pages were inheriting from. In this class there is a method to Override the OnInit() method to run some common functionality. Within this method there was code to set properties on the HttpResponse object. Therein lies the problem. Making calls to manipulate the HttpResponse object and getting the error message: "response is not available in this context".&lt;br /&gt;&lt;br /&gt;The fix is simple and straight forward. One way would be just to comment out the code, but this has its downside with no explanation needed. I wanted something more maintenance free. There was a better solution: if there is NO HttpContext avalaible, then do not attempt to access it, or the HttpResponse object. While in the VS.NET IDE and viewing the 'Design' tab, it makes sense that the HttpContext is not available and therefore any related code should be skipped.&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt; 'Do not attempt to access the HttpContext if it does not exist (i.e. in Design mode of IDE)&lt;br /&gt; If HttpContext.Current IsNot Nothing Then&lt;br /&gt;   'Do not cache the web page        &lt;br /&gt;    Response.CacheControl = "no-cache"&lt;br /&gt; End If&lt;br /&gt;&lt;/pre&gt;One interesting thing I found in researching this issue was that cleaning the solution (which clears the \bin of all compiled code) and then viewing the page in the 'Design' tab with the above Response code only (no "If HttpContext.Current IsNot Nothing"), the page &lt;em&gt;would&lt;/em&gt; display. As soon as I built the solution, and did not have the workaround above, I would go back to receiving the "response is not available in this context" error. So the IDE must be rendering the page differently based on if it has been compiled or not already, and possibly only showing the rendered page strictly on HTML and not on any precompiled code-behind in this situation. This is lower level details of the VS.NET IDE that I am unsure about. The main point here is to use the logic in the code example above to be more explicit about when that code will be ran, and when it will be skipped.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-8870373427753435433?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/8870373427753435433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/02/workaround-for-vsnet-aspnet-design-tab.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8870373427753435433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8870373427753435433'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/02/workaround-for-vsnet-aspnet-design-tab.html' title='Workaround For VS.NET ASP.NET Design Tab Not Rendering Controls'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-6056667512352851460</id><published>2011-01-30T22:36:00.002-05:00</published><updated>2011-01-31T10:42:52.131-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2010'/><title type='text'>Spell Checker Extension For VS.NET 2010</title><content type='html'>&lt;span style="font-family:arial;"&gt;OK there is a really useful extension available for free to VS.NET 2010 named "Spell Checker". It shows misspelled words within commented sections with the traditional red squiggly line under the word as seen in Office products. Obviously correctly spelled words are not critical to an applications performance, but well formed internal documentation that reads well such as commenting is important.&lt;br /&gt;&lt;br /&gt;You can download it for free by going to Tools -&gt; Extension Manager and then select 'Online Gallery' from the left-hand side. In the search box type in the top-right hand corner, type in "spell checker" and search. The 1st extension created by Roman Golovin and Michael Lehenl (thank you) named "Spell Checker" is the one to download and install (shown below).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/TUbXkhgfbEI/AAAAAAAAAJ4/kvzS4423SHQ/s1600/SpellCheckerExtension.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 60px;" src="http://2.bp.blogspot.com/_o-C99bmODDI/TUbXkhgfbEI/AAAAAAAAAJ4/kvzS4423SHQ/s400/SpellCheckerExtension.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5568375011760106562" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see below, just hover the mouse over the misspelled word for the little box to display, which upon clicking will bring up the properly spelled words. There is also the ability to "Add to dictionary" which is nice, because often many words we use are technical and not in the dictionary. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/TUbXW1Mi_EI/AAAAAAAAAJw/NJigjlZvQyk/s1600/SpellCheckerVSNET.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 349px; height: 174px;" src="http://2.bp.blogspot.com/_o-C99bmODDI/TUbXW1Mi_EI/AAAAAAAAAJw/NJigjlZvQyk/s400/SpellCheckerVSNET.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5568374776526994498" /&gt;&lt;/a&gt;&lt;br /&gt;It can also be downloaded directly from the link below:&lt;br /&gt;&lt;b&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/7c8341f1-ebac-40c8-92c2-476db8d523ce?SRC=VSIDE" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline; color:#0000ff;"&gt;Spell Checker Extension for VS.NET&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-6056667512352851460?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/6056667512352851460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/01/spell-checker-extension-for-vsnet-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6056667512352851460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6056667512352851460'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/01/spell-checker-extension-for-vsnet-2010.html' title='Spell Checker Extension For VS.NET 2010'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_o-C99bmODDI/TUbXkhgfbEI/AAAAAAAAAJ4/kvzS4423SHQ/s72-c/SpellCheckerExtension.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7920462456171247302</id><published>2011-01-26T22:33:00.003-05:00</published><updated>2011-01-27T11:59:54.778-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='Lambda Expressions'/><title type='text'>Use LINQ To Get The SUM Or Total Of A Property Value On An Object Collection</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you have an object collection say List(Of &amp;lt;T&amp;gt;) and you want to add up all of the values of a single property of the proper type (Integer, Double, etc.), you can do this using LINQ and a lambda expression. We will use the SUM LINQ Extension Method directly on the collection that implements IEnumerable(T), and provide it an anonymous function that takes the property value to be added together. So here is the code using an object collection which I had already populated previously:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;'Use the LINQ SUM Extension Method to iterate over the collection and extract the total.&lt;br /&gt;Dim Total = MyDataCollection.Sum(Function(x) x.PropertyOnXToSumTogether)&lt;br /&gt;&lt;/pre&gt;The anonymous function takes a parameter which will represent the individual instance of the collection, and then uses the property designated to be iterated over and added to the total. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7920462456171247302?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7920462456171247302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/01/use-linq-to-get-sum-or-total-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7920462456171247302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7920462456171247302'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/01/use-linq-to-get-sum-or-total-of.html' title='Use LINQ To Get The SUM Or Total Of A Property Value On An Object Collection'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-3264898304229095300</id><published>2011-01-26T21:50:00.000-05:00</published><updated>2011-01-27T11:53:34.903-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><category scheme='http://www.blogger.com/atom/ns#' term='Cassini'/><title type='text'>Using Fiddler With VS.NET And The Local Web Development Environment 'Cassini'</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you use Fiddler to monitor traffic to your web sites, you have probably found it useful for debugging issues like 404's or 403's etc. However if you want to have Fiddler show traffic from sites you are debugging through your local VS.NET web development server, then you need to add a '&lt;strong&gt;.&lt;/strong&gt;' period after the word 'localhost' in the URL. Also make sure to add it prior to the designated port as displayed below.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/TUBOXcj_zSI/AAAAAAAAAJY/ilU75wCC-jQ/s1600/URLWithDot.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 229px; DISPLAY: block; HEIGHT: 30px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5566535304141065506" border="0" alt="" src="http://3.bp.blogspot.com/_o-C99bmODDI/TUBOXcj_zSI/AAAAAAAAAJY/ilU75wCC-jQ/s400/URLWithDot.png" /&gt;&lt;/a&gt;&lt;br /&gt;After refreshing the page, you can see the output in Fiddler. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_o-C99bmODDI/TUBOj0ZvI0I/AAAAAAAAAJg/HsrQTtxm_gk/s1600/FiddlerLocal.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 400px; DISPLAY: block; HEIGHT: 34px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5566535516698911554" border="0" alt="" src="http://1.bp.blogspot.com/_o-C99bmODDI/TUBOj0ZvI0I/AAAAAAAAAJg/HsrQTtxm_gk/s400/FiddlerLocal.png" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-3264898304229095300?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/3264898304229095300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/01/using-fiddler-with-vsnet-and-local-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3264898304229095300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3264898304229095300'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/01/using-fiddler-with-vsnet-and-local-web.html' title='Using Fiddler With VS.NET And The Local Web Development Environment &apos;Cassini&apos;'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_o-C99bmODDI/TUBOXcj_zSI/AAAAAAAAAJY/ilU75wCC-jQ/s72-c/URLWithDot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7664908452982216745</id><published>2011-01-24T22:24:00.005-05:00</published><updated>2011-01-25T15:30:34.987-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How To: Scroll To The Bottom of an ASP.NET Web Page After Postback</title><content type='html'>&lt;span style="font-family:arial;"&gt;Not a post about bleeding edge technology here, but just a little technique I ran across here for ASP.NET web pages. I needed a way to have the focus shift to the bottom of a page after a button near the top of the screen was pressed. Unfortunately setting focus via Page.SetFocus(Me.BottomOfPageServerControl.ClientID) did &lt;em&gt;kind&lt;/em&gt; of work, but only shifted to the top of the control, and the control had a large height. Therefore the scroll bar was still not at the bottom, and the resulting pertinent data in my situation was at the bottom of the page.&lt;br /&gt;&lt;br /&gt;The solution? Place a server control at the bottom of the page with CSS properties that prevent it from physically being viewed, don't affect scroll bars, and yet can still have focus shifted to it.&lt;br /&gt;&lt;br /&gt;So begin by placing an ASP.NET button (or any other small server control) at the bottom of your markup, and add some inline styling to be most compact and streamlined if you wish:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&amp;lt;!--Button will render, but not actually be visible to the client--&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="ui_btnPageBottom" runat="server" Text="Button" style="margin-left:-999px;" /&amp;gt;&lt;br /&gt;&lt;/pre&gt;Notice above the styling places it off the page, but the button will not create any lengthy scroll bars, etc. Lastly, add the code server side on the 'Finally' of the button click event to shift focus to the bottom of the page:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Try&lt;br /&gt;  'Code&lt;br /&gt;Finally&lt;br /&gt;  'Regardless of outcome, set focus to the bottom of the page&lt;br /&gt;  Page.SetFocus(Me.ui_btnPageBottom.ClientID)&lt;br /&gt;End Try&lt;br /&gt;&lt;/pre&gt;That's it! I am sure there are at least 20 ways to do this, including a purely client side solution with JavaScript, but this was 2 lines of code to accomplish what I needed.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7664908452982216745?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7664908452982216745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/01/how-to-scroll-to-bottom-of-web-page.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7664908452982216745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7664908452982216745'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2011/01/how-to-scroll-to-bottom-of-web-page.html' title='How To: Scroll To The Bottom of an ASP.NET Web Page After Postback'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-4493300991436135539</id><published>2010-12-09T23:05:00.001-05:00</published><updated>2010-12-10T14:09:12.738-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS 7.5'/><category scheme='http://www.blogger.com/atom/ns#' term='.ASMX Services'/><title type='text'>Tip On Preventing Web Discover Service Error</title><content type='html'>&lt;span style="font-family:arial;"&gt;I have been using .asmx web services for about 7 years now, and have not run into too many issues while consuming valid URLs in VS.NET. And although I am not creating new .asmx services today because I prefer (as should you) WCF services, I still have some that have yet to be converted.&lt;br /&gt;&lt;br /&gt;One service in particular was giving me issue upon consuming in VS.NET 2010 with the following error message in a dialog box named "Web Discovery Service":&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;em&gt;"Unable to download following files from . https://myservice08.mycompany.com:3567/MyService.asmx?wsdl Do you want to skip these files and continue?"&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;Well I found very little documentation on this issue (actually only 2 sites on Google), but I did manage to find the solution which on the surface appears quite obvious after explanation.&lt;br /&gt;&lt;br /&gt;It started when I moved an upgraded copy of this service (Framework 4.0, IIS 7.5, etc) to a new server. However I had the "myservice" SSL certificate imported and applied to this service in IIS that was named "myservice08" (name was only for testing). I knew ahead of time that I would get certificate mismatch errors ("myservice" &lt;&gt; "myservice08")  because the SSL cert didn’t match the sites host name, but I figured for testing I could bypass and be OK. Well this ended up being a showstopper, because not only did I get the warning about the SSL certificate not matching the host name upon consumption, I got the other error reported above as well (which is not nearly as indicative of the SSL mismatch being as issue). In fact I was really thrown off because the .asmx service would still come up in the browser showing the wsdl just fine.&lt;br /&gt;&lt;br /&gt;So if you ever are working with legacy .asmx services and are receiving the same error I did upon consuming within VS.NET, make sure that the SSL cert name and the hostname of the service are identical. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-4493300991436135539?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/4493300991436135539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/12/tip-on-preventing-web-discover-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4493300991436135539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4493300991436135539'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/12/tip-on-preventing-web-discover-service.html' title='Tip On Preventing Web Discover Service Error'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-839509417992229152</id><published>2010-11-30T23:51:00.006-05:00</published><updated>2010-12-08T10:40:13.511-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS 7.5'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS 7.0'/><title type='text'>How To Use Impersonation in ASP.NET Configuration With IIS 7.5 And Integrated Pipeline</title><content type='html'>&lt;span style="font-family:arial;"&gt;While working on a few applications that have Impersonation="True" in my ASP.NET configuration, I ran into the following error upon deployment to an IIS 7.0 or 7.5 server:&lt;br /&gt;&lt;br /&gt;"&lt;span style="color:#ff0000;"&gt;HTTP Error 500.24 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;This is essentially a 'flag' warning that is raised when using Impersonation in your web.config and deploying to an IIS 7.0+ server using an Application Pool with Integrated Pipeline. If this configuration was mistakenly added, you can remove the configuration or set it to 'False' to fix the problem. There are (2) solutions for those that &lt;em&gt;do&lt;/em&gt; need Impersonation="True".&lt;br /&gt;&lt;br /&gt;1. Switch the Application Pool on IIS to use a 'Classic' Pipeline.&lt;br /&gt;2. Add the following configuration to your web.config under the &amp;lt;system.webserver&amp;gt; section:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;  &amp;lt;system.webServer&amp;gt;&lt;br /&gt;     &amp;lt;!--When using 'Integrated Pipeline' on IIS on the server, and if your application does not rely on impersonating the requesting user in the 'BeginRequest' and 'AuthenticateRequest' stages (the only stages where impersonation is not possible in Integrated mode), but still requires Impersonation in other areas of the application, ignore this error (500 - Internal Server Error) by adding the following to your application’s web.config--&amp;gt;&lt;br /&gt;     &amp;lt;validation validateIntegratedModeConfiguration="false"/&amp;gt;&lt;br /&gt;  &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I actually used the explanation from the following helpful IIS Blog link (&lt;b&gt;&lt;a href="http://mvolo.com/blogs/serverside/archive/2007/12/08/IIS-7.0-Breaking-Changes-ASP.NET-2.0-applications-Integrated-mode.aspx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline; color:#0000ff;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;) to create the XML comment above the configuration, and I reccomend reading it for a more in depth explination direct from an IIS Program Manager.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-839509417992229152?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/839509417992229152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/how-to-use-impersonation-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/839509417992229152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/839509417992229152'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/how-to-use-impersonation-in-aspnet.html' title='How To Use Impersonation in ASP.NET Configuration With IIS 7.5 And Integrated Pipeline'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-6239934458972149557</id><published>2010-11-22T22:19:00.001-05:00</published><updated>2010-11-23T10:26:23.149-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Review'/><category scheme='http://www.blogger.com/atom/ns#' term='Archiecture'/><title type='text'>Book Review: Professional ASP.NET Design Patterns By Scott Millett</title><content type='html'>&lt;span style="font-family:arial;"&gt;Let me begin by stating that &lt;span style="TEXT-DECORATION: underline"&gt;Professional ASP.NET Design Patterns&lt;/span&gt; is a fantastic book that was worth every minute I spent reading it. The author, Scott Millett, is a great community leader and extends himself in several ways including spending time on the forums contributing to others into his strong insight of Domain Driven Design, Architecture, and Design Patterns. He has extended that helpfulness by writing this book that takes a dive into Design Patterns and Architecture from an ASP.NET UI centric view. However I would not get too fixated on the 'ASP.NET' in the title as probably more than half of this book could just as well have been called "Professional .NET Design Patterns" as it provides design patterns that are truly useful to all types of .NET applications once moving below the topmost UI layer. There are several chapters devoted to ASP.NET patterns including MVC which makes this still focused mostly on ASP.NET, but I would still recommend this book to WinForms and other SmartClient developers as well.&lt;br /&gt;&lt;br /&gt;This book's target audience is broad and could reach to several different types of software engineers. It is probably suited best for Senior Engineers, Architects, Leads, or generally seasoned developers. It is not really an introductory book (this is a good thing; there are plenty of those books out there already), so if you don't know what acronyms like OOP, OOD, UI, BLL, or DAL mean at a minimum already then you may want to read something along the lines of an introduction to Object Oriented Programming book 1st to gain some traction. This is however a terrific book for those that do have a lot of experience with a traditional 3-layer logical architectures, and are looking to bridge the gap to more sophisticated architectures using Domain Driven Design and other implementations of either Martin Fowler's or the GoF design patterns within.&lt;br /&gt;&lt;br /&gt;Scott does a wonderful job of layering the book (chapters) as you would an application. Each chapter takes either a single layer or design pattern and goes into detail on its responsibilities, relationship to other layers, and implementation with easy to follow along code samples. In fact I highly recommend downloading the code samples from the WROX website (&lt;b&gt;&lt;a href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-ASP-NET-Design-Patterns.productCd-0470292784,descCd-DOWNLOAD.html" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;WROX Code Download&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;) The entire set of code samples are in C#, but don't let this slow up any VB.NET devs out there. I am actually a VB.NET developer (C# in the past) but we all know that you don't get too far in this industry without reading both so this should not be any problem.&lt;br /&gt;&lt;br /&gt;The 1st third of the book (roughly) concentrates mostly on individual logical layers of an application and how they work together to build an application. Within each layer, there are examples of Design Patterns (both Fowler and GoF) that are used and shown why they are useful within that particular layer. There is also a section on IoC and DI which I really enjoyed and are reoccurring patterns in the layers throughout the book. The 2nd third of the book concentrates mostly on ASP.NET architectures and techniques like MVC, MVP, and AJAX patterns. The last third is devoted to a case study example that uses the knowledge gained from the previous chapters. The book reads and flows extremely well and was one of the reasons I enjoyed reading it so much.&lt;br /&gt;&lt;br /&gt;I will also note that this is a great book for those of you familiar or have read the GoF book &lt;span style="TEXT-DECORATION: underline"&gt;Design Patterns Elements of Reusable Object Oriented Software&lt;/span&gt;. As we all know code examples used to conceptually explain design patterns are not always critical, but Scott's book puts a fresh '.NET' perspective on several of the GoF patterns which is really nice. This helps to see how these patterns apply directly in .NET instead of taking the SmallTalk or C++ examples from the GoF book and translating them into .NET.&lt;br /&gt;&lt;br /&gt;The book wraps up with a full case study example putting all of the chapters together (Agath's e-commerce store). This again strengthens the flow of the book with an extended example using everything learned from the previous chapters, This solution is included in the 'Chapter 14' folder in the downloadable code and is a nice reference to show everything from the book.&lt;br /&gt;&lt;br /&gt;Well I will wrap this review up by saying this book is one for the shelf of 'Top Reference' books that go right next to the development machine. This is one of those books that you think, "How do I do that in the Repository Layer...", and then pick up the book to get a refresher. I would definitely recommend this book and keep an eye out for future books from Scott Millett. Nice Job! &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-6239934458972149557?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/6239934458972149557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/book-review-professional-aspnet-design.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6239934458972149557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6239934458972149557'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/book-review-professional-aspnet-design.html' title='Book Review: Professional ASP.NET Design Patterns By Scott Millett'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-2917801815086937980</id><published>2010-11-15T22:17:00.007-05:00</published><updated>2010-12-01T15:29:17.125-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio Live'/><category scheme='http://www.blogger.com/atom/ns#' term='Training'/><category scheme='http://www.blogger.com/atom/ns#' term='VSLive'/><title type='text'>Day 2: Visual Studio Live! Orlando 2010</title><content type='html'>&lt;span style="font-family:arial;"&gt;Another beautiful and informative day here in Orlando, FL at Visual Studio Live 2010. I would have to pull my old conference materials for comparison, but I really like the 4-5 class per day format. I seem to remember 6 or more classes per day in the past which can maker for a really long day especially if learning new concepts. However, this format has been perfect.&lt;br /&gt;&lt;br /&gt;Had great classes with industry leaders like Leonard &lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;Lobel&lt;/span&gt;, Gus Emery, and Jason Bock. I also must note that one of the best byproducts of these conferences is the side conversations and networking that occurs informally. Everyone at these conferences is here for one reason: they are the leaders of their respective teams or companies in reference to software development and related ares and love what we do. For this reason, everyone is eager to chat, talk, and discuss their jobs, work, applications, etc which is quite nice.&lt;br /&gt;&lt;br /&gt;One new product I learned of today was Microsoft &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;WebMatrix&lt;/span&gt;. &lt;a href="http://www.asp.net/webmatrix"&gt;http://www.asp.net/webmatrix&lt;/a&gt; This is an all inclusive tool to rapidly build web applications using shared &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;pre&lt;/span&gt;-built components built by the development community, and hosted on &lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;IIS&lt;/span&gt; Development Express. What I was instantly amazed by was how Rabi &lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;Satter&lt;/span&gt; (@rsatter42) wrote in '1' line of code (no joke) a Twitter client that searches for a keyword that took me probably 500-1000 lines of code (between &lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;Silverlight&lt;/span&gt; client and &lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;WCF&lt;/span&gt; proxy service) to do essentially the same thing. OK no denying that is nice, and the technology offers more of the same (Twitter, &lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;Facebook&lt;/span&gt;, Wiki, Blogs, &lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;PayPal&lt;/span&gt;, etc). It is still in Beta and will probably not revolutionize web development and having everyone run away from their current platforms, but it certainly will have a presence.&lt;br /&gt;&lt;br /&gt;Lastly, I had the unique and great pleasure of dining this even with 2 prominent leaders of our industry, Rocky &lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;Lhotka&lt;/span&gt; and Jason Bock. Seeing how I have listened to them speak, read books from them, Twitter feeds, blogs, etc. it was a real nice experience to hang out with not only some top echelon developers, but also some just really cool guys. Everyone at dinner liked the band Rush (hey, who doesn't) which made for some good conversation as well. I hope to hook up with you guys more in the future and highly recommend those of you in the industry to check these guys blogs out as well: &lt;a href="http://www.lhotka.net/"&gt;http://www.lhotka.net/&lt;/a&gt; and &lt;a href="http://www.jasonbock.net/JB/Default.aspx"&gt;http://www.jasonbock.net/JB/Default.aspx&lt;/a&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-2917801815086937980?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/2917801815086937980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/day-2-visual-studio-live-orlando-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2917801815086937980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2917801815086937980'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/day-2-visual-studio-live-orlando-2010.html' title='Day 2: Visual Studio Live! Orlando 2010'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-4326783900835590267</id><published>2010-11-14T22:39:00.002-05:00</published><updated>2010-11-14T22:57:36.242-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio Live'/><category scheme='http://www.blogger.com/atom/ns#' term='Training'/><category scheme='http://www.blogger.com/atom/ns#' term='VSLive'/><title type='text'>Day 1: Visual Studio Live! Orlando 2010</title><content type='html'>&lt;span style="font-family:arial;"&gt;This is my 3rd Visual Studio Live (formally &lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;VSLive&lt;/span&gt;!) and I am enjoying it &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;as&lt;/span&gt; much as ever. If you ever get the chance to attend one of these events (Orlando, &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;Las&lt;/span&gt; Vegas, Redmond, etc.) try and do it. The information is terrific and the insight from experienced presenters, peers in our industry, and general networking make it all worth it.&lt;br /&gt;&lt;br /&gt;Today I &lt;span id="SPELLING_ERROR_3" class="blsp-spelling-corrected"&gt;attended&lt;/span&gt; the workshop named "Making Effective Use of &lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;Silverlight&lt;/span&gt; and &lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;WPF&lt;/span&gt;" with Rocky &lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;Lhotka&lt;/span&gt; (@RockyLhotka on Twitter) and Billy Hollis (http://slmasters.net/). Talk about (2) all-stars of our industry. Billy's knowledge of &lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;UI&lt;/span&gt; design with &lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;Silverlight&lt;/span&gt; and &lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;WPF (and other UI technolgoes too WinForms, etc)&lt;/span&gt; combined with Rocky's experience being an experienced &lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;OOP&lt;/span&gt; and Architecture engineer (research &lt;span id="SPELLING_ERROR_11" class="blsp-spelling-error"&gt;CSLA&lt;/span&gt;.NET) makes for a wonderfully informative day.&lt;br /&gt;&lt;br /&gt;I had the pleasure of being on the front row for the presentation and enjoyed the back and fourth complimentary knowledge of .NET technologies. &lt;span id="SPELLING_ERROR_12" class="blsp-spelling-corrected"&gt;Unfortunately&lt;/span&gt; for me, I asked a question regarding a .&lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;xap&lt;/span&gt; being downloaded to the client, potentially exposing sensitive code (for a small % of shops, or developers still using antiquated architectures with &lt;span id="SPELLING_ERROR_14" class="blsp-spelling-error"&gt;wayyy&lt;/span&gt; too much code in the &lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;UI&lt;/span&gt; including sensitive connection strings, &lt;span id="SPELLING_ERROR_16" class="blsp-spelling-corrected"&gt;password&lt;/span&gt;, etc.) and made me sound like a &lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;noob&lt;/span&gt;. People were coming up to me at break telling me, "Just leave that code on the server and make a &lt;span id="SPELLING_ERROR_18" class="blsp-spelling-error"&gt;WCF&lt;/span&gt; call..." Yep, I know. Just was trying to raise a quick &lt;span id="SPELLING_ERROR_19" class="blsp-spelling-corrected"&gt;conversation&lt;/span&gt; for ex-web developers to understand &lt;span id="SPELLING_ERROR_20" class="blsp-spelling-error"&gt;Silverlight's&lt;/span&gt; deployment. Ow well. :)&lt;br /&gt;&lt;br /&gt;Rocky (4&lt;span id="SPELLING_ERROR_21" class="blsp-spelling-error"&gt;th&lt;/span&gt; time attending presentations) and Billy (2&lt;span id="SPELLING_ERROR_22" class="blsp-spelling-error"&gt;nd&lt;/span&gt; time hearing presentations) can offer a lot of knowledge for those wanting to a lot about A+ presentation design (Billy) or &lt;span id="SPELLING_ERROR_23" class="blsp-spelling-error"&gt;OOP&lt;/span&gt; and .NET Technologies (Rocky) and should be checked out this week. If you are attending Visual Studio Live I highly &lt;span id="SPELLING_ERROR_24" class="blsp-spelling-corrected"&gt;recommend&lt;/span&gt; any &lt;span id="SPELLING_ERROR_25" class="blsp-spelling-corrected"&gt;presentations&lt;/span&gt; by either these (2) presenters. Nice job &lt;span id="SPELLING_ERROR_26" class="blsp-spelling-corrected"&gt;gentlemen&lt;/span&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-4326783900835590267?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/4326783900835590267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/day-1-visual-studio-live-orlando-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4326783900835590267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/4326783900835590267'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/day-1-visual-studio-live-orlando-2010.html' title='Day 1: Visual Studio Live! Orlando 2010'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7590484366194325190</id><published>2010-11-01T22:33:00.000-04:00</published><updated>2010-11-02T09:14:08.486-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><title type='text'>Download FTP Files Using FTP Over SSL (SFTP) in .NET</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently with the help of some folks over at StackOverflow I got pointed in the right direction for working with files on a FTP server and communicating with it via FTP over SSL. I had success using FTP client software to view and download files, but needed the code to do this programmatically in .NET. It is essentially easier than I thought and just casts a 'WebRequest' object to an 'FTPWebRequest' object and then the methods called are identical to those used in a traditional WebRequest call.&lt;br /&gt;&lt;br /&gt;The main 3 obstacles I ran into where the following:&lt;br /&gt;&lt;br /&gt;- Getting the Object parameter values set properly to match those of the client software I was already having success connecting with.&lt;br /&gt;- Validating the Server's SSL Certificate programmatically.&lt;br /&gt;- Getting around a 550 error I kept receiving when accessing the file directly.&lt;br /&gt;&lt;br /&gt;So let’s get right to all of the code:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;        'Using an anonymous method, check to make sure the SSL Certificate being served up is the correct one.&lt;br /&gt;        'This method of inlining the validation is good for a simple single certificate check; for more involved&lt;br /&gt;        'checking you will want to use the line below and long hand the method call.&lt;br /&gt;        ServicePointManager.ServerCertificateValidationCallback = Function(obj As [Object], certificate As X509Certificate, chain As X509Chain, errors As SslPolicyErrors) (certificate.Subject.Contains("CN=ftp.domain.com"))&lt;br /&gt;        'Wire up a method that will be called upon creating the FTtpWebRequest and will validate the SSL Certificate&lt;br /&gt;        'ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf CertificateValidation)&lt;br /&gt;&lt;br /&gt;        'Create an FTPWebRequest providing the URI of the FTP server to connect&lt;br /&gt;        Dim Request As System.Net.FtpWebRequest = DirectCast(WebRequest.Create(New Uri("ftp://sftp.domain.com/MyFiles/Folder1/MyFile.txt")), System.Net.FtpWebRequest)&lt;br /&gt;        'Set that we will be downloading a file&lt;br /&gt;        Request.Method = WebRequestMethods.Ftp.DownloadFile&lt;br /&gt;        'We are going to enable SSL for the communication with the FTP server as required by the remote server.&lt;br /&gt;        Request.EnableSsl = True&lt;br /&gt;        'The credentials needed to log onto the server&lt;br /&gt;        Request.Credentials = New Net.NetworkCredential("UserName", "Password")&lt;br /&gt;        'Use a 'Passive' data transfer process. This setting was the same in my FTP client software.&lt;br /&gt;        Request.UsePassive = True&lt;br /&gt;        'Create a 'Reponse object getting the downloaded file&lt;br /&gt;        Dim Response As System.Net.FtpWebResponse = DirectCast(Request.GetResponse(), System.Net.FtpWebResponse)&lt;br /&gt;&lt;br /&gt;        'Read the File using a StreamReader:&lt;br /&gt;        Dim sr As New StreamReader(Response.GetResponseStream())&lt;/pre&gt;To solve my 1st issue I mentioned (get object parameters set), I essentially found and configured the FTPWebRequest object to mimic an existing workable connection from my client software. A lot of the FTP 'lingo/jargon' is identical between .NET and FTP client software. I recommend connecting to the FTP server as I did 1st using client software (i.e. FileZilla) to make sure you do have everything correct before running in circles with code that would never work because you don’t have permissions anyway.&lt;br /&gt;&lt;br /&gt;Next I had to validate the servers SSL certificate programmatically. I was able to use a Lambda Expression using an anonymous method to to create a delegate that would check to make sure the proper SSL Certificate was being presented. If the validation logic is more elaborate, you can use the commented out call to wire up an event to a method named 'CertificateValidation()' by assigning the ServerCertificateValidationCallback on the ServicePointManager object.&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;    Private Shared Function CertificateValidation(ByVal sender As Object, ByVal cert As X509Certificate, ByVal chain As X509Chain, ByVal [error] As System.Net.Security.SslPolicyErrors) As Boolean&lt;br /&gt;&lt;br /&gt;        'Make sure the correct certificate is being used:&lt;br /&gt;        If cert.Subject.Contains("CN=ftp.domain.com") Then&lt;br /&gt;            Return True&lt;br /&gt;        Else&lt;br /&gt;            Return False&lt;br /&gt;        End If&lt;br /&gt;&lt;br /&gt;    End Function&lt;/pre&gt;Now either method could technically just return 'True' and all certificates would be trusted and validated, but I wanted to make sure I am actually presented with the correct certificate. You can easily find out the name of the certificate by turning on tracing in the web.config (explained below). Then you can make sure the proper certificate was served, and then Return True. This process actually exists the 1st time you probably connected to the FTP server with the FTP client software (i.e. FileZilla). A dialog probably presented itself asking if you trusted the certificate. This code is dealing with that process programmatically.&lt;br /&gt;&lt;br /&gt;The last fix was in regards to solving this specific issue:&lt;br /&gt;&lt;br /&gt;"The remote server returned an error: (550) File unavailable (e.g., file not found, no access)."&lt;br /&gt;&lt;br /&gt;Now this was probably an issue specific to my setup, but I mention it because the oversight is probably common. I received this upon getting the FtpWebResponse object. The issue stemmed from the URI I was providing. I knew the URI had to be the full path to the file I wanted to download, so I used ftp://sftp.domain.com/MyFiles/Folder1/MyFile.txt I tried in a browser and had the same issue. I ended up turning on a listener to log System.Net traffic. The following article has directions on doing this: &lt;b&gt;&lt;a href="http://blogs.msdn.com/b/dgorti/archive/2005/09/18/471003.aspx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline; color:#0000ff;"&gt;Using System.Net Tracing&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;  This output (found in the root folder in my project after running) showed that the default path was already /MyFiles/Folder1. This was already the path as soon as I connect to the base URI of sftp.domain.com, and I should have recognized this from the FTP client software, as I was directly taken to this folder location each time I connected. Therefore, when I fully qualified the URI, it actually resulted in looking for the following: ftp://sftp.domain.com/MyFiles/Folder1/MyFiles/Folder1/MyFile.txt This showed me that all I needed to do was just use the host + filename like the following which worked perfectly: ftp://sftp.domain.com/MyFile.txt&lt;br /&gt;&lt;br /&gt;This code demonstrated how to download a file from a FTP server using SSL, but there are many other operations you can do as well (i.e. Uploading, file renaming, directory listing, etc.). Just modify the Enumeration value of 'Request.Method'.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7590484366194325190?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7590484366194325190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/download-ftp-files-using-ftp-over-ssl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7590484366194325190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7590484366194325190'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/11/download-ftp-files-using-ftp-over-ssl.html' title='Download FTP Files Using FTP Over SSL (SFTP) in .NET'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-2288616576427712649</id><published>2010-10-11T11:45:00.006-04:00</published><updated>2010-10-11T11:52:02.655-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL2000'/><title type='text'>How Much Better Is SQL2008 Full Text Index Performance vs. SQL2000?</title><content type='html'>&lt;span style="font-family:arial;"&gt;I am on the cusp of finishing use of SQL2000 here shortly, but I still needed to set up a full text index for searching on a table. Upon running some of the 1st queries I was extremely disappointed with performance, almost to the point where the solution was not a viable option. I set up the same full text index on SQL2008 R2 and ran the identical query. The performance difference? Astounding. Take a look:&lt;br /&gt;&lt;br /&gt;Full Text Index Search results:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL 2000&lt;/strong&gt;: 431 Seconds (7minutes 11 seconds)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_o-C99bmODDI/TLMyQjP5_aI/AAAAAAAAAIQ/wNMoC0X5Mc8/s1600/FullTextResults+SQL2000.png"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 124px; FLOAT: left; HEIGHT: 24px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5526816427634982306" border="0" alt="" src="http://1.bp.blogspot.com/_o-C99bmODDI/TLMyQjP5_aI/AAAAAAAAAIQ/wNMoC0X5Mc8/s320/FullTextResults+SQL2000.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;strong&gt;SQL 2008 R2&lt;/strong&gt;: 2 seconds&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/TLMyX5D2_qI/AAAAAAAAAIY/HnluABI_qbE/s1600/FullTextResults+SQL2008R2.png"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 128px; FLOAT: left; HEIGHT: 39px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5526816553749118626" border="0" alt="" src="http://3.bp.blogspot.com/_o-C99bmODDI/TLMyX5D2_qI/AAAAAAAAAIY/HnluABI_qbE/s320/FullTextResults+SQL2008R2.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Wow… (Rows #’s are different because of different database backups). I know SQL2000 relied on the Windows Search Service and this functionality and related catalogs became integrated once SQL2005 was released which helped immensely.&lt;br /&gt;&lt;br /&gt;So this is probably not any big news for 90% of folks out there, but if you are still on SQL2000 and need something to look forward to, well here it is.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc879306.aspx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;color:#0000ff;" &gt;Full-Text Indexing Overview&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-2288616576427712649?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/2288616576427712649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/10/how-much-better-is-sql2008-full-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2288616576427712649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2288616576427712649'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/10/how-much-better-is-sql2008-full-text.html' title='How Much Better Is SQL2008 Full Text Index Performance vs. SQL2000?'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_o-C99bmODDI/TLMyQjP5_aI/AAAAAAAAAIQ/wNMoC0X5Mc8/s72-c/FullTextResults+SQL2000.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-55002071683115519</id><published>2010-10-05T23:49:00.002-04:00</published><updated>2010-10-06T16:21:01.365-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Setup Packages'/><title type='text'>Why Does My .NET Setup Package Project Not Create the Setup.exe and Only Makes a .msi Package?</title><content type='html'>&lt;span style="font-family:arial;"&gt;I seem to run into these setup package configuration nuances often. It is probably because I keep moving along projects from version to version of VS.NET (now mostly working with VS.NET 2010) and servers keep changing versions too (i.e. 2008 R2). Recently I was having issue installing a .msi package On Windows Server 2008 R2, stating: "You do not have sufficient privileges to complete the installation for all users of the machine. Log on as administrator and then retry the installation." The typical workaround for this was to use the generated "Setup.exe" file instead for installation and right-click it to select "Run as Administrator". However, .msi Windows Installer packages do not have this option to directly run as an Administrator. I did find a work around for installing .msi packages on Server 2008 R2 &lt;b&gt;&lt;a href="http://social.technet.microsoft.com/Forums/en/winservergen/thread/64af2d23-e45c-413f-bf1b-5ea7c9d52abd" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline; color:#0000ff;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;However the problem I ran into before finding the work around was that my "Release" folder for my setup package project was only generating the .msi setup package and not the Setup.exe as well. This was strange to me as all of my other projects contained the Setup.exe package alongside the generated .msi package.&lt;br /&gt;&lt;br /&gt;I figured out the reasoning why the Setup.exe package is (or is not) generated. It has to do with selecting the option in the setup project's properties to create a "Prerequisites" setup package as well. Selecting this option (I believe it is selected by default when adding a new setup and deployment project to your solution) is what triggers the creation of the Setup.exe package.&lt;br /&gt;&lt;br /&gt;Here where the steps I took to find this option and have the Setup.exe package generated. 1st, select the setup project's "Properties" link after highlighting the setup project in Solution Explorer within VS.NET as displayed below:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/_o-C99bmODDI/TKzYA1t38zI/AAAAAAAAAHY/rspJGMRGjU0/s1600/ProjectProperties.png"&gt;&lt;span style="font-family:arial;"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 153px; DISPLAY: block; HEIGHT: 90px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5525028351807845170" border="0" alt="" src="http://1.bp.blogspot.com/_o-C99bmODDI/TKzYA1t38zI/AAAAAAAAAHY/rspJGMRGjU0/s320/ProjectProperties.png" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;2nd, take note of the "Configuration" dropdown value. In my case things were really messed up as I had the proper selections for "Debug" and it was "Release" mode that was incorrectly configured. Check both to make sure you have it correct.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/TKzYk5UU6-I/AAAAAAAAAHo/slZ5GrsgYdI/s1600/PackagePropertyPages.png"&gt;&lt;span style="font-family:arial;"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 228px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5525028971249724386" border="0" alt="" src="http://2.bp.blogspot.com/_o-C99bmODDI/TKzYk5UU6-I/AAAAAAAAAHo/slZ5GrsgYdI/s320/PackagePropertyPages.png" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;3rd, press the "Prerequisites..." button displayed above in the property pages.&lt;br /&gt;&lt;br /&gt;Lastly, check the box stating "Create setup program to install prerequisite components" as displayed below:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/_o-C99bmODDI/TKzYsjnH8bI/AAAAAAAAAHw/JyqJEGraYT0/s1600/PrerequisitesDialog.png"&gt;&lt;span style="font-family:arial;"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 248px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5525029102861939122" border="0" alt="" src="http://4.bp.blogspot.com/_o-C99bmODDI/TKzYsjnH8bI/AAAAAAAAAHw/JyqJEGraYT0/s320/PrerequisitesDialog.png" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Take note of selecting the appropriate .NET Framework version or any other required prerequisites, and select "OK" and the "OK" again to close the dialog box. Rebuild the setup package and then navigate to its build directory (or use "Open Folder in Windows Explorer" feature by right-clicking project in VS.NET 2010: pictured below) to verify the Setup.exe package has indeed now been created.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/TKzYzITE3RI/AAAAAAAAAH4/MjjM0JLw1JQ/s1600/OpenWinExplorerVS2010.png"&gt;&lt;span style="font-family:arial;"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 71px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5525029215789178130" border="0" alt="" src="http://3.bp.blogspot.com/_o-C99bmODDI/TKzYzITE3RI/AAAAAAAAAH4/MjjM0JLw1JQ/s320/OpenWinExplorerVS2010.png" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-55002071683115519?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/55002071683115519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/10/why-does-my-net-setup-package-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/55002071683115519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/55002071683115519'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/10/why-does-my-net-setup-package-project.html' title='Why Does My .NET Setup Package Project Not Create the Setup.exe and Only Makes a .msi Package?'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_o-C99bmODDI/TKzYA1t38zI/AAAAAAAAAHY/rspJGMRGjU0/s72-c/ProjectProperties.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-5441295503779971629</id><published>2010-09-09T21:22:00.000-04:00</published><updated>2010-09-09T21:22:57.275-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><title type='text'>Why Does "Go to Definition" And Intellisense Not Work Properly For Referenced Projects in VS.NET</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently I was working with a solution containing (3) projects in VS.NET2010. When I would right-click an item (i.e. a method) from another project and state "Go To Definition" (F12 key does the same thing), the Object Browser window would open as opposed to going to the actual method or class definition.&lt;br /&gt;&lt;br /&gt;My 1st step was to delete the project references between projects, and make sure to re-add them from the "Projects" tab. Upon doing this, the answer of why this problem was occurring appeared:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/_o-C99bmODDI/TIlFKbKAqrI/AAAAAAAAAHQ/fDOnkvK8iZk/s1600/Framework+Conflict.png"&gt;&lt;span style="font-family:arial;"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 139px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5515015264082635442" border="0" alt="" src="http://1.bp.blogspot.com/_o-C99bmODDI/TIlFKbKAqrI/AAAAAAAAAHQ/fDOnkvK8iZk/s320/Framework+Conflict.png" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The project I was working with was a project recently upgraded to VS.NET 2010. Somehow, the other 2 projects in my solution when upgrading to VS.NET 2010 remained targeted at the .NET Framework 3.5. When referenced .dlls target a different Framework, they are treated as file references and not project references and therefore the "Go to Definition" and other Intellisense features related to those references does not work properly.&lt;br /&gt;&lt;br /&gt;The fix? Get all projects targeting the same .NET Framework if you can. You can do this by right-clicking the project in "Solution Explorer" and selecting "Properties". Select the "Compile" tab and then select "Advanced Compile Options...". From in this dialog window, you can change the targeted framework of the project. Upon completing this for each of my other (2) projects still targeting the .NET Framework 3.5, I removed the project references and re-added them for good practice to cover all steps possible. I then cleaned and re-built the solution. After I did this the "Go To Definition" functionality and associated Intellisense was working properly again. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-5441295503779971629?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/5441295503779971629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/09/why-does-go-to-definition-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5441295503779971629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5441295503779971629'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/09/why-does-go-to-definition-and.html' title='Why Does &quot;Go to Definition&quot; And Intellisense Not Work Properly For Referenced Projects in VS.NET'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_o-C99bmODDI/TIlFKbKAqrI/AAAAAAAAAHQ/fDOnkvK8iZk/s72-c/Framework+Conflict.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1803443647650049714</id><published>2010-09-01T22:59:00.001-04:00</published><updated>2010-09-02T17:03:38.376-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Lambda Expressions'/><title type='text'>Why Are My Lambda Functions Throwing An Error at Run Time With a System.MissingMemberException Exception?</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently I was working in a VS.NET 2010 project and I was creating a multiline Lambda expression function within a method to use. It was pretty straight forward and was syntactically correct. I could build the application successfully, but when hitting that code at compile time I received the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;No default member found for type 'VB$AnonymousDelegate_0(Of String,String)'.&lt;br /&gt;System.MissingMemberException occurred&lt;br /&gt;Message=No default member found for type 'VB$AnonymousDelegate_0(Of String,String)'. Source=Microsoft.VisualBasic&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The signature of (Of String,String) is not that important and if you are receiving this problem, it would reflect the lambda functions signature of your method. I took the code and placed it in a test harness VS.NET 2010 app, and it both compiled and ran successfully. One thing I immediately noticed is if I hovered over the Function variable declaration it resolved to: Dim MyFormatFunc As &amp;lt;Function(String) As String&amp;gt;. In my problematic application it resolved to nothing.&lt;br /&gt;&lt;br /&gt;Well the problem lies in the project setting to allow '&lt;strong&gt;Type Inference&lt;/strong&gt;'. This was a VS.NET 2005 originating project that has been converted to 2008, then to 2010. If the project originated in 2008 or later, Type Inference is set to 'On' by default. My grandfathered application had it set to 'Off' which meant these anonymous types would be treated as type 'Object' instead of resolving to their appropriate type.&lt;br /&gt;&lt;br /&gt;You can change this setting at the page, class, or project level which is what I prefer. To turn on this setting, right-click your project in Solution Explorer within VS.NET (or double click "My Project" to get the same result) which will bring up the project's properties. Click on the 'Compile' tab and change the dropdown for 'Option infer:' from 'Off' to 'On' (pictured below).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_o-C99bmODDI/TIAQw973NmI/AAAAAAAAAHI/eLye6PogtKs/s1600/OptionInferSetting.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 59px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5512424377346897506" border="0" alt="" src="http://1.bp.blogspot.com/_o-C99bmODDI/TIAQw973NmI/AAAAAAAAAHI/eLye6PogtKs/s320/OptionInferSetting.png" /&gt;&lt;/a&gt;&lt;br /&gt;Recompile your app and run it again. Your lambda functions will work properly and you will not receive any errors (assuming you coded them correctly to begin with). You will also see the IDE resolves the type at design type if you hover over the declared lambda function variable.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1803443647650049714?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1803443647650049714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/09/why-are-my-lambda-functions-throwing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1803443647650049714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1803443647650049714'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/09/why-are-my-lambda-functions-throwing.html' title='Why Are My Lambda Functions Throwing An Error at Run Time With a System.MissingMemberException Exception?'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_o-C99bmODDI/TIAQw973NmI/AAAAAAAAAHI/eLye6PogtKs/s72-c/OptionInferSetting.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1923904360191965203</id><published>2010-08-30T22:14:00.001-04:00</published><updated>2010-08-31T10:15:34.533-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><title type='text'>Help! My VS.NET Solution Is Not Opening All Associated Projects</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently while using VS.NET 2010 I had an unsettling feeling when I opened my solution file (.&lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;sln&lt;/span&gt;) that I have been working on for the past 3 years to find that only 1 of the 3 associated projects opened up. Well I immediately knew everything was &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;ok&lt;/span&gt; because all of the directories, etc. still existed for the unopened projects, so I had to figure out how to fix the problem.&lt;br /&gt;&lt;br /&gt;This particular problem occurred due to a corrupted .&lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;sln&lt;/span&gt; file. The .&lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;sln&lt;/span&gt; file associated with a VS.NET solution contains the meta data in text format of the associated project and source control information. To see this information, navigate to the .&lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;sln&lt;/span&gt; file in Windows Explorer and right click to select 'Open with' and select either Notepad or &lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;WordPad&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;You will be able to see associated project information, along with the project &lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;GUID&lt;/span&gt;, source control information, and other meta data. For whatever unexplained reason, my .&lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;sln&lt;/span&gt; file only had the details for a single project in the solution, and therefore was being the only one opened up in VS.NET. I &lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;didn&lt;/span&gt;’t want to start adding projects manually via the &lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;IDE&lt;/span&gt; thinking that could cause a mess. The solution lies in correcting or replacing the .&lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;sln&lt;/span&gt; file.&lt;br /&gt;&lt;br /&gt;I chose to go to my source control provider and get a 2&lt;span id="SPELLING_ERROR_11" class="blsp-spelling-error"&gt;nd&lt;/span&gt; most recent version of the .&lt;span id="SPELLING_ERROR_12" class="blsp-spelling-error"&gt;sln&lt;/span&gt; and placed it in a separate location from the real .&lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;sln&lt;/span&gt; file to inspect. Upon opening the version from source control, I found the details for all (3) projects as expected. There are (2) ways to fix the issue at hand now, and I recommend making a backup of everything before making any modifications to this file in case there is an issue.&lt;br /&gt;&lt;br /&gt;I chose to copy everything out of the properly formatted .&lt;span id="SPELLING_ERROR_14" class="blsp-spelling-error"&gt;sln&lt;/span&gt; and paste it into the corrupted .&lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;sln&lt;/span&gt; file and then reopen the solution. The other option would be to simply replace the .&lt;span id="SPELLING_ERROR_16" class="blsp-spelling-error"&gt;sln&lt;/span&gt; file directly.&lt;br /&gt;&lt;br /&gt;After reopening VS.NET, I didn't use any quick links on the home page and manually navigated back to the .&lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;sln&lt;/span&gt; file to open the solution. I received one warning/option box stating what was loaded was not the same as in Source Control (because I had modified the .&lt;span id="SPELLING_ERROR_18" class="blsp-spelling-error"&gt;sln&lt;/span&gt; manually), and told me it would notify me of issues or differences, which there were not any. I had to reset the &lt;span id="SPELLING_ERROR_19" class="blsp-spelling-error"&gt;startup&lt;/span&gt; project and &lt;span id="SPELLING_ERROR_20" class="blsp-spelling-error"&gt;startup&lt;/span&gt; .&lt;span id="SPELLING_ERROR_21" class="blsp-spelling-error"&gt;aspx&lt;/span&gt; page and all was back to normal. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1923904360191965203?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1923904360191965203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/08/help-my-vsnet-solution-is-not-opening.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1923904360191965203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1923904360191965203'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/08/help-my-vsnet-solution-is-not-opening.html' title='Help! My VS.NET Solution Is Not Opening All Associated Projects'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1518359865300021665</id><published>2010-08-22T22:59:00.005-04:00</published><updated>2010-11-01T17:09:43.715-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>How To: Extract Selected Items From An ASP.NET ListBox Using LINQ</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;em&gt;(Note: All code examples here use VS.NET 2010 so there is a lot of shortcutting. Just know you will need line continuation underscores "_" and long hand properties if using an earlier version of VS.NET)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;If you have wanted to extract all of the 'Selected' items from a ListBox in the past, you probably created a For Each loop similar to the code below:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt; For Each li As ListItem In Me.ListBox1.Items&lt;br /&gt;   If li.Selected Then&lt;br /&gt;     'Code here to process selected item&lt;br /&gt;   End If&lt;br /&gt; Next&lt;/pre&gt;However thank you to LINQ and being that the ListBox control is an enumerable type, you can run a LINQ query against the Listbox's Items to get back all of the selected items. One important note to keep in mind is how powerful LINQ is and how many different objects and types can be used in LINQ queries. This example is specific to an ASP.NET ListBox, but there are many other controls where you could write similar queries to extract out data based on a criteria.&lt;br /&gt;&lt;br /&gt;So to begin let's create a simple ListBox with some colors:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt; &amp;lt;asp:ListBox ID="ListBox1" runat="server" SelectionMode="Multiple"&amp;gt;&lt;br /&gt;    &amp;lt;asp:ListItem Value="1" Text="Green" /&amp;gt;&lt;br /&gt;    &amp;lt;asp:ListItem Value="2" Text="Red" /&amp;gt;&lt;br /&gt;    &amp;lt;asp:ListItem Value="3" Text="Blue" /&amp;gt;&lt;br /&gt;    &amp;lt;asp:ListItem Value="4" Text="Orange" /&amp;gt;           &lt;br /&gt; &amp;lt;/asp:ListBox&amp;gt;&lt;/pre&gt;Now on the button click event we want to extract these colors into our class named 'ColorData'. It has (2) properties: ColorID and ColorDesc. So 1st let's just view the simple ColorData class:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Public Class ColorData&lt;br /&gt;&lt;br /&gt;    Public Property ColorID As Integer&lt;br /&gt;&lt;br /&gt;    Public Property ColorDesc As String&lt;br /&gt;&lt;br /&gt;End Class&lt;/pre&gt;Like mentioned before, we would have iterated through each ListItem Object in the ListBox control, and manually added each set of values to a generic list. With the LINQ query we can do it all in 1 step. Below is the LINQ query that dumps into an Anonymous type named 'myColorData' the results of the query which places only the selected ListBox item values into the collection:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click&lt;br /&gt;&lt;br /&gt; 'Extract the 'Selected' ListBox items into a generic list of type 'ColorData'&lt;br /&gt; 'Use LINQ to extract the items rather than iterating through manually with a For-Each loop&lt;br /&gt;&lt;br /&gt; 'Also notice the use of an Anonomous type: myColorData which at runtime is resolved to &lt;br /&gt; 'a generic list of type ColorData&lt;br /&gt; Dim myColorData = (From li As ListItem In Me.ListBox1.Items&lt;br /&gt;                    Where li.Selected = True&lt;br /&gt;                    Select New ColorData With {&lt;br /&gt;                          .ColorDesc = li.Text,&lt;br /&gt;                          .ColorID = li.Value})&lt;br /&gt;&lt;br /&gt;End Sub&lt;/pre&gt;That's it! Of course you could modify the values inline, check to make sure the values were of the correct type, or anything else required. Hopefully this will get you thinking about getting rid of those old For Each loops when accessing data from ASP.NET controls and using LINQ instead.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1518359865300021665?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1518359865300021665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/08/how-to-extract-selected-items-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1518359865300021665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1518359865300021665'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/08/how-to-extract-selected-items-from.html' title='How To: Extract Selected Items From An ASP.NET ListBox Using LINQ'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7868221429348075586</id><published>2010-08-03T12:21:00.005-04:00</published><updated>2010-08-03T13:57:25.913-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VSLive'/><category scheme='http://www.blogger.com/atom/ns#' term='LightSwitch'/><title type='text'>Visual Studio LightSwitch Announced</title><content type='html'>&lt;span style="font-family:arial;"&gt;I don't normally just add links to other sites here, but this is a new tool that was announced at the VSLive! conference in Redmond today. Microsoft Visual Studio LightSwitch seems like a useful RAD tool reminiscent a tad of Microsoft Access with wizardry style ability to create data and forms, but with a managed code (.NET Framework) backend, and options for Application Type (desktop or web). Take a look at the link below to learn more:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/b/jasonz/archive/2010/08/03/introducing-microsoft-visual-studio-lightswitch.aspx" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;" &gt;Introducing Microsoft Visual Studio LightSwitch&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.microsoft.com/visualstudio/en-us/lightswitch" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;" &gt;Visual Studio LightSwitch 2010  Microsoft® Visual Studio®&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7868221429348075586?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7868221429348075586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/08/visual-studio-lightswitch-announced.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7868221429348075586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7868221429348075586'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/08/visual-studio-lightswitch-announced.html' title='Visual Studio LightSwitch Announced'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-6805884170281252109</id><published>2010-08-01T21:10:00.003-04:00</published><updated>2010-08-02T09:14:33.486-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Server'/><title type='text'>How To: Turn Off User Account Control (UAC) Prompts for Administrators on Windows Server 2008</title><content type='html'>There is more than meets the eye when it comes to the User Account Control (UAC) settings configured on the various Microsoft Operating System platforms, and I will not get into it all.  I do think it is an important security feature to alert users when accessing an application that has prompted for elevated rights.  When this occurs a UAC popup window appears prior to the application launching.  This gives the user the chance to cancel any process that was not initiated by them directly.&lt;br /&gt; &lt;br /&gt;With that said, if you are an administrator and work either directly or remotely with Windows Server 2008, you may find these pop-ups annoying every time you open IIS Manager, SQL Manager, or another application needing elevated privileges.  If you have an understanding of UAC and wish to turn off the pop-ups for Administrators logged on you can do the following:&lt;br /&gt; &lt;br /&gt;1.  In Windows Server 2008, go to Start -&gt; Administrative Tools -&gt; Local Security Policy.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_o-C99bmODDI/TFbD_i65HmI/AAAAAAAAAGg/Vg71BYpRJEQ/s1600/WS+Admin+LSP.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 174px;" src="http://4.bp.blogspot.com/_o-C99bmODDI/TFbD_i65HmI/AAAAAAAAAGg/Vg71BYpRJEQ/s400/WS+Admin+LSP.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5500799491352632930" /&gt;&lt;/a&gt;&lt;br /&gt;2.  In the tree within the Local Security Policy MMC, expand Local Policies -&gt; Security Options.  &lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/TFbEN-jeTRI/AAAAAAAAAGo/4fMKg3_JhE8/s1600/WS+Local+Security+Policy.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 280px; height: 268px;" src="http://2.bp.blogspot.com/_o-C99bmODDI/TFbEN-jeTRI/AAAAAAAAAGo/4fMKg3_JhE8/s400/WS+Local+Security+Policy.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5500799739288767762" /&gt;&lt;/a&gt;&lt;br /&gt;3.  Scroll down in alphabetical order on the right-hand side.  There are a block of settings for UAC. Again as mentioned before there is more than meets the eye with UAC, but for this operation we are only concerned with a single setting.  Find the setting marked 'User Account Control: Behavior of the elevation prompt for Administrators in Admin Approval Mode'.  Right-click the setting and select 'Properties'.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/TFbEVVgFL6I/AAAAAAAAAGw/fho9bMJ0q2U/s1600/WS+LocalPolicy+Setting.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 101px;" src="http://3.bp.blogspot.com/_o-C99bmODDI/TFbEVVgFL6I/AAAAAAAAAGw/fho9bMJ0q2U/s400/WS+LocalPolicy+Setting.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5500799865707638690" /&gt;&lt;/a&gt;&lt;br /&gt;4.  Change the dropdown setting to 'Elevate without prompting' and select 'Apply' to close the dialogue.  You can also close the Local Policies MMC.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/TFbEb1KnZUI/AAAAAAAAAG4/7QDYf5puzGM/s1600/WS+Elevated.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 335px; height: 400px;" src="http://3.bp.blogspot.com/_o-C99bmODDI/TFbEb1KnZUI/AAAAAAAAAG4/7QDYf5puzGM/s400/WS+Elevated.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5500799977286755650" /&gt;&lt;/a&gt;&lt;br /&gt;That's all there is to it; now when you open application that requests elevated permissions, you the administrator will not be prompted by any UAC pop-ups.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-6805884170281252109?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/6805884170281252109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/08/how-to-turn-off-user-account-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6805884170281252109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6805884170281252109'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/08/how-to-turn-off-user-account-control.html' title='How To: Turn Off User Account Control (UAC) Prompts for Administrators on Windows Server 2008'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_o-C99bmODDI/TFbD_i65HmI/AAAAAAAAAGg/Vg71BYpRJEQ/s72-c/WS+Admin+LSP.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1965862519335386311</id><published>2010-07-27T23:13:00.008-04:00</published><updated>2010-07-28T16:20:03.607-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Errors'/><category scheme='http://www.blogger.com/atom/ns#' term='Encryption'/><title type='text'>Solving a "The section is marked as being protected..." Error When Decrypting a .config With aspnet_regiis.exe tool</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you use the aspnet_regiis tool to encrypt sections of a .config file then you are ahead of the game is securing sensitive information with the apps configuration. If you have not used it before, I suggest trying it out sometime. However recently I came across an error while decrypting the 'appSettings' section that was as follows:&lt;br /&gt;&lt;br /&gt;"The section is marked as being protected, but it does not have the correct format. It should contain only the &amp;lt;EncryptedData&amp;gt; child node."&lt;br /&gt;&lt;br /&gt;It turns out that a new key that was auto generated in this particular project dealing with WCF was injected between the &amp;lt;EncryptedData&amp;gt; nodes (as shown below).&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;      &amp;lt;/CipherData&amp;gt;&lt;br /&gt;    &amp;lt;add key="ClientSettingsProvider.ServiceUri" value="" /&amp;gt;&lt;br /&gt;  &amp;lt;/EncryptedData&amp;gt;&lt;br /&gt;&lt;/pre&gt;Once I removed the new key and attempted the decryption, everything worked properly! So if you come across this error, see if any new keys have been added (or any other elements for that matter) between the &amp;lt;EncryptedData&amp;gt; nodes because it will cause this error.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1965862519335386311?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1965862519335386311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/solving-the-section-is-marked-as-being.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1965862519335386311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1965862519335386311'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/solving-the-section-is-marked-as-being.html' title='Solving a &quot;The section is marked as being protected...&quot; Error When Decrypting a .config With aspnet_regiis.exe tool'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1065933618445088874</id><published>2010-07-27T22:47:00.003-04:00</published><updated>2010-07-28T14:00:31.434-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Freebies'/><category scheme='http://www.blogger.com/atom/ns#' term='MSDN'/><title type='text'>Get a free MSDN Magazine Digital Subscription</title><content type='html'>&lt;span style="font-family:arial;"&gt;Here is some good news: you can subscribe to get a digital edition of the MSDN Magazine for FREE! The MSDN Magazine (normally a $35 annual rate for paper copy) covers software development topics related to Microsoft technologies. Just click the link below and login with your Windows Live ID to sign up. It used to come with Dr. Dobbs Journal as well, but I read it ceased subscription in early 2010.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="https://profile.microsoft.com/RegSysProfileCenter/wizard.aspx?wizid=f4cc7a02-9146-41d9-acf3-d816d4f34f0c" target="_blank"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;"&gt;Free MSDN Digital Subscription&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_o-C99bmODDI/TFBus-CyPXI/AAAAAAAAAGY/4HtbkIChaFI/s1600/msdnmagazine.gif"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 200px; DISPLAY: block; HEIGHT: 263px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5499016863867354482" border="0" alt="" src="http://4.bp.blogspot.com/_o-C99bmODDI/TFBus-CyPXI/AAAAAAAAAGY/4HtbkIChaFI/s320/msdnmagazine.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1065933618445088874?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1065933618445088874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/get-free-msdn-magazine-digital.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1065933618445088874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1065933618445088874'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/get-free-msdn-magazine-digital.html' title='Get a free MSDN Magazine Digital Subscription'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_o-C99bmODDI/TFBus-CyPXI/AAAAAAAAAGY/4HtbkIChaFI/s72-c/msdnmagazine.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1621212535413496377</id><published>2010-07-19T22:14:00.002-04:00</published><updated>2010-07-20T16:22:24.458-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Errors'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Setup Packages'/><title type='text'>Help! My .NET Setup Package Is Throwing a System.BadImageFormatException Error 1001</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently I had a WCF service install package that was upgraded from VS.NET 2008 to VS.NET 2010 fail with the following error message upon installing it locally on my machine:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;"Product: MyWCFService -- Error 1001. Error 1001. Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files\MyApps\WCFServices\MyWCFService.WinServiceHost.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.."&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;You might also see the following warning issues by the compiler:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;em&gt;&lt;strong&gt;"The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '3.5.30729 '. Update the version of the .NET Framework launch condition to match the target version of the.NET Framework in the Advanced Compile Options Dialog Box (VB) or the Application Page (C#, F#)."&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Well this was interesting to me because this was being displayed on a machine that has everything: .NET Framework 4.0, tools, you name it. There should be nothing missing. That's the 1st place to start obviously - make sure the .NET Framework is installed on the target machine.&lt;br /&gt;&lt;br /&gt;However this was not the case in my scenario. It turns out even though all of my project comprising the setup package targeted the .NET Framework 4.0, and even the Setup package prerequisites indicated the .NET Framework 4.0, there was still 1 piece of the puzzle missing.&lt;br /&gt;&lt;br /&gt;The problem: under the "Detected Dependencies" list for the setup project the 1st item listed was "Microsoft .NET Framework". Refreshing the dependencies does nothing for this value; it must be reconfigured manually. Double click the "Microsoft .NET Framework" item to bring up the "Launch Conditions" window and properties. In the 'Properties' window, change the 'Version' attribute to .NET Framework 4.0 (or whichever framework for your scenario). The Launch Conditions window is displayed below. After making the change, the installer package worked perfectly and installed without issues.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_o-C99bmODDI/TEYD6VzvLNI/AAAAAAAAAGQ/yk5KvByi5_c/s1600/LaunchConditions.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 400px; DISPLAY: block; HEIGHT: 239px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5496084696073710802" border="0" alt="" src="http://1.bp.blogspot.com/_o-C99bmODDI/TEYD6VzvLNI/AAAAAAAAAGQ/yk5KvByi5_c/s400/LaunchConditions.png" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1621212535413496377?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1621212535413496377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/help-my-net-setup-package-is-throwing.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1621212535413496377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1621212535413496377'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/help-my-net-setup-package-is-throwing.html' title='Help! My .NET Setup Package Is Throwing a System.BadImageFormatException Error 1001'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_o-C99bmODDI/TEYD6VzvLNI/AAAAAAAAAGQ/yk5KvByi5_c/s72-c/LaunchConditions.png' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-3208359107766698289</id><published>2010-07-15T22:17:00.003-04:00</published><updated>2010-11-01T16:30:50.957-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>How to Serialize a SyndicationFeed Object To Be Returned From WCF</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently I have been working with the SyndicationFeed class in the System.ServiceModel.Syndication namespace. It allows us as developers to work nicely with Atom 1.0 and RSS 2.0 content. A problem arose when I needed to return this object from RSS to a consuming Silverlight client. The problem was that the raw SyndicationFeed class is not serializable, so I needed a solution to serialize the Feed and return it.&lt;br /&gt;&lt;br /&gt;This was one time I was happy to find that no custom serialization methods, or mimicking all property values in my own DataContract to return was going to have to be the solution. Instead there are 2 nice classes in the same namespace that do exactly this for us: the Atom10FeedFormatter &amp;amp; Rss20FeedFormatter classes.&lt;br /&gt;&lt;br /&gt;In my case I was working with Atom 1.0 content so I was able to use that Serialization class. The solution was simple. Alter my WCF service to return a type of 'Atom10FeedFormatter' defined both on the OperationContract and implementing service method. Then the client can define the return type to receive, and place it right back into a SyndicationFeed object if desired. There are also Atom10FeedFormatter(Of TSyndicationFeed) &amp;amp; Rss20FeedFormatter(Of TSyndicationFeed) classes to serialize classes that derive from those types, and there are all the same classes for the 'SyndicationItem' object as well. Needless to say there is some flexibility in serializing this data to be returned.&lt;br /&gt;&lt;br /&gt;So let’s take a look at the code; 1st the code to extract a SyndicationFeed (i.e. from an RSS link off the web).&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;'Make a call to extract RSS information from the web&lt;br /&gt;Dim proxy As New WebClient()&lt;br /&gt;'Load stream into a reader&lt;br /&gt;xmlRdr = XmlReader.Create(proxy.OpenRead(New Uri("http://rss.cnn.com/rss/cnn_topstories.rss")))&lt;br /&gt;&lt;br /&gt;'Load syndicated feed (Atom)&lt;br /&gt;Dim feed As SyndicationFeed = SyndicationFeed.Load(xmlRdr)&lt;br /&gt;&lt;/pre&gt;Next the code to Return from the method the Atom10FeedFormatter. I do this inline in the Return statement as it is easiest:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Return New Atom10FeedFormatter(feed)&lt;br /&gt;&lt;/pre&gt;Lastly, the client code to receive the Atom10FeedFormatter and place it back into a SyndicationFeed object. You may wish to do this before binding to controls. &lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Dim wcfSrv As New MyWCFService.MyWCFServiceClient&lt;br /&gt;'Create the Formatter which will be returned from the RSS call below&lt;br /&gt;Dim MyRssSyndicationData As Atom10FeedFormatter&lt;br /&gt;MyRssSyndicationData = wcfSrv.RssFeedData()&lt;br /&gt;&lt;br /&gt;'Load the returned formatter back into a SyndicationFeed object if desired&lt;br /&gt;Dim RssDataFeed As SyndicationFeed = MyRssSyndicationData.Feed&lt;br /&gt;&lt;/pre&gt;So that's it! If you want to learn more about these classes that make serializing SyndicationItem or SyndicationFeed classes so easy, take a look to the following link: &lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb357210.aspx"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;" &gt;System.ServiceModel.Syndication Namespace&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-3208359107766698289?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/3208359107766698289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/how-to-serialize-syndicationfeed-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3208359107766698289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3208359107766698289'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/how-to-serialize-syndicationfeed-object.html' title='How to Serialize a SyndicationFeed Object To Be Returned From WCF'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-6049900577805300306</id><published>2010-07-14T22:52:00.000-04:00</published><updated>2010-07-15T10:53:27.543-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Conversions'/><category scheme='http://www.blogger.com/atom/ns#' term='VB6'/><title type='text'>Microsoft Offers Free VB6 to VB.NET or C# Conversion Tool</title><content type='html'>&lt;span style="font-family:arial;"&gt;Microsoft has released 'ArtinSoft’s Visual Basic Upgrade Companion (VBUC)' as a free downloadable tool to convert old VB6 code into .NET code (either VB.NET or C#). It appears to be good for converting up to 10,000 lines of code under the free license. See the link below for more details:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/vbasic/ff793478.aspx"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;" &gt;ArtinSoft’s Visual Basic Upgrade Companion (VBUC)&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-6049900577805300306?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/6049900577805300306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/microsoft-offers-free-vb6-to-vbnet-or-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6049900577805300306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6049900577805300306'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/microsoft-offers-free-vb6-to-vbnet-or-c.html' title='Microsoft Offers Free VB6 to VB.NET or C# Conversion Tool'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7706526249273623567</id><published>2010-07-11T23:13:00.000-04:00</published><updated>2010-07-12T15:14:30.552-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Expression Encoder'/><title type='text'>Fixing the "File type isn't supported" Error When Working With Expression Encoder SDK</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently I had trouble on a Windows 7 Ultimate Machine with Expression Encoder 4 installed with a "File type isn't supported" error being returned when programming against the SDK. Upon creating an instance of the MediaItem object, the exception was thrown. It turns out even with Win7 ultimate, EE4, and Windows Media Player 11 installed I was still missing some codecs. I downloaded a robust codec pack from the link below and it solved the issues. Microsoft also offers a codec package for older versions of Windows Media Player, but to make sure I had no more issues I installed the larger free package offered from CNet. Once the additional codecs were installed, the code continued to work perfectly. Remember as well, if this code is in a service or .dll, make sure those codecs are in place on machine or server where deployed as well, to prevent the "Well it works on my machine, but not the server..." kind of issue.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://download.cnet.com/Media-Player-Codec-Pack/3000-13632_4-10749065.html"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;" &gt;Media Player Codec Pack&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.microsoft.com/windows/windowsmedia/forpros/format/codecdownload.aspx"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;" &gt;Codec Installation Package for Windows Media Player 7.1 and later&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7706526249273623567?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7706526249273623567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/fixing-file-type-isnt-supported-error.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7706526249273623567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7706526249273623567'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/fixing-file-type-isnt-supported-error.html' title='Fixing the &quot;File type isn&apos;t supported&quot; Error When Working With Expression Encoder SDK'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-9125955866060104293</id><published>2010-07-11T22:39:00.001-04:00</published><updated>2010-07-12T10:41:49.707-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>How to Fix When a WCF Service Does Not Debug via the "WCF Test Client" Tool</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you have created a WCF service, then you have probably seen that upon debugging the service via VS.NET, the service is started automatically using the WcfTestClient.exe tool. This allows the service to actively run through the development server, so test harness applications can consume the service and have real time debugging capabilities. The image below shows the window that should display upon successfully starting (debugging) a WCF Service.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/TDspY6VVlkI/AAAAAAAAAGI/g1rhX08j2Zs/s1600/WcfClientTest+Tool.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 181px; height: 86px;" src="http://2.bp.blogspot.com/_o-C99bmODDI/TDspY6VVlkI/AAAAAAAAAGI/g1rhX08j2Zs/s320/WcfClientTest+Tool.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5493029678460802626" /&gt;&lt;/a&gt;&lt;br /&gt;Recently I had a WCF service that upon debugging was opening a web page with the .svc details being shown. This was not what I wanted, and my other VS.NET WCF service started just fine using the WcfClientTest tool. I checked all of the project properties and couldn’t find any setting that triggered this tool to be started.&lt;br /&gt;&lt;br /&gt;Upon doing some digging, these configuration attributes are in the .vbproj or .vbproj.user files (.csproj or .csproj.user for C# projects). In the .vbproj file the &amp;lt;EnableWcfTestClientForSVCDefaultValue&amp;gt; tag needs to be present and set to 'true'. This can also be done in the vbproj.user file, but it is the &amp;lt;EnableWcfTestClientForSVC&amp;gt; configuration and it would also need to be set to 'true'. Only the configuration in the main .vbproj file is needed for the WCF service to start using the WcfClientTest.exe tool. Sure enough an older service of mine was completely missing this configuration. The proper configuration element is displayed below.&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;ProjectExtensions&amp;gt;&lt;br /&gt;  &amp;lt;VisualStudio&amp;gt;&lt;br /&gt;    &amp;lt;FlavorProperties GUID="{123c5851-25df-10da-9384-00011b846f00}"&amp;gt;&lt;br /&gt;      &amp;lt;WebProjectProperties&amp;gt;&lt;br /&gt; &amp;lt;EnableWcfTestClientForSVCDefaultValue&amp;gt;True&amp;lt;/EnableWcfTestClientForSVCDefaultValue&amp;gt;&lt;br /&gt;      &amp;lt;/WebProjectProperties&amp;gt;&lt;br /&gt;    &amp;lt;/FlavorProperties&amp;gt;&lt;br /&gt;  &amp;lt;/VisualStudio&amp;gt;&lt;br /&gt;&amp;lt;/ProjectExtensions&amp;gt;&lt;br /&gt;&lt;/pre&gt;You can open either the .vbproj or vbproj.user files by right-clicking in Windows Explorer and opening with notepad. Once the configuration is added and set to 'true' the service will launch using the WcfClientTest.exe tool as expected.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-9125955866060104293?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/9125955866060104293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/how-to-fix-when-wcf-service-does-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/9125955866060104293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/9125955866060104293'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/how-to-fix-when-wcf-service-does-not.html' title='How to Fix When a WCF Service Does Not Debug via the &quot;WCF Test Client&quot; Tool'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_o-C99bmODDI/TDspY6VVlkI/AAAAAAAAAGI/g1rhX08j2Zs/s72-c/WcfClientTest+Tool.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-2217067790534745980</id><published>2010-07-07T20:27:00.001-04:00</published><updated>2010-07-08T15:31:14.434-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Setting Up the ClientBin Folder to Debug a Silverlight Control in a Test ASP.NET Application</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you create a new Silverlight control using either VS.NET 2010 or Expression Blend 4, you are already off on the right foot for setting up a test ASP.NET application for running and debugging a Silverlight control. The newer versions of these applications configure well the test project, creating the 'ClientBin' folder, and associated test .aspx page including preconfigured &amp;lt;object&amp;gt; tags referencing the control.&lt;br /&gt;&lt;br /&gt;But what if you have an old or mis-configured project that manually references a .xap file, or had to be constantly updated in Explorer in the referenced path? It is especially important to have the configuration correct in a test app or debugging the .xap from the source Silverlight project is not possible. The following steps describe how to easily reconfigure your ASP.NET test harness to properly reference the .xap generated from the Silverlight control created within the &lt;em&gt;same&lt;/em&gt; solution.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; Right click the ASP.NET test project and select 'New Folder'. Name it 'ClientBin' (without the quotes). Only do this step if the folder does not already exist.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Right click the ASP.NET test project (this project should be in the same solution as the Silverlight Control being referenced) and select 'Properties' (or 'Property Pages' for website projects).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; While still in the Properties, open the 'Web' (for web project types) or 'Start Options' (for website types) and make sure to scroll down and have the 'Silverlight' checkbox checked under 'Debuggers'.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4.&lt;/strong&gt; Select the 'Silverlight Applications' tab or selection on the left hand pane.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.&lt;/strong&gt; Click the 'Add' button to bring up the 'Add Silverlight Application' dialog box.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6.&lt;/strong&gt; Make sure the radio button selection for 'Use an existing Silverlight project in the solution' is selected, and select the Silverlight control to reference.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7.&lt;/strong&gt; In the 'Destination folder:' field, make sure 'ClientBin' is in the textbox. This will most likely be pre-populated.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8.&lt;/strong&gt; Configure the remaining options to your liking. I suggest leaving 'Add a test page that references the control' checked as this will save you from having to do this from scratch.&lt;br /&gt;&lt;br /&gt;At this point try starting debugging the Silverlight code by placing a breakpoint in the source. Obviously make sure the ASP.NET test app is set as the default project, and set the newly created page to be the startup page. If you configured it correctly, your code will properly place any new builds of the .xap into the ClientBin folder of the test app, and should allow for proper debugging. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-2217067790534745980?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/2217067790534745980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/setting-up-clientbin-folder-to-debug.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2217067790534745980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2217067790534745980'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/setting-up-clientbin-folder-to-debug.html' title='Setting Up the ClientBin Folder to Debug a Silverlight Control in a Test ASP.NET Application'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-2440670588848327803</id><published>2010-07-06T22:31:00.003-04:00</published><updated>2010-07-07T15:38:46.079-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Fixing the "attempting to access a service in a cross-domain way..." error when consuming a WCF service running via a VS.NET 'localhost' binding</title><content type='html'>&lt;span style="font-family:arial;"&gt;There must be 1000 good blog posts about setting up the clientaccesspolicy.xml and crossdomain.xml files for a WCF service being accessed by a Silverlight application or control. This consists of dropping these files in the root of the site on the server where the site is hosted. But where do these guys go if you are actively running your WCF service locally (through VS.NET) and still want to consume the service?&lt;br /&gt;&lt;br /&gt;I recently had my WCF service running through VS.NET so I could consume and debug it through an ASP.NET test harness. This is a really powerful way to iron out any WCF service issues. Upon launching the .aspx page that contained the .xap Silverlight control that had consumed the localhost version of the WCF service running (not a locally installed WCF service to reiterate; just actively running through VS.NET) I began to get the following exception:&lt;br /&gt;&lt;br /&gt;"An error occurred while trying to make a request to URI 'http://localhost:6000/MyWCFService.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent."&lt;br /&gt;&lt;br /&gt;What - I thought I fixed this a long time ago?? I realized I had never configured the clientaccesspolicy and crossdomain .xml files just for a service running locally. I started plopping those (2) files everywhere: wwwroot, project, etc. I finally found where they should be placed in order for an ASP.NET app containing a Silverlight control that has consumed a locally running WCF service is supposed to go: in the root of the project folder alongside the .svc and .vbproj files. Once I placed the (2) files into that directory containing the raw VS.NET files, the SL control began working properly.&lt;br /&gt;&lt;br /&gt;Makes 100% sense too. If running through VS.NET Cassini local server, those files should be located with the actual service itself.&lt;br /&gt;&lt;br /&gt;Again, this is only 1 of many, many ways to solve the original issue at hand. This is only a solution for Silverlight controls that consume a locally running (not installed) WCF service. Hopefully this saves someone else a few minutes. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-2440670588848327803?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/2440670588848327803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/fixing-attempting-to-access-service-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2440670588848327803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2440670588848327803'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/fixing-attempting-to-access-service-in.html' title='Fixing the &quot;attempting to access a service in a cross-domain way...&quot; error when consuming a WCF service running via a VS.NET &apos;localhost&apos; binding'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-980518076886965108</id><published>2010-07-05T23:26:00.003-04:00</published><updated>2010-11-01T16:39:53.783-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='MS'/><title type='text'>Updating Microsoft Charting Controls for .NET from VS.NET 2008 to VS.NET 2010</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you recently did an upgrade of a project from VS.NET 2008 to 2010 that contained the Microsoft Charting controls for .NET, then you probably encountered some errors upon 1st run if you are now targeting the .NET Framework 4.0. The solution is to upgrade the charting references to the new .dll version throughout the application.&lt;br /&gt;&lt;br /&gt;One possible exception you may have encountered immediately is the following:&lt;br /&gt;"'Legend' is ambiguous in the namespace 'System.Web.UI.DataVisualization.Charting'."&lt;br /&gt;&lt;br /&gt;This all points to the need to update the references to the 4.0.0.0 version of the System.Web.DataVisualization.dll used by the MS Chart controls. The following steps need to be completed to get your project current and working with the 4.0 version of the Chart controls.&lt;br /&gt;&lt;br /&gt;1. Remove the reference to the System.Web.DataVisualization .dll in the project. If just converted it will still be referencing the 3.5.0.0 version of the .dll.&lt;br /&gt;&lt;br /&gt;2. Add a reference to the new 4.0.0.0 version of the .dll from the '.NET' tab when adding a reference to your project. You can view the 'Version' column to make sure you have the correct reference.&lt;br /&gt;&lt;br /&gt;3. In the web.config, update the version number in the 'Controls' tag from 3.5.0.0 to 4.0.0.0. Nothing else needs to be modified; the PublicKeyToken, etc. are all the same. Just change the version number. The corrected configuration is displayed below:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&amp;lt;pages&amp;gt;&lt;br /&gt;  &amp;lt;controls&amp;gt;&lt;br /&gt;    &amp;lt;add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&amp;gt;&lt;br /&gt;  &amp;lt;/controls&amp;gt;&lt;br /&gt;&amp;lt;/pages&amp;gt;&lt;br /&gt;&lt;/pre&gt;4. In the web.config, update the version number in the 'assembly' tag for the System.Web.DataVisualization reference from 3.5.0.0 to 4.0.0.0 if not already done. This may have been updated when adding the reference in Step #2, but if not go ahead and modify it now. The corrected configuration is displayed below:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&amp;lt;add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&amp;gt;&lt;br /&gt;&lt;/pre&gt;5. In the web.config, update the 'httpHandlers' section for "ChartImg.axd" version once again from 3.5.0.0 to 4.0.0.0. The corrected configuration is displayed below:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&amp;lt;httpHandlers&amp;gt;&lt;br /&gt;  &amp;lt;add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/&amp;gt;&lt;br /&gt;&amp;lt;/httpHandlers&amp;gt;&lt;br /&gt;&lt;/pre&gt;6. In the markup of any page using the Chart controls, remove the page registration for the assembly; just delete it. The next step will add back in the proper registration.&lt;br /&gt;&lt;br /&gt;7. From the 'ToolBox' under the 'Data' tab, drag a 'Chart' control onto your existing page. This simple method will create the proper registration at the top of the page. Make sure to modify the 'TagPrefix' to the proper value if you had changed it previously from the default 'asp' used. After the registration is added back to the page, you can delete the chart control dragged on the page; it was just used to create the proper registration (this happens whenever a new control is dragged onto a page). Repeat this step for any pages that have a chart control on them. The proper page registration is shown below:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&amp;lt;%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&lt;br /&gt;    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %&amp;gt;&lt;br /&gt;&lt;/pre&gt;8. Rebuild your solution and run it. Your MS Chart controls should now be displayed properly!&lt;br /&gt;&lt;br /&gt;As an additional reference, the MS Chart samples for .NET have been updated for the .NET Framework 4.0. If you have any additional problems, download the samples project and view the code or markup. You can find the samples at the following link:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://code.msdn.microsoft.com/mschart"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;"&gt;Samples Environment for .NET Framework 4 Chart Controls Released!&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-980518076886965108?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/980518076886965108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/updating-microsoft-charting-controls.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/980518076886965108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/980518076886965108'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/07/updating-microsoft-charting-controls.html' title='Updating Microsoft Charting Controls for .NET from VS.NET 2008 to VS.NET 2010'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7752766969637999425</id><published>2010-06-04T21:40:00.004-04:00</published><updated>2010-11-01T16:41:53.651-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Twitter API'/><title type='text'>Converting the Twitter API "created_at" string into a .NET Date Object</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you have worked with the Twitter API in .NET, you will receive a string date representation back corresponding to a tweet in the following format:&lt;br /&gt;&lt;br /&gt;"Tue Apr 07 22:52:51 +0000 2009"&lt;br /&gt;&lt;br /&gt;If you are like me, you may prefer to have this converted into a .NET Date or DateTime object. This is easy enough to do with the .ParseExact method on a Date object. We just have to provide it a date format for which we are inputting. The magic date formula for the Twitter "created_at" date is as follows: "ddd MMM dd HH:mm:ss zzz yyyy"&lt;br /&gt;&lt;br /&gt;The following code shows how to convert this string into a valid date:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Dim TwitterStringDate As String = "Tue Apr 07 22:52:51 +0000 2009"&lt;br /&gt;Dim TwitterDate As Date = Date.ParseExact(TwitterStringDate, "ddd MMM dd HH:mm:ss zzz yyyy", CultureInfo.InvariantCulture)&lt;br /&gt;&lt;/pre&gt;You might actually do this as part of a LINQ query, and in that case, you might have something within your query that looks similar to the code below: &lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;.PublishDate = If(xe.&lt;created_at&gt;.Value IsNot Nothing, Date.ParseExact(xe.&lt;created_at&gt;.Value, "ddd MMM dd HH:mm:ss zzz yyyy", CultureInfo.InvariantCulture), Date.MinValue)&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7752766969637999425?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7752766969637999425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/06/converting-twitter-api-createdat-string.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7752766969637999425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7752766969637999425'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/06/converting-twitter-api-createdat-string.html' title='Converting the Twitter API &quot;created_at&quot; string into a .NET Date Object'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7140271302234840476</id><published>2010-06-01T21:18:00.002-04:00</published><updated>2010-11-01T16:42:26.393-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Fixing the WCF 'The remote server returned an error: (415) Unsupported Media Type.HTTP GET' Error</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently I was building a typical WCF service hosted in IIS on Windows7 using VS.NET 2010 (I have done this several times). Every time I either tried to start the service within VS.NET locally, or actually consume the installed IIS instance on my local machine I would get the following error:&lt;br /&gt;&lt;br /&gt;"Error: Cannot obtain Metadata from http://localhost:3509/MyNetworkingService.svc The remote server returned an error: (415) Unsupported Media Type.HTTP GET Error"&lt;br /&gt;&lt;br /&gt;I thought I had tried everything with the configuration; had all my "i" 's dotted and my "t" 's crossed. Plus the (415) Unsupported Media Type portion of the message was really throwing me off the proper path to fix the issue. The problem and the fix? A spelling mistake in the name of the service within the .config file. Fixing it was as easy as copying the properly assigned service name from the .svc Markup and into the .config file.&lt;br /&gt;&lt;br /&gt;I had the word '&lt;strong&gt;Networking&lt;/strong&gt;' in my service name, and I spelled it '&lt;strong&gt;Netwoking&lt;/strong&gt;'. They were so close visually that it didn’t present itself immediately. As many services as I have created and still made a rookie mistake. A nice "Your service name and configuration service name don't match" message would have been nicer than a (415) Unsupported Media Type error, but no big deal it was my mistake.&lt;br /&gt;&lt;br /&gt;The real lesson learned for the future - just be safe and copy the name used in the markup of the .svc file (you can get to this by right-clicking the .svc file in Solution Explorer and selecting "View Markup") and paste it into the .config. Below is a working template for a barebones WCF service hosted in IIS using "basicHttpBinding":&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;  &amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;    &amp;lt;services&amp;gt;&lt;br /&gt;      &amp;lt;service name="MyNetworkingService.NetworkingService" &lt;br /&gt;                     behaviorConfiguration="ServiceBehavior"&amp;gt;&lt;br /&gt;        &amp;lt;endpoint address="" &lt;br /&gt;                  binding="basicHttpBinding" &lt;br /&gt;                  contract="MyNetworkingService.INetworkingService" /&amp;gt;        &lt;br /&gt;&lt;br /&gt;        &amp;lt;endpoint address="mex" &lt;br /&gt;                  binding="mexHttpBinding" &lt;br /&gt;                  contract="IMetadataExchange" /&amp;gt;&lt;br /&gt;        &amp;lt;!--When hosting a WCF service in IIS, you don't need to specify a base address nor an endpoint, &lt;br /&gt;            because the Endpoint will simply be the Virtual Path that your service points to.--&amp;gt;&lt;br /&gt;        &lt;br /&gt;      &amp;lt;/service&amp;gt;&lt;br /&gt;    &amp;lt;/services&amp;gt;&lt;br /&gt;    &amp;lt;behaviors&amp;gt;&lt;br /&gt;      &amp;lt;serviceBehaviors&amp;gt;&lt;br /&gt;        &amp;lt;behavior name="ServiceBehavior"&amp;gt;&lt;br /&gt;          &amp;lt;!-- To avoid disclosing metadata information, set the value below &lt;br /&gt;        to false and remove the metadata endpoint above before deployment --&amp;gt;&lt;br /&gt;          &amp;lt;serviceMetadata httpGetEnabled="true"/&amp;gt;&lt;br /&gt;          &amp;lt;!-- To receive exception details in faults for debugging purposes, &lt;br /&gt;        set the value below to true.  Set to false before deployment to &lt;br /&gt;        avoid disclosing exception information --&amp;gt;&lt;br /&gt;          &amp;lt;serviceDebug includeExceptionDetailInFaults="false"/&amp;gt;&lt;br /&gt;        &amp;lt;/behavior&amp;gt;&lt;br /&gt;      &amp;lt;/serviceBehaviors&amp;gt;&lt;br /&gt;    &amp;lt;/behaviors&amp;gt;&lt;br /&gt;  &amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7140271302234840476?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7140271302234840476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/06/fixing-wcf-remote-server-returned-error.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7140271302234840476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7140271302234840476'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/06/fixing-wcf-remote-server-returned-error.html' title='Fixing the WCF &apos;The remote server returned an error: (415) Unsupported Media Type.HTTP GET&apos; Error'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-2894566173361628920</id><published>2010-06-01T09:38:00.006-04:00</published><updated>2010-06-02T09:44:58.710-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2010'/><title type='text'>Using Auto-Properties and Traditional Properties with VB.NET in VS.NET 2010</title><content type='html'>&lt;span style="font-family:arial;"&gt;Once you being using VS.NET 2010 as a VB.NET user, you will soon see the neat feature of Auto-Properties which C# users have enjoyed since VS.NET 2008. I will not go too much into them as the feature has been covered exhaustively across blogs and sites. In a nutshell the Auto-Property feature provides a short hand way of defining properties without having to fully write out the Get and Set code, along with the backing variable.&lt;br /&gt;&lt;br /&gt;But what if you do need a more advanced property, where the data is manipulated? How do I get back to the more explicit long-hand format of a property if I need it? At least in VS.NET 2008, after finishing the definition of the property and its type and pressing &amp;lt;enter&amp;gt; the template was generated for me, so how do I recreate this in VS.NET2010?&lt;br /&gt;&lt;br /&gt;The answer is to type in 'prop' (without quotes) which will show an Intellisense menu of built in snippets including the needed 'Property' code (shown below):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/TAZfvEuu0EI/AAAAAAAAAFw/uzLiYHimrt4/s1600/AutoProperties1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 70px;" src="http://3.bp.blogspot.com/_o-C99bmODDI/TAZfvEuu0EI/AAAAAAAAAFw/uzLiYHimrt4/s400/AutoProperties1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5478171259071025218" /&gt;&lt;/a&gt;&lt;br /&gt;Type in 'prop' and hit the tab key twice to produce the long-hand explicitly defined version of the Property. In fact even this is 1 up from VS.NET 2008 as it creates the backing variable right on top of the property. All you need to do is tab through the fields to modify the values as needed. The long-hand version of the property is displayed below:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/TAZfJtdvXfI/AAAAAAAAAFo/L7VKfN9QQzc/s1600/AutoProperties2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 193px;" src="http://2.bp.blogspot.com/_o-C99bmODDI/TAZfJtdvXfI/AAAAAAAAAFo/L7VKfN9QQzc/s320/AutoProperties2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5478170617170583026" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-2894566173361628920?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/2894566173361628920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/06/using-auto-properties-and-traditional.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2894566173361628920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/2894566173361628920'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/06/using-auto-properties-and-traditional.html' title='Using Auto-Properties and Traditional Properties with VB.NET in VS.NET 2010'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_o-C99bmODDI/TAZfvEuu0EI/AAAAAAAAAFw/uzLiYHimrt4/s72-c/AutoProperties1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7932565097878102774</id><published>2010-05-26T23:50:00.001-04:00</published><updated>2010-05-27T16:53:24.652-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2010'/><title type='text'>Add SourceSafe Add-In to VS.NET 2010</title><content type='html'>&lt;span style="font-family:arial;"&gt;Ok for those out there that are still way behind on moving to Team Foundation Server and still use SourceSafe, you will find adding solutions to it in VS.NET 2010 is not enabled by default. To switch source control providers back to SourceSafe do the following: Goto 'Tools' -&gt; 'Options' and select "Show all settings". Expand the "Source Control" node and then select "Plug-in Selection". On the right hand side change the value in the "Current source control plug-in:" to "Microsoft Visual SourceSafe" (pictured below).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/S_7bQhu7MLI/AAAAAAAAAFY/pKCHExIGiaM/s1600/VS2010SS.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 185px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5476055273908678834" border="0" alt="" src="http://2.bp.blogspot.com/_o-C99bmODDI/S_7bQhu7MLI/AAAAAAAAAFY/pKCHExIGiaM/s320/VS2010SS.png" /&gt;&lt;/a&gt;&lt;br /&gt;Then sometime soon consider moving to Team Foundation Server, which has a "Basic" version that allows a route into a new provider for those intimidated by switching away from SourceSafe.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7932565097878102774?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7932565097878102774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/05/add-sourcesafe-add-in-to-vsnet-2010.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7932565097878102774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7932565097878102774'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/05/add-sourcesafe-add-in-to-vsnet-2010.html' title='Add SourceSafe Add-In to VS.NET 2010'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_o-C99bmODDI/S_7bQhu7MLI/AAAAAAAAAFY/pKCHExIGiaM/s72-c/VS2010SS.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-6496454218006351441</id><published>2010-05-24T22:55:00.002-04:00</published><updated>2010-11-01T16:43:38.272-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Object Data Source'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Caching'/><title type='text'>Using Caching on an Object Data Source and Making it Unique Per User</title><content type='html'>&lt;span style="font-family:arial;"&gt;I am a fan of the Object Data Source control especially when binding objects to controls such as a GridView for ASP.NET web forms. Not a 'huge' fan, but a fan none the less. I find its ability to organize binding methods and events consistently makes it a decent option for binding, along with its ability to present the objects wired up in a strongly typed manner during configuration.&lt;br /&gt;&lt;br /&gt;One of the nicest features of the ODS is its ability to implement caching. The ODS control will call it’s wired up '.Select()' method on the object upon binding. For (2) main reasons I can see how caching can be useful.&lt;br /&gt;&lt;br /&gt;1. Use ODS caching to prevent multiple users pulling the 'exact' same static data. Caching is an application level store, so once ODS data is stored in the Page's cache, it can be shared to all client's. Why make 20 calls to the database amongst 20 clients for the identical data? This is a good candidate for caching.&lt;br /&gt;&lt;br /&gt;2. Use ODS caching when the user is pulling back several records (i.e. 500-1000) records to be displayed in a Gridview, but don’t want the .Select()method called every time the Grid is paged. Essentially getting all 1000 records on each paging command, but yet only displaying maybe 10 at a time on the screen. With caching, all 1000 are pulled back the 1st time, but subsequent paging calls in the bound GridView only have to access the cache for the data and not call the database again. Another good candidate for caching.&lt;br /&gt;&lt;br /&gt;If you only need caching for the purpose of the situation described in #1 above then you can stop and are done. This is the way it appears Microsoft designed the caching in the ODS, and really the only thing you need to do is set 'EnableCaching="True"' on the ODS control. It was well designed for the scope of sharing the same data via the cache for multiple clients running the ASP.NET web application.&lt;br /&gt;&lt;br /&gt;But what about #2 above. The tricky part is the Cache object is an Application level store shared amongst all clients. What if you still wanted to implement caching for an individual user that requested the 1000 records via some search criteria, but yet don't want that same 1000 record pulled for a different user attempting to pull data based on another criteria. This is exactly what will happen with the default behavior. User2 would get User1's records because the cache is shared by the same ODS between applications. This is easy to test by opening 2 browsers on the same or separate machines. Have User1 do a custom search that populates a GridView, and then have User2 do the same but with different criteria. Upon User1 paging the GridView after User2's results are displayed, User1 will see User2's results. It sure would be nice if there was a "MakeCachingVaryByUser" True/False option on the ODS but it does not exist.&lt;br /&gt;&lt;br /&gt;So we need a work around so that we can still leverage caching but make it unique per user. Initially I thought this might be as easy as assigning a unique value to the "CacheKeyDependency" value at runtime server side and hoping data stored in the cache would be based on that unique key for the user, but that did not work. Upon doing testing of this scenario I came to find out the ODS control has some undocumented idiosyncrasies that make it cumbersome to work with at times. The 1st of these was determining that no matter what value I tried to set for the 'CacheKeyDependency' property (or any ODS cache related property) at runtime say in Page_Load() would not stick. Only the value assigned in the page's source was used by the ODS and continually referred to. I tested this by placing a label on a page and writing to it the value of the "CacheKeyDependency" and "CacheDuration". On Page_Load these values would display whatever was assigned in the Page's source. Upon overwriting them, you could verify for a moment the new values were indeed assigned, but upon any subsequent postback to the server, the ODS reverted back to its default values assigned in the source. Well then I thought, I will just store the values in ViewState or in a HiddenField and continually overwrite the ODS properties on all postbacks, right?? Nice try, but still didn’t work. It kept pointing me to the fact that whatever was assigned in the source is what the ODS was married to, and wasn’t going to allow any changes.&lt;br /&gt;&lt;br /&gt;So my next step was to determine, "How can I somehow assign a dynamic value to those properties in the page's source, so that a unique cache allocation will be created per user?" This is where the solution comes into play. I must also stop and mention what combination of properties make a 'unique' combination for the ODS according to the MSDN documentation. Let's take a look:&lt;br /&gt;&lt;br /&gt;"A unique cache entry is created for every combination of the CacheDuration, CacheExpirationPolicy, TypeName, SelectMethod, and SelectParameters properties."&lt;br /&gt;&lt;br /&gt;Ok, between my users CacheExpirationPolicy, TypeName, SelectMethod, and SelectParameters (the actual parameters not the values of the parameters) are always going to be the same. The one that can change... 'CacheDuration'. This specifies a time in seconds before the cache is expired and the ODS will call the select method again. Since caching to me is a 'helpful' attribute of the app, and not a requirement, I do not care too much about this value as long as something reasonable is assigned. And wait! Is the "CacheKeyDependency" value not used to create a unique combination?? That's correct it is not. But we are still going to dynamically create the value as we are the "CacheDuration" to ensure a unique client combination. And assigning the "CacheKeyDependency" to a unique value actually bypassed some odd behavior of calling the .Select() method each time a separate client made a new search, so the combination of both being dynamically created makes up the solution.&lt;br /&gt;&lt;br /&gt;Now to the code. Let's begin with the source behind the controls. We need to use inline server tags that actually are used for DataBound controls. We can specify some TimeSpan attributes like 'TimeOfDay' or 'Ticks' to generate some unique values. We use the String.Format function with a placeholder, passing in the TimeSpan method chosen. Foe the "CacheKeyDependency" that actual type is string, so it can be long and we don’t have to worry too much about size. We will use Now.Ticks() for this. The cache duration is an Integer value in seconds so we don’t want it to surpass the bounds; for this we will use Now.TimeOfDay.Milliseconds().&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;EnableCaching="true" &lt;br /&gt;CacheExpirationPolicy="Sliding"&lt;br /&gt;CacheKeyDependency='&amp;lt;%# String.Format("{0}", Now.Ticks()) %&amp;gt;'&lt;br /&gt;CacheDuration='&amp;lt;%# String.Format("{0}", Now.TimeOfDay.Milliseconds()) %&amp;gt;'&lt;br /&gt;&lt;/pre&gt;Now in order for the above to resolve to their actual values, we must call the .DataBind() method on the ODS control. This actually ends up serving a dual purpose as it will ensure the .Select() method is called each time the page initially loads, and it will resolve our server code into usable values. If we didn't call .DataBind, we would end up showing the string literal from the property assignment which is no good. Here is the code that needs to be placed in the Page_Load method:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;If Not IsPostBack Then&lt;br /&gt;&lt;br /&gt; 'Call .DataBind() on the Page so the Properties on the ODS below that have serverside&lt;br /&gt; 'code associated to the 'CacheKeyDependency' &amp; 'CacheDuration' properties will resolve.&lt;br /&gt; Me.odsItems.DataBind()&lt;br /&gt;&lt;br /&gt; 'Expire the cache entry programmatically by expiring the key. The key can be expired by using the &lt;br /&gt; 'Cache.Remove method with the current CacheKeyDependency value as the parameter.&lt;br /&gt; 'When the cache item is removed, all the cached data that is dependent on the key is expired.&lt;br /&gt; 'This will force a fresh pull by calling the ODS's wired up Select() method again.&lt;br /&gt; Cache.Remove(Me.odsItems.CacheKeyDependency)&lt;br /&gt; 'It's imperative that the ODS 'CacheKeyDependency' value exists in the Page's cache, &lt;br /&gt; 'otherwise the data cached by the ODS control will be immediately evicted from the data cache    &lt;br /&gt; 'each time its added.  It is added implicitly in the line below if it does not already exist.&lt;br /&gt;&lt;br /&gt; 'Using the key value reference of the ODS in the Page's cache, assign an arbritarty new value.&lt;br /&gt; 'This process expires the current cache assosiated with the ODS which will force new data to be pulled.&lt;br /&gt; 'If this is not done, subsiquient databound control events or page interactions will pull data &lt;br /&gt; 'from cache to populate the bound control as opposed to requesting new data.&lt;br /&gt; Cache(Me.odsItems.CacheKeyDependency) = DateTime.Now&lt;br /&gt;&lt;br /&gt; 'Store both values in hidden field controls so subsiquient server calls can reload the same values.&lt;br /&gt; 'This will need to be done, because the inline server code property attributes only resolve when Page.DataBind() is called.&lt;br /&gt; 'This way we do it once above, and then just reload the values later.&lt;br /&gt; Me.hfODSCacheKey.Value = Me.odsItems.CacheKeyDependency&lt;br /&gt; Me.hfODSCacheDuration.Value = Me.odsItems.CacheDuration.ToString()&lt;br /&gt;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'The 'CacheKeyDependency' &amp; 'CacheDuration' values MUST be reset on all server calls so the default&lt;br /&gt;'databound value will be used as assigned on the ODS directly. Since the Page is only&lt;br /&gt;'databound in initial PageLoad, these values can just be reassigned from their corresponding HiddenField values.&lt;br /&gt;'This MUST be done or the cache would revert to the default literal value from the control which will not&lt;br /&gt;'match because it uses inline server-side code to generate dynamic values so the cache essentially is user specefic.&lt;br /&gt;Me.odsItems.CacheDuration = Me.hfODSCacheDuration.Value&lt;br /&gt;Me.odsItems.CacheKeyDependency = Me.hfODSCacheKey.Value&lt;br /&gt;&lt;/pre&gt;After the databind, we evict the cache using the newly assigned values to make sure that one it exists in the Page's cache, and two that there is nothing assigned (or actually an arbitrary DateTime value). Next we assign (2) hidden field controls (or ViewState - just needs to be page specific; don't use Session for these values) the values of the generated "CacheKeyDependency" and the "CacheDuration". This will be pulled on subsequent post backs and reassigned to the ODS. But wait a minute??? I know what you are thinking - you said reassigning the ODS properties with custom values didn't work, right? Yes, but these values match the values initially assigned in the source to the ODS, as opposed to overwriting the values with newly created ones. This is that undocumented feature that we are attempting to adhere to.&lt;br /&gt;&lt;br /&gt;Lastly, notice the code that will reassign the "CacheKeyDependency" &amp;amp; "CacheDuration" properties on the ODS on each postback. This ensures that the ODS is placing data in the proper cache location, and it must be done or the literal value from the server tags would be used and we will lose reference to our data. The important piece here is that the initial value assigned in source to the ODS is continually reassigned.&lt;br /&gt;&lt;br /&gt;At this point that's all the code you need! I recommend if doing this on several pages that you refactor the code above into a 'Shared' Utility UI method. You may end up needing to pass in the Page, Cache, ODS, and ViewState objects in order to refactor to a centralized method outside the page. You can do this later after everything is working well and tested.&lt;br /&gt;&lt;br /&gt;The last piece of code will allow you to forcibly evict the cache. Why would you want to do this? If you had a GridView based on search criteria, and a new search was made. In this case you don’t want the default behavior of grabbing data from the cache; you want new data pulled. There are several other reasons you may want to force a fresh data pull, so inject the code below where needed.&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;'Expire the current cache assosiated with the ODS which will force new data to be pulled.&lt;br /&gt;'If this is not done, this process would not yield new results as the ODS would&lt;br /&gt;'continue to pull existing data from the cache; in our case we want new data.&lt;br /&gt;PageCache.Remove(Me.odsItems.CacheKeyDependency)&lt;br /&gt;PageCache(Me.odsItems.CacheKeyDependency) = DateTime.Now&lt;br /&gt;&lt;/pre&gt;The (2) lines above are another good candidate for code refactoring into a centralized Shared UI method (i.e. Utilities.ClearODSCache, etc.). Once again you might need to pass in the ODS control and PageCache objects in order to refactor outside the page.&lt;br /&gt;&lt;br /&gt;So in just a few lines of code we have modified the caching offered by the IDS control to be user specific. This way we get the performance and caching attributes provided by caching, but the low level scope we needed. There are other 'big picture' ways to probably solve this same issue. For example, don't use the IDS at all, and just persist the Object source for DataBinding in Session and constantly access it there as opposed to going to the Database. Another option might be to siphon 'e.Result' in the 'Completed' event of an ODS and store that in Session. Then on subsequent calls to the '.Selecting()' method, check to see if an object exists as the DataSource already and cancel the operation. There are probably others too, but the ones mentioned here have pitfalls within, by using larger scale techniques to solve a specific issue. I prefer the method of this post because it is specific to addressing how to modify the caching ability to be unique per user. If you would like to learn more about how native caching works for the ODS control, please view the link below.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.asp.net/data-access/tutorials/caching-data-with-the-objectdatasource-vb"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;" &gt;Caching Data with the ObjectDataSource&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-6496454218006351441?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/6496454218006351441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/05/using-caching-on-object-data-source-and.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6496454218006351441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6496454218006351441'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/05/using-caching-on-object-data-source-and.html' title='Using Caching on an Object Data Source and Making it Unique Per User'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-5416428966224193370</id><published>2010-05-18T22:32:00.005-04:00</published><updated>2010-11-01T16:44:29.152-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='Lambda Expressions'/><title type='text'>Methods for Comparing Lists of Objects Based on a Single Property</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently I had the need to get a new list of objects that results in a new list with all of the items in 'MyList1' that don't already exist in 'MyList2'. At 1st glace I thought I could use the Enumerable.Except function to accomplish this. However I soon came to realize that if the class representing this list has 10 properties, all 10 properties are checked to find the difference. This does make sense and works as intended, but in my case the results were not what I wanted because one of the properties was a timestamp, and even though an object in MyList1 had the same 'ID' as an object from 'MyList2', its timestamp property was different thus retuning that object into the new list as well. What I needed to do was base the returned list results on a single property: 'ID'. This is all that I cared about, so the default overload of the .Except method of an IEnumberable type was not going to work.&lt;br /&gt;&lt;br /&gt;A few methods presented themselves on how to solve this issue. If you are reading this through and you do not need to discriminate differences of objects for a single or few properties and it is a strict 1:1 comparison, you are done! Just use the .Except method as shown below:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;  Dim MyList1 As New List(Of Customer)&lt;br /&gt;  Dim MyList2 As New List(Of Customer)&lt;br /&gt;  '...populate the above lists with data&lt;br /&gt;  Dim ItemsInList1NotInList2 As New List(Of Customer)&lt;br /&gt;  'Get all of the items in MyList1 that do not already exist in MyList2 using the .Except() method&lt;br /&gt;  ItemsInList1NotInList2 = MyList1.Except(MyList2)&lt;br /&gt;&lt;/pre&gt;The 1st method in solving this issue is to use the second overload of the .Except method to define the IEqualityComparer(Of T) to compare values. This involves implementing the IEqualityComparer on the class being compared and defining the methods required by the interface for a custom comparer. Now in my case the comparison was for a specific case and I wanted a solution that was more inline. I wouldn't want to define a compare method for the class unless it was definite that this was always how the class was to be compared. In my situation this was not true so I did not implement the interface, but check out the link below for an explanation and code example on implementing the IEqualityComparer interface:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb336390%28VS.95%29.aspx"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;"&gt;Enumerable.Except(Of TSource) Method&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The 1st of (2) methods that worked for a more localized inline solution where to use the methods exposed on an IQueryable source, such as the .Where() and .Select() methods in the System.Linq namespace. By calling the .Where method as an instance method on MyList1 we can define a predicate that will test for a condition and return the resulting values. In our case we want to pass into the Where() method a Lambda expression that will use anonymous functions to test for a condition and return the resulting values. Let's look at the code:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;  Dim MyList1 As New List(Of Customer)&lt;br /&gt;  Dim MyList2 As New List(Of Customer)&lt;br /&gt;  '...populate the above lists with data&lt;br /&gt;  Dim ItemsInList1NotInList2 As New List(Of Customer)&lt;br /&gt;  'Get all of the items in MyList1 that do not already exist in MyList2 using the .Where() method&lt;br /&gt;  ItemsInList1NotInList2 = MyList1.Where(Function(i) (MyList2.Select(Function(i2) i2.ID).Contains(i.ID) = False)).ToList()&lt;br /&gt;&lt;/pre&gt;So the above code can loosely be read from the inside out as "Select all IDs from MyList2 that do not exist in MyList1 and return them into a list of type MyList1". The .Where() method returns the elements from source that satisfy the condition specified by predicate. A predicate is a function that will test each element for a condition returning a Boolean value. In our case the Boolean value returned is True/False if the .ID in MyList2 exists in MyList1. Also notice the .Select() method called on MyList2 to project over the sequence of .ID values and use the index of each element in the projected form. Both IQuerable methods define an Anonymous method in VB.NET using the 'Function()' keyword accepting parameter of the type to be used. In our case the .Where() method takes the anonymous type 'i' which is of type MyList1 and the .Select() method takes an anonymous type 'i2' of type MyList2. If we were to decompile the above code we should see all of the values in MyList2 being iterated over to determine if the .ID value already exists in MyList1 and if not adding it to a new list of type MyList1 that is the result. Just remember that Lambda expression are just syntax sugar. In our case you could write the same code long hand by defining a delegate method that takes in the list types and iterates through them to get the same result. The Lambda expressions make our life as developers much easier by not having to write out so much code.&lt;br /&gt;&lt;br /&gt;To me I probably prefer the method above to solve this issue because it is the most concise. However, those not familiar with anonymous types and Lambda expressions may not read the code above so well and want something a bit more explicit in definition. The 2nd method to solve our issue is to define a simple LINQ query dumping the result into a an anonymous type and then converting it into a list. I think the advantage of this 2nd method is it is much more readable. Let's take a look at the code:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;  Dim MyList1 As New List(Of Customer)&lt;br /&gt;  Dim MyList2 As New List(Of Customer)&lt;br /&gt;  '...populate the above lists with data&lt;br /&gt;  Dim ItemsInList1NotInList2 As New List(Of Customer)&lt;br /&gt;  'Get all of the items in MyList1 that do not already exist in MyList2 using a LINQ query&lt;br /&gt;  Dim query = From ItemsIn1 In MyList1 _&lt;br /&gt;              Where Not (From ItemsIn2 In MyList2 _&lt;br /&gt;              Select ItemsIn2.ID).Contains(ItemsIn1.ID) _&lt;br /&gt;              Select ItemsIn1&lt;br /&gt;  'Convert the LINQ query results into a list of objects&lt;br /&gt;  ItemsInList1NotInList2 = query.ToList()&lt;br /&gt;&lt;/pre&gt;Even though LINQ should not be confused with TSQL, the above query does have attributes of a typical SQL query. It is essentially a 'NOT' clause with LINQ sprinkled in. It reads loosely as follows: "Select all of the items in MyList2 that are also in Mylist1, and exclude these items (using NOT) from everything that is in MyList1; finally Select the results. I think another advantage of this is it is faster to modify if you needed to make the comparison based on (2) properties as opposed to (1) as in my examples. Both solutions work identically and will produce the same results.&lt;br /&gt;&lt;br /&gt;So to review, we discussed (3) methods for comparing (2) lists to get only the items in the 1st list that don't exist in the 2nd list: the Enumerable.Except() method, the Queryable.Where() method, and a LINQ query. Each has their place, but all will help to quickly make a comparison that otherwise may have required a long had For-Each loop with a flag set for comparison differences in order to get the same result. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-5416428966224193370?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/5416428966224193370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/05/methods-for-comparing-lists-of-objects.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5416428966224193370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5416428966224193370'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/05/methods-for-comparing-lists-of-objects.html' title='Methods for Comparing Lists of Objects Based on a Single Property'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-5657446046227168847</id><published>2010-05-12T22:21:00.011-04:00</published><updated>2010-11-01T16:45:18.977-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Object Data Source'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><title type='text'>Using a Child Object's Property in a GridView Bound to an Object Data Source</title><content type='html'>&lt;span style="font-family:arial;"&gt;The Object Data Source control is a nice way in ASP.NET webforms to bind a GridView control to a business object. It helps organize the method calls and events associated with the object and does save a lot of coding that must otherwise be done manually. Another benefit of binding a GridView to an ODS is that it will automatically create all of the bound columns in your GridView based on the properties on the object. So in the class below, FirstName, LastName, and Address will be displayed in the GridView.&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Public Class Customer&lt;br /&gt;&lt;br /&gt;    Private mFirstName As String = String.Empty&lt;br /&gt;    Private mLastName As String = String.Empty&lt;br /&gt;    Private mAddress As String = String.Empty&lt;br /&gt;    Private mCustomerOrder As Order = Nothing&lt;br /&gt;&lt;br /&gt;    Public Sub New()&lt;br /&gt;        'Default class Constructor&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Public Property FirstName() As String&lt;br /&gt;        Get&lt;br /&gt;            Return mFirstName&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal value As String)&lt;br /&gt;            mFirstName = value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;    Public Property LastName() As String&lt;br /&gt;        Get&lt;br /&gt;            Return mLastName&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal value As String)&lt;br /&gt;            mLastName = value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;    Public Property Address() As String&lt;br /&gt;        Get&lt;br /&gt;            Return mAddress&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal value As String)&lt;br /&gt;            mAddress = value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;    Public Property CustomerOrder() As Order&lt;br /&gt;        Get&lt;br /&gt;            Return mCustomerOrder&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal value As Order)&lt;br /&gt;            mCustomerOrder = value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;/pre&gt;However notice the class property above named 'CustomerOrder' which is of type 'Order' and is an object instance property on the Customer Object. The 'Order' class contains a property named 'ItemName' that you would like to also have bound to your GridView. By default the ODS control will not map these properties on the child object for you. So how do we access this child object's properties and use it as well? Well with a little help from the forums, we find that you can add a 'TemplateField' column to your GridView, and access the field through data-binding expressions with a [ChildObject.PropertyName] syntax. Let's take a look below how this can be accomplished:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;asp:templatefield headertext="ItemName" sortexpression="CustomerOrder.ItemName"&gt;&lt;br /&gt;  &lt;itemtemplate&gt;&lt;br /&gt;      &lt;asp:Label ID="ItemName" runat="server" Text='&amp;lt;%# Eval("CustomerOrder.ItemName") %&amp;gt;'&gt;&lt;/asp:Label&gt;&lt;br /&gt;  &lt;/itemtemplate&gt;&lt;br /&gt;&lt;/asp:templatefield&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Using the Data-Binding 'Eval()' expression we are able to have a one-way read only binding of the 'ItemName' property. If you needed an updateable column you could use the 'Bind()' expression. The Eval method evaluates late-bound data expressions in the templates of the GridView control. If you need more information about the Eval() and Bind() data-binding expressions in VB.NET, take a look to the following MSDN link:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178366.aspx"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;" &gt;Data-Binding Expressions Overview&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;One last point to mention is concerning the ODS control.  This post syntactically and programmatically is the same for those of you that manually bind a GridView control and do not use an ODS.  The main elements here were the type of column used 'TemplateField' and the Data-Binding expressions 'Eval()' to access the child object's properties.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-5657446046227168847?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/5657446046227168847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/05/using-child-objects-property-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5657446046227168847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/5657446046227168847'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/05/using-child-objects-property-in.html' title='Using a Child Object&apos;s Property in a GridView Bound to an Object Data Source'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-717342660188914828</id><published>2010-04-19T22:30:00.002-04:00</published><updated>2010-11-01T16:45:55.279-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ADO.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>How To: Populate a List of Objects from a DataSet Using LINQ</title><content type='html'>&lt;span style="font-family:arial;"&gt;Many of us use a list of objects between methods, classes, layers, etc. Sometimes the origin of this generic object list is a DataSet that was populated from a SQL stored procedure. To populate the list of objects from the DataSet, one would have to iterate through each row in the designated DataTable within the DataSet and assign values to the object's properties. It's not a bad method at all, and at least we are talking about working with objects in the first place (and not transporting raw ADO.NET objects through all layers), so we are already in a good place. Here is what that typical code described above might look like:&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Dim CustomerData As New DataSet&lt;br /&gt;'--&gt;Get the data from the database; omitting code for brevity&lt;br /&gt;&lt;br /&gt;'Create a new list of objects from type Customer&lt;br /&gt;Dim CustomerList As New List(Of Customer)&lt;br /&gt;Dim MyCustomer As Customer = Nothing&lt;br /&gt;&lt;br /&gt;'Iterate through each of the rows in the DataTable&lt;br /&gt;For Each dr As DataRow In CustomerData.Tables(0).Rows&lt;br /&gt;   'Instantiate the Customer intance for the current iteration&lt;br /&gt;   MyCustomer = New Customer()&lt;br /&gt;&lt;br /&gt;   'Add the non null values to this object's properties&lt;br /&gt;   If Not IsDBNull(dr("ID")) Then MyCustomer.ID = Integer.Parse(dr("ID"))&lt;br /&gt;   If Not IsDBNull(dr("FirstName")) Then MyCustomer.FirstName = dr("FirstName").ToString()&lt;br /&gt;   If Not IsDBNull(dr("LastName")) Then MyCustomer.LastName = dr("LastName").ToString()&lt;br /&gt;&lt;br /&gt;   'Add the inidividual object to the list&lt;br /&gt;   CustomerList.Add(MyCustomer)&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;'Return the list if needed&lt;br /&gt;Return CustomerList&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;However we can use LINQ to streamline this process a bit. The 'System.Data.DataSet' extensions namespace exposes methods that allow us to work with LINQ to DataSets in .NET. The issue is that a DataSet or better a DataTable in its raw form does not implement the 'IEnumerable(Of T)' or 'IQueryable' interfaces required to work with LINQ. By calling the 'AsEnumerable' method from this namespace on the DataTable in the FROM clause of a query, we can use a DataTable as a LINQ source.&lt;br /&gt;&lt;br /&gt;With the DataTable as the source of our LINQ query, we can now select into a list of objects (or an anonymous type for local use only as opposed to a fully qualified class). The example of code below details how to do this on a simple 'Customer' class. Notice that I check to make sure the value returned from the database is not null before assignment to the property using the VB.NET ternary 'If()' operator.&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Dim CustomerData As New DataSet&lt;br /&gt;'--&gt;Get the data from the database; omitting code for brevity&lt;br /&gt;&lt;br /&gt;'Use LINQ to query the DataTable data into the 'CustomerList' row collection&lt;br /&gt;Dim CustomerCollection = From MyCustomer In CustomerData.Tables(0).AsEnumerable() _&lt;br /&gt;      Select New Customer With { _&lt;br /&gt;      .ID = If(Not IsDBNull(MyCustomer.Field(Of Integer)("ID")), MyCustomer.Field(Of Integer)("ID"), 0), _&lt;br /&gt;      .FirstName = If(Not IsDBNull(MyCustomer.Field(Of String)("FirstName")), MyCustomer.Field(Of String)("FirstName"), String.Empty), _&lt;br /&gt;      .LastName = If(Not IsDBNull(MyCustomer.Field(Of String)("LastName")), MyCustomer.Field(Of String)("LastName"), String.Empty)}&lt;br /&gt;&lt;br /&gt;'Return the list if needed&lt;br /&gt;Return CustomerCollection.ToList()&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;That's just a taste of how you can use the power of LINQ with some traditional ADO.NET objects in .NET. It shows how you can begin migrating some older existing .NET code with some of the newer technologies and methods available.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-717342660188914828?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/717342660188914828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/04/how-to-populate-list-of-objects-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/717342660188914828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/717342660188914828'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/04/how-to-populate-list-of-objects-from.html' title='How To: Populate a List of Objects from a DataSet Using LINQ'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-425797936432847848</id><published>2010-04-07T21:27:00.000-04:00</published><updated>2010-04-08T16:29:32.171-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Resolving The: 'AsEnumerable' is not a member of 'System.Data.DataTable' Runtime Error</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you begin writing some LINQ to DataSet queries, and try to find the .AsEnumerable function exposed on a DataTable, you will see the following design time error occur:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;'AsEnumerable' is not a member of 'System.Data.DataTable'&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This is because this functionality exists in the System.Data.DataSetExtensions namespace. Add a reference to this .dll and the error will resolve, and this functionality will become available. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-425797936432847848?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/425797936432847848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/04/resolving-asenumerable-is-not-member-of.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/425797936432847848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/425797936432847848'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/04/resolving-asenumerable-is-not-member-of.html' title='Resolving The: &apos;AsEnumerable&apos; is not a member of &apos;System.Data.DataTable&apos; Runtime Error'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-1799357430020989312</id><published>2010-04-05T22:24:00.008-04:00</published><updated>2010-11-01T16:47:10.279-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Recursion'/><category scheme='http://www.blogger.com/atom/ns#' term='Delete Files'/><category scheme='http://www.blogger.com/atom/ns#' term='System.IO'/><title type='text'>How To: Use Recursion in .NET To Delete All Files and Directories in .NET</title><content type='html'>&lt;span style="font-family:arial;"&gt;Have you ever needed to have some code delete all of the folders and files below a given directory? Maybe the reason is for an automated cleanup that runs on schedule, or just cleaning up cache files after a given period of time. Whatever the reason, a good way to do this in .NET is to write some methods and call them recursively to delete out all files in the lowest level directory, making its way back up to the top level. And of course deleting the directories (folders) themselves after all files within are deleted.&lt;br /&gt;&lt;br /&gt;At this point you may be saying, "Can’t I just write some code to iterate through all of the directories, and delete the directories and files in a single operation?" Well you could try it by just calling the basic overload for .Delete(), but you would quickly come across the following exception being thrown:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;"The directory is not empty." &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This is because the default overload of the .Delete() method of the directory object, will not let you delete it if there are any files still within that directory. Regardless, you may actually need to observe each file prior to deletion to examine its creation date, file attributes, etc. prior to deletion and this is not possible when the single delete is done on the entire directory and all of its files. Therefore we must traverse downward through all directories, deleting out all of the files within before deleting the containing directory. This can all be done using recursion and some operations from the System.IO namespace in .NET. &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;You may have also gone down this path, but hit another bump when you received the following exception upon deleting a file:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;"Access to the path 'MyFile.doc' is denied."&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This occurs because read-only files can also not be deleted; we will take care of this by changing the file attributes to not be 'Read-Only' prior to deletion. This however brings up an important last point: many times file deletion regardless of file attributes requires an elevated permission. Therefore you may need to wrap the following code using impersonation of an elevated account, or just make sure that the directories and files being deleted have the proper permissions allowed at the root level. Either solution will work fine. &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;I want to emphasize this entry more around how to use recursion in operations such as deleting files, but not focus too heavily on the file delete example. Recursion is a powerful and often overlooked method of writing good streamlined clean code. I find those that were formally educated in Software Engineering or Computer Science are well familiar with concepts like recursion, where as the Barnes and Noble book learned developer may have not used some of these methods before. That's perfectly fine, and hopefully this will help you understand recursion better and be able to use it in the future. In fact, if you are 100% only interested in deleting all files in a directory without needing the ability to observe each file prior to deletion then you can provide a boolean value to the 2nd parameter in the overload of the 'Delete()' method that will delete all files in a directory before deleting the directory for you all in 1 line of code shown below:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;     System.IO.Directory.Delete("C:\TempTest", True)&lt;/pre&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;So without further ado, let's get to the code. It has quite a bit of commenting injected to help explain the process. You may want to test it out on a directory that has multiple levels and files, before using it on anything live to make sure you have your version working properly.&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;&lt;br /&gt;Public Sub TestDelete()&lt;br /&gt;&lt;br /&gt;   'Get an object repesenting the directory path below&lt;br /&gt;   Dim di As New DirectoryInfo("C:\MyTestDirectory")&lt;br /&gt;&lt;br /&gt;   'Traverse all of the child directors in the root; get to the lowest child&lt;br /&gt;   'and delte all files, working our way back up to the top.  All files&lt;br /&gt;   'must be deleted in the directory, before the directory itself can be deleted.&lt;br /&gt;   For Each diChild As DirectoryInfo In di.GetDirectories()&lt;br /&gt;      TraverseDirectory(diChild)&lt;br /&gt;   Next&lt;br /&gt;&lt;br /&gt;   'Finally, clean all of the files directly in the root directory&lt;br /&gt;   CleanAllFilesInDirectory(di)&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;''' &lt;summary&gt;&lt;br /&gt;''' A method to traverse down through child directories until&lt;br /&gt;''' we have reached the lowest level and then clean (delete) all&lt;br /&gt;''' files before deleting the directory itself.&lt;br /&gt;''' &lt;/summary&gt;&lt;br /&gt;''' &lt;param name="di"&gt;&lt;/param&gt;&lt;br /&gt;''' &lt;remarks&gt;All files must be deleted in a directory prior to deleting the&lt;br /&gt;''' directory itself to prevent the following exception:&lt;br /&gt;''' "The directory is not empty."&lt;br /&gt;''' &lt;/remarks&gt;&lt;br /&gt;Private Sub TraverseDirectory(ByVal di As DirectoryInfo)&lt;br /&gt;&lt;br /&gt;   'If the current directory has more child directories, then continure&lt;br /&gt;   'to traverse down until we are at the lowest level.  At that point all of the&lt;br /&gt;   'files will be deleted.&lt;br /&gt;   For Each diChild As DirectoryInfo In di.GetDirectories()&lt;br /&gt;       TraverseDirectory(diChild)&lt;br /&gt;   Next&lt;br /&gt;&lt;br /&gt;   'Now that we have no more child directories to traverse, delete all of the files&lt;br /&gt;   'in the current directory, and then delete the directory itself.&lt;br /&gt;   CleanAllFilesInDirectory(di)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   'The containing directory can only be deleted if the directory&lt;br /&gt;   'is now completely empty and all files previously within&lt;br /&gt;   'were deleted.&lt;br /&gt;   If di.GetFiles().Count = 0 Then&lt;br /&gt;      di.Delete()&lt;br /&gt;   End If&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;''' &lt;summary&gt;&lt;br /&gt;''' Iterates through all files in the directory passed into&lt;br /&gt;''' method and deletes them.&lt;br /&gt;''' &lt;/summary&gt;&lt;br /&gt;''' &lt;param name="DirectoryToClean"&gt;&lt;/param&gt;&lt;br /&gt;''' &lt;remarks&gt;It may be necessary to wrap this call in impersonation or ensure parent directory&lt;br /&gt;''' permissions prior, because delete permissions are not guaranteed.&lt;br /&gt;''' &lt;/remarks&gt;&lt;br /&gt;Private Sub CleanAllFilesInDirectory(ByVal DirectoryToClean As DirectoryInfo)&lt;br /&gt;&lt;br /&gt;   For Each fi As FileInfo In DirectoryToClean.GetFiles()&lt;br /&gt;      'The following code is NOT required, but shows how some logic can be wrapped&lt;br /&gt;      'around the deletion of files.  For example, only delete files with&lt;br /&gt;      'a creation date older than 1 hour from the current time.  If you&lt;br /&gt;      'always want to delete all of the files regardless, just remove&lt;br /&gt;      'the next 'If' statement.&lt;br /&gt;       If fi.CreationTime &lt; Now.Subtract(New TimeSpan(0, 0, 1)) Then&lt;br /&gt;         'Read only files can not be deleted, so mark the attribute as 'IsReadOnly = False'&lt;br /&gt;         fi.IsReadOnly = False&lt;br /&gt;         fi.Delete()&lt;br /&gt;&lt;br /&gt;         'On a rare occasion, files being deleted might be slower than program execution, and upon returning&lt;br /&gt;         'from this call, attempting to delete the directory will throw an exception stating it is not yet&lt;br /&gt;         'empty, even though a fraction of a second later it actually is.  Therefore the 'Optional' code below&lt;br /&gt;         'can stall the process just long enough to ensure the file is deleted before proceeding. The value&lt;br /&gt;         'can be adjusted as needed from testing and running the process repeatedly.&lt;br /&gt;         System.Threading.Thread.Sleep(50)  '50 millisecond stall (0.05 Seconds)&lt;br /&gt;      End If&lt;br /&gt;   Next&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;This code should be almost 'copy and paste' ready to run in your application. The main modification needed is to change the root directory referenced in the initial DirectoryInfo object. Also notice the optional code I added to show how you can wrap the file deletion in conditional code stating to only delete files older than 1 hour. This is not required, but shows you how the code can easily be modified. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-1799357430020989312?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/1799357430020989312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/04/how-to-recursively-delete-all-files-and.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1799357430020989312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/1799357430020989312'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/04/how-to-recursively-delete-all-files-and.html' title='How To: Use Recursion in .NET To Delete All Files and Directories in .NET'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-6214906252981998027</id><published>2010-03-30T23:19:00.001-04:00</published><updated>2010-03-31T16:22:23.223-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ONETUG'/><category scheme='http://www.blogger.com/atom/ns#' term='Training'/><category scheme='http://www.blogger.com/atom/ns#' term='Code Camp'/><title type='text'>Orlando Code Camp 2010 Thoughts and Comments</title><content type='html'>&lt;span style="font-family:arial;"&gt;This past weekend I had the pleasure of attending the 5th annual Orlando 'Code Camp' seminar in Sanford, Florida. It was help at Sanford Community College, which if I must say has quite the impressive campus for only being a Community College. The facilities there were quite adequate and it was a beautiful Florida spring day, so all in all you couldn't do much better for the setting.&lt;br /&gt;&lt;br /&gt;I have been a member of the Orlando .NET User Group (a.k.a. 'ONETUG') for a couple of years now, but this is the 1st event I have been able to participate in with the group. Unfortunately depending on where in Orlando an event takes place, I am anywhere from 45 to 90 minutes away, so getting to event during the week is difficult. However, this was held on a Saturday, so I was able to make it no problem. The event is organized by group leader Esteban Garcia, who I applaud for doing a great job.&lt;br /&gt;&lt;br /&gt;The event consisted of 70+ sessions spread out by topic (.NET, Silverlight, Services, etc) that went from 8:30am to 4:30pm. Each session lasted 1 hour, with a 15 minute break in between. PERFECT! I like this format of 1 hour on the nose. To be honest, most the attendees have at least a little knowledge on each subject and attend sessions to be further informed or maybe pick up a few new ideas. At this time limit it is difficult to learn an entire topic, but when classes begin to go longer than 1 hour, I sometimes begin to look at the clock. And the extra 20 minute to .5 hour (say 90 minutes total instead as a comparison) are still not enough to learn an entire subject. Therefore I think an hour on the nose is perfect. I never felt like I was looking at the clock ready to move on to the next session.&lt;br /&gt;&lt;br /&gt;I have had the privilege of going to some of the pricey training events like VSLive!, and I must say that Code Camp offered a day on par to that of a single day at VSLive!. Except you don't have to pay the $1900 per person like at VSLive! This is because Code Camp was FREE!! The presenters were area authors, consultants, Microsoft MVPs, and experienced professionals so the content was of quality like a VSLive! in my opinion. Topics ranged from "What's new in ASP.NET 4.0", "LINQ 4.0", "jQuery vs. AjaxControlToolkit" to "Silverlight Databinding and Validation" plus much, much more. To top it all off, a nice boxed lunch was included for FREE, and a slew of raffle items were given away as well. It is quite impressive that all of this could be done without charging for it. The sponsors helped with that and did a nice job.&lt;br /&gt;&lt;br /&gt;By the end of the day everyone was waiting around to see who would win the 'Xbox 360", and to get to that you had to wait over an hour of announcements, sponsor speeches, and other raffles, so they also had this planned well to help get the sponsors some more exposure. I unfortunately didn’t win any prizes, but the overall day was a success.&lt;br /&gt;&lt;br /&gt;If you live in Florida or another are that has a .NET user group, I highly recommend attending your local .NET user group sessions and Code Camp activities when you can. These are wonderful opportunities to help keep us current in this ever changing industry of software development. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;"&gt;For more information, check out the following link:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://orlandocodecamp.com/"&gt;&lt;span style="TEXT-DECORATION: underline;font-family:arial;" &gt;Orlando Code Camp&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-6214906252981998027?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/6214906252981998027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/03/orlando-code-camp-2010-thoughts-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6214906252981998027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/6214906252981998027'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/03/orlando-code-camp-2010-thoughts-and.html' title='Orlando Code Camp 2010 Thoughts and Comments'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-325204823065476769</id><published>2010-03-30T21:59:00.007-04:00</published><updated>2010-03-30T22:17:22.787-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DDD'/><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='Archiecture'/><title type='text'>Domain Driven Design (DDD) Free Book Download</title><content type='html'>&lt;span style="font-family:arial;"&gt;I have not yet ventured far into the world of Domain Driven Design, but if you are interested there is a book named, &lt;em&gt;&lt;strong&gt;Domain Driven Design Quickly &lt;/strong&gt;&lt;/em&gt;that is an overview of Eric Evans' DDD. It can be downloaded for free (after registration) from the following InfoQ link:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.infoq.com/minibooks/domain-driven-design-quickly"&gt;&lt;span style="font-family:arial;text-decoration:underline"&gt;InfoQ: Domain Driven Design Quickly&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;From the above link: &lt;em&gt;"This book is a short, quickly-readable summary and introduction to the fundamentals of DDD; it does not introduce any new concepts; it attempts to concisely summarize the essence of what DDD is, drawing mostly Eric Evans' book, as well other sources since published such as Jimmy Nilsson's Applying Domain Driven Design, and various DDD discussion forums"&lt;/em&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-325204823065476769?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/325204823065476769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/03/domain-driven-design-ddd-free-book.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/325204823065476769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/325204823065476769'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/03/domain-driven-design-ddd-free-book.html' title='Domain Driven Design (DDD) Free Book Download'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-3069193206209753986</id><published>2010-03-09T23:42:00.022-05:00</published><updated>2010-11-01T16:48:39.746-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>How To: Create A Scrolling News / Information Marquee using JavaScript and Server Side Code</title><content type='html'>&lt;span style="font-family:arial;"&gt;Have you ever wanted to add a continuous news scroller at the bottom of your web page, that was dynamically populated from database data at runtime? This will show you all of the pieces needed to create the scroller and update it server side in code behind. The main parts are the news scroller itself, built using JavaScript, and the content that populates the scroller which is done server side in VB.NET. I will say while this is not overly complex, it does have several parts and pieces that go together, so beginners may get a bit confused. If this is the case, just take your time and try this on a new blank page before attempting to inject this into existing logic. Also remember that all JavaScript is case sensitive, so be careful when making calls to the functions.&lt;br /&gt;&lt;br /&gt;Let's get right into the code. I will give credit to &lt;a href="http://www.dhtmlgoodies.com/"&gt;dhtmlgoodies&lt;/a&gt; where I was able to get some of the initial concepts for scrolling. I have since greatly expanded on the basics by populating the contents server side, impoving the scrolling visually, and an AJAX asynchronous postback behind the scenes each time the scroller has moved across the page to get updated data. I will leave out the AJAX portion of this because it is an entire post in itself, and we will just get the server side populated scroller working 1st. To being we are going to create a placeholder 'DIV' tag on the page. The 'innerHTML' code will be created and set server side. This is just the container:&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;   //This JS variables exposes a page class property.  It is a convenient way to expose control&lt;br /&gt;   //id's via page variables to JavaScript functions on this page or in a .js file.&lt;br /&gt;   //This method works really well for exposing the control ID's of controls in an .aspx ContentPage.&lt;br /&gt;   var mScrollingMarqueeDivControlID = '&lt;%= ScrollingMarqueeDivControlID %&gt;';&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;          &lt;!-- Start of marquee HTML code --&gt;&lt;br /&gt;         &lt;div id="ScrollingMarquee" class="ScrollingMarqueeStyle" runat="server"&gt;         &lt;br /&gt;             &lt;!--InnerHTML Contents of DIV will be set in server side code--&gt;          &lt;br /&gt;         &lt;/div&gt;&lt;br /&gt;         &lt;!-- End of marquee HTML code --&gt;&lt;br /&gt;&lt;br /&gt;    &lt;!--Place at the bottom of the page's source to make sure JS function 'initHorizontalScrollMarquee' is called--&gt;&lt;br /&gt;   &lt;script type="text/javascript"&gt;&lt;br /&gt;      InitHorizontalScrollMarquee(mScrollingMarqueeDivControlID)&lt;br /&gt;   &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;Notice above, the call to initialize the marquee. This is a call to a JavaScript method which will be explained a little later on. For now we need to make sure that call is made, so that the scrolling effect will begin when the page has completed loading. Within this call I sent it a page defined variable value, which is exposed server side. You might ask, why do it this way and not just declare inline document.getElementById...etc. Well I often use ASP.NET Master and Content pages, and the control naming structure for content pages is a bit more complex than calling a control directly. In this situation exposing the value server side is a much easier alternative to hardcoding its value. If you are using a traditional page, you can probably streamline this method and extract the control's ID directly.&lt;br /&gt;&lt;br /&gt;Next, here is the .css class that was defined in the 'DIV' element above and the class defining the style of the text that will be inside of that DIV. You can modify this as needed, however the classes must exist as named or the JavaScript will not work properly.&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: css"&gt;&lt;br /&gt;        .ScrollingMarqueeStyle&lt;br /&gt;        {&lt;br /&gt;            padding-top:3px;&lt;br /&gt;            height:25px;&lt;br /&gt;            background-color: #000;  &lt;br /&gt;            position:absolute;&lt;br /&gt;            left:0px;&lt;br /&gt;            z-index:1000;&lt;br /&gt;            bottom:0px;  &lt;br /&gt;            display:none;  &lt;br /&gt;            width:100%;&lt;br /&gt;            overflow:hidden;&lt;br /&gt;            &lt;br /&gt;            /*Border that hovers over the scrolling marquee*/&lt;br /&gt;            border-top: solid 2px red;    &lt;br /&gt;        }&lt;br /&gt;        body &gt; div.ScrollingMarqueeStyle&lt;br /&gt;        { &lt;br /&gt;         /* Firefox */&lt;br /&gt;            position:fixed;&lt;br /&gt;        } &lt;br /&gt;        .ScrollingMarqueeStyle .MarqueeTextObj&lt;br /&gt;        { &lt;br /&gt;         /* Text within marquee */&lt;br /&gt;            position:absolute; &lt;br /&gt;            color: #FFF;&lt;br /&gt;            font-weight:bold;&lt;br /&gt;            white-space:nowrap;&lt;br /&gt;            font-family: Trebuchet MS;&lt;br /&gt;            font-size: 16px; /*This is the size of the scrolling text*/&lt;br /&gt;        }&lt;br /&gt;        /* Applies to custom classes used in &amp;lt;Span&amp;rt; tags within the scrolling text */&lt;br /&gt;        .DescriptionText&lt;br /&gt;        {&lt;br /&gt;            color:#66FF33;&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;Now let's take a look at the JavaScript that works the magic behind the scrolling marquee. There are (5) functions: InitHorizontalScrollMarquee, MoveScrollingMarquee, PositionScrollingMarquee, Stop_MoveScrollingMarquee, and Resume_MoveScrollingMarquee. These can all be placed either within a &lt;javascript&gt; tag in the head of the page, or within a .js file that is referenced by the page.&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: javascript"&gt;&lt;br /&gt;        // Higher = Faster, Lower = slower and more smoothly   (equates to pixels per move on the screen)&lt;br /&gt;        var marqueeSteps = 1;&lt;br /&gt;        // Lower value = Faster  (# equates to Milleseconds - ms between moves.  Watch out for CPU usage if too low)&lt;br /&gt;        var marqueeSpeed = 25;&lt;br /&gt;        // Make the marquee stop moving when user moves his mouse over it, set to 'true' to enable, 'false' to disable.&lt;br /&gt;        var marqueeStopOnMouseOver = true;&lt;br /&gt;        // "top" or "bottom" position set here&lt;br /&gt;        var marqueePosition = 'bottom';&lt;br /&gt;&lt;br /&gt;        /* Don't change anything below here */&lt;br /&gt;        var marqueeObj;&lt;br /&gt;        var marqueeTextObj;&lt;br /&gt;        var marqueeTmpStep;&lt;br /&gt;        var marqueeTextObjects = new Array();&lt;br /&gt;        var marqueeHiddenSpans = new Array();&lt;br /&gt;        var marqueeIndex = 0;&lt;br /&gt;&lt;br /&gt;        var hScrollRefreshIntervalId;&lt;br /&gt;&lt;br /&gt;        function PositionScrollingMarquee(e, timeout) {&lt;br /&gt;            if (document.all) e = event;&lt;br /&gt;            if (marqueePosition.toLowerCase() == 'top') {&lt;br /&gt;                //Place the marquee at the top of the page&lt;br /&gt;                marqueeObj.style.top = '0px';&lt;br /&gt;            }&lt;br /&gt;            else {&lt;br /&gt;                //Place the arquee at the bottom of the page&lt;br /&gt;                marqueeObj.style.bottom = '-1px';&lt;br /&gt;            }&lt;br /&gt;            if (document.all &amp;&amp; !timeout) setTimeout('PositionScrollingMarquee(false,true)', 500)&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        function MoveScrollingMarquee() {&lt;br /&gt;&lt;br /&gt;            //Get left-side position of the marquee&lt;br /&gt;            var leftPos = marqueeTextObj.offsetLeft;&lt;br /&gt;&lt;br /&gt;            //Subtract step count set at global level and kept track of in InitMarquee (Move DIV left)&lt;br /&gt;            leftPos = leftPos - marqueeTmpStep;&lt;br /&gt;&lt;br /&gt;            //Left position of DIV + [array value] + width of a single 'marqueeTextObj'&lt;br /&gt;            var rightEdge = leftPos + marqueeHiddenSpans[marqueeIndex].offsetLeft + marqueeTextObj.offsetWidth;&lt;br /&gt;&lt;br /&gt;            //If the right edge calculated above is less than 0, this means the ENTIRE marquee is off&lt;br /&gt;            //the left side of the page.  At this point reset the scrolling marquee to the right side of the page to re-scroll.&lt;br /&gt;            if (rightEdge &lt; 0) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                //Reset the marquee to be just off the right side of the page which is done&lt;br /&gt;                //by making its left position the width of the page&lt;br /&gt;                leftPos = document.documentElement.offsetWidth;&lt;br /&gt;                marqueeTextObj.style.left = leftPos + 'px';&lt;br /&gt;&lt;br /&gt;                //Set marquee properties&lt;br /&gt;                marqueeTextObj.style.display = 'none';&lt;br /&gt;&lt;br /&gt;                marqueeIndex++;&lt;br /&gt;                if (marqueeIndex &gt;= marqueeTextObjects.length) marqueeIndex = 0;&lt;br /&gt;                marqueeObj = marqueeTextObjects[marqueeIndex];&lt;br /&gt;&lt;br /&gt;                marqueeTextObj.style.display = 'block';&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            //Move the DIV to the left position calculated above.  This is where the 'magic' happens&lt;br /&gt;            //and the 'scrolling' occurs.&lt;br /&gt;            marqueeTextObj.style.left = leftPos + 'px';&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        function Stop_MoveScrollingMarquee() {&lt;br /&gt;            if (marqueeStopOnMouseOver) marqueeTmpStep = 0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        function Resume_MoveScrollingMarquee() {&lt;br /&gt;            marqueeTmpStep = marqueeSteps;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        function InitHorizontalScrollMarquee(MarqueeDivControlID) {&lt;br /&gt;&lt;br /&gt;            //Get the marquee object properties using the ID passed in from the calling code:&lt;br /&gt;            marqueeObj = document.getElementById(MarqueeDivControlID);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            var spans = marqueeObj.getElementsByTagName('DIV');&lt;br /&gt;            for (var no = 0; no &lt; spans.length; no++) {&lt;br /&gt;&lt;br /&gt;                //Find the 'MarqueeTextObj' class and set its properties&lt;br /&gt;                if (spans[no].className == 'MarqueeTextObj') {&lt;br /&gt;                    marqueeTextObj = spans[no];&lt;br /&gt;                    spans[no].style.display = 'block';&lt;br /&gt;&lt;br /&gt;                    marqueeTextObjects.push(spans[no]);&lt;br /&gt;                    var hiddenSpan = document.createElement('SPAN');&lt;br /&gt;                    hiddenSpan.innerHTML = ' '&lt;br /&gt;                    spans[no].appendChild(hiddenSpan);&lt;br /&gt;                    marqueeHiddenSpans.push(hiddenSpan);&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            if (marqueePosition.toLowerCase() == 'top') {&lt;br /&gt;                marqueeObj.style.top = '0px';&lt;br /&gt;            }&lt;br /&gt;            else {&lt;br /&gt;                if (document.all) {&lt;br /&gt;                    marqueeObj.style.bottom = '0px';&lt;br /&gt;                }&lt;br /&gt;                else {&lt;br /&gt;                    marqueeObj.style.bottom = '-1px';&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            //Set the left position of the marquee = to the width of the page which essentially places &lt;br /&gt;            //its leftmost part at the right end of the page.&lt;br /&gt;            marqueeTextObj.style.left = document.documentElement.offsetWidth + 'px';&lt;br /&gt;&lt;br /&gt;            //Define the mouse events; these are wired up to the varibale named 'marqueeStopOnMouseOver' which is false by default.&lt;br /&gt;            marqueeObj.onmouseover = Stop_MoveScrollingMarquee;&lt;br /&gt;            marqueeObj.onmouseout = Resume_MoveScrollingMarquee;&lt;br /&gt;            if (document.all) window.onscroll = PositionScrollingMarquee; else marqueeObj.style.position = 'fixed';&lt;br /&gt;&lt;br /&gt;            marqueeObj.style.display = 'block';&lt;br /&gt;            marqueeTmpStep = marqueeSteps;&lt;br /&gt;&lt;br /&gt;            //setInterval() returns an interval ID, which later can be passed to clearInterval(): to stop repeat calls if desired;&lt;br /&gt;            hScrollRefreshIntervalId = setInterval('MoveScrollingMarquee()', marqueeSpeed);&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;I will touch briefly on the JS code, but I tried to comment up the code well so you can read the documentation within. Basically, 'InitHorizontalScrollMarquee' is called, and finds the DIV we created server side with the class named 'MarqueeTextObj' to set its properties. Look closely at the JS variables defined prior to all of the functions. These dictate a lot of the behavior attributes like position (top or bottom), speed, and the ability to pause scrolling when hovering over with the mouse. Lastly, the 'setInterval' JS function (basically a timer) is wired up to call the 'MoveScrollingMarquee' method on interval. This method when called in turn moves the entire 'DIV' with text to the left by the step amount specified. The end result is a scrolling marquee!&lt;br /&gt;&lt;br /&gt;Now, let’s move onto the code behind that will actually populate the marquee. Now the code I will provide simply creates a DataTable and populates it with City names and their respective temperatures. This entry is not going to dive into how to call a database and build up a custom object, list of objects ADO.NET type, entity, etc.; I assume most already know how to do this. So for my example I am going to build up some static data, but certainly you would extract this data dynamically from the database and iterate through it as I do to build out the 'InnerHTML' that will be set on our server side 'DIV' control we added to the page earlier.&lt;br /&gt;&lt;br /&gt;This code example also does everything directly behind the page which is also not a great practice and does not follow any n-layer or design pattern guidelines. This code would need to be farmed out to its respective spots within the application, but again that is not the purpose of this entry. So below is the code needed to build the elements that go into the scrolling marquee:&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;&lt;br /&gt;Imports System.IO&lt;br /&gt;&lt;br /&gt;Partial Public Class WebForm1&lt;br /&gt;    Inherits System.Web.UI.Page&lt;br /&gt;&lt;br /&gt;    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;&lt;br /&gt;        'This is where you would make calls to get a business object, list of objects, DataTable, DataSet, etc.&lt;br /&gt;        'Since that is not the purpose of this entry, I will just manually build out a DataTable with (2)&lt;br /&gt;        'columns:  City and Temperature (of coarse it could be anything, and formatted however needed)&lt;br /&gt;        Dim dt As New DataTable()&lt;br /&gt;        dt.Columns.Add("City")&lt;br /&gt;        dt.Columns.Add("Temperature")&lt;br /&gt;&lt;br /&gt;        'Now add some dummy values&lt;br /&gt;        Dim dr As DataRow&lt;br /&gt;        dr = dt.NewRow()&lt;br /&gt;        dr("City") = "New York"&lt;br /&gt;        dr("Temperature") = "50"&lt;br /&gt;        dt.Rows.Add(dr)&lt;br /&gt;        dr = dt.NewRow()&lt;br /&gt;        dr("City") = "Miami"&lt;br /&gt;        dr("Temperature") = "75"&lt;br /&gt;        dt.Rows.Add(dr)&lt;br /&gt;        dr = dt.NewRow()&lt;br /&gt;        dr("City") = "San Diego"&lt;br /&gt;        dr("Temperature") = "60"&lt;br /&gt;        dt.Rows.Add(dr)&lt;br /&gt;        dr = dt.NewRow()&lt;br /&gt;        dr("City") = "Chicago"&lt;br /&gt;        dr("Temperature") = "45"&lt;br /&gt;        dt.Rows.Add(dr)&lt;br /&gt;&lt;br /&gt;        'Call a local method that will build up the HTML to be assigned to our server sode DIV control named 'ScrollingMarquee':&lt;br /&gt;        BuildScrollingMarquee(dt)&lt;br /&gt;&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Private Sub BuildScrollingMarquee(ByVal MarqueeValues As DataTable)&lt;br /&gt;&lt;br /&gt;        Dim sb As New StringBuilder&lt;br /&gt;&lt;br /&gt;        'Begin the HTML formatting by starting the DIV tag; the class name must be 'MarqueeTextObj' so it is recognized by JS&lt;br /&gt;        sb.Append("&lt;div class="MarqueeTextObj"&gt;")&lt;br /&gt;&lt;br /&gt;        'Loop through each datarow in the DataTable passed in, and extract and append the data to the StringBuilder.&lt;br /&gt;        'The format for the HTML should be City: [CityName] - Temperature: [Temperature Value]...&lt;br /&gt;        For Each dr As DataRow In MarqueeValues.Rows&lt;br /&gt;            'Add the string to the StringBuilder with HTML tags&lt;br /&gt;            sb.Append("&lt;span class='DescriptionText'&gt;City: &lt;/span&gt;" &amp; dr("City").ToString() &amp; " &lt;span class='DescriptionText'&gt;- Temperature:&lt;/span&gt; " &amp; dr("Temperature").ToString() &amp; "; ")&lt;br /&gt;        Next&lt;br /&gt;&lt;br /&gt;        sb.Append("&lt;/div&gt;")&lt;br /&gt;&lt;br /&gt;        '*****Populate the scrolling marquee at the bottom of the page with data in the StrignBuilder formatted above*****&lt;br /&gt;        'Set the 'InnerHTML' of the server 'DIV' control&lt;br /&gt;        Me.ScrollingMarquee.InnerHtml = sb.ToString.Trim()&lt;br /&gt;&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Protected ReadOnly Property ScrollingMarqueeDivControlID() As String&lt;br /&gt;        'This returns the ControlID of the DIV containing the Horizontal scrolling marquee content.&lt;br /&gt;        'It will be exposed as a JS varibale in the source behind the page to be used within JavaScript.&lt;br /&gt;        Get&lt;br /&gt;            Me.EnsureChildControls()&lt;br /&gt;            Return Me.ScrollingMarquee.ClientID&lt;br /&gt;        End Get&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;The code behind shows that in Page_Load() we build up a DataTable with some data to be placed into the marquee. We then pass that DataTable to a local method that uses a StringBuilder to create properly formatted HTML. The 'BuildScrollingMarquee' method iterates through each DataRow in the passed in DataTable and uses its values to place into the StringBuilder. This is a spot where you can modify formatting, values, colors, you name it, to make the marquee text formatted as you wish. This in conjunction with the .css styles are the (2) main spots that will dictate styles and formatting if you need to make adjustments. Below is a picture of how the marquee looked as I formatted it:&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/S5fRicJj3uI/AAAAAAAAAFQ/faUU27cW8sU/s1600-h/ScrollingMarquee.png"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 30px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5447052663929954018" border="0" alt="" src="http://2.bp.blogspot.com/_o-C99bmODDI/S5fRicJj3uI/AAAAAAAAAFQ/faUU27cW8sU/s320/ScrollingMarquee.png" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;So that's it! You now see how to combine JavaScript code with .NET code to dynamically populate and present a nice horizontal scrolling marquee. One last quick word - before posting back that something isn't working or there are issues, try running this code exactly as is in a new ASP.NET web form before modifying. This code has been tested and works, so take it a step at a time to get this code working before moving forward. As you being to become familiar with the code you can see where the many enhancements could be made to how the data is pulled, when, on what interval, styles, formatting, etc. This code hopefully gets you started with what you need by showing you the framework to dynamically populating a scrolling marquee.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-3069193206209753986?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/3069193206209753986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/03/how-to-create-scrolling-news-marquee.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3069193206209753986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/3069193206209753986'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/03/how-to-create-scrolling-news-marquee.html' title='How To: Create A Scrolling News / Information Marquee using JavaScript and Server Side Code'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_o-C99bmODDI/S5fRicJj3uI/AAAAAAAAAFQ/faUU27cW8sU/s72-c/ScrollingMarquee.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7234665442987665471</id><published>2010-03-01T22:36:00.006-05:00</published><updated>2010-11-01T16:51:17.145-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Dealing With The 'Unrecognized Element 'extendedProtectionPolicy'' Exception</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently I began using Windows 7 Ultimate in addition to VS.NET 2008. I had to refresh a reference to an existing WCF service which did just fine. However, upon deploying the application back out to the production Windows Server 2003 server, I began to see the following exception being thrown:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;"Unrecognized element 'extendedProtectionPolicy'&lt;/strong&gt; "&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;I actually could have seen this listed as a 'Warning' prior to compile with the following message as well:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff9900;"&gt;&lt;strong&gt;&lt;em&gt;"The element 'transport' cannot contain child element 'extendedProtectionPolicy' because the parent element's content model is empty."&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This is all in reference to the following configuration element that appeared in my client's .config file in regards to the WCF service being consumed:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;extendedprotectionpolicy policyenforcement="Never"&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Regardless of where the issue is noticed, it appears this is caused by the usage of multiple platforms. It appears that the configuration is only created when consuming the service on my Windows 7 development box, but then not recognized by other platforms such as Windows Server 2003. The 'ExtendedProtection' configuration as I understand is to help prevent attacks during the credential challange process. However due to its staged rolluot, it is not fully supported and hence the above errors are generated.&lt;br /&gt;&lt;br /&gt;The fix? Simple for the time being. Just remove the tag and redeploy the configuration. Depending on the configuration, it may be embedded between a set of "Transport" tags. If this is the case remove the inner "extendedProtectionPolicy" tag, and shorthand the end of the transport tag "/&amp;gt;"&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7234665442987665471?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7234665442987665471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/03/dealing-with-unrecognized-element.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7234665442987665471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7234665442987665471'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/03/dealing-with-unrecognized-element.html' title='Dealing With The &apos;Unrecognized Element &apos;extendedProtectionPolicy&apos;&apos; Exception'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-7667397634992157394</id><published>2010-02-02T23:44:00.003-05:00</published><updated>2010-02-03T16:13:51.524-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Dealing With the Removal of the ASP.NET Silverlight Server Controls in Silverlight 3</title><content type='html'>&lt;span style="font-family:arial;"&gt;Silverlight 3 has been out for some time now, and most Microsoft sites you may visit often (including Microsoft Update) will prompt you to do the install. If you did the install and removed all of Silverlight 2 including the SDK as required to run the full Silverlight 3 SDK, then you may have notices a few things break in your existing Silverlight 2 applications or controls.&lt;br /&gt;&lt;br /&gt;This is because with the advent of Silverlight 3, the convienient ASP.NET Silverlight server controls were removed. The solution is to use the more generic &amp;lt;object&amp;gt; tag to reference controls and pass parameters. While I understand the premise behind this and have seen quite a lot of documentation, I have not see a lot of thorough examples on a 1:1 conversion. In fact in some instances I read where the &amp;lt;asp:mediaplayer&amp;gt; tag was used, that the .js encapsulated behind that would now have to be incorporated into your control. The suggestion was to use Blend with Encoder to make this easier by using one of their templates, and then exporting a .xap file.&lt;br /&gt;&lt;br /&gt;I think the easier conversion will be for those that used just the &amp;lt;asp:silverlight&amp;gt; tag to reference a .xap control. In this case you could probably easily convert the code to using the &amp;lt;object&amp;gt; tag and pass in any needed parameters. However, I think converting the &amp;lt;asp:mediaplayer&amp;gt; references are going to involve more work.&lt;br /&gt;&lt;br /&gt;If you are looking for the fastest solution to fix your current application so that it will work, to buy time to make the full conversions to SL3 (or maybe wait until SL4 is RTM, because my experience is each SL release has had major changes that don't upgrade so well; that's ok though - the growing pains come with the territory of new technology) then here it is. You need to go to the /bin of a currently deployed solution and try to find the following .dll: &lt;strong&gt;&lt;span style="color:#000099;"&gt;System.Web.Silverlight&lt;/span&gt;&lt;/strong&gt; This .dll has the asp.net Silverlight Server controls. If you copy that .dll into a 'Components' directory of sorts (or into the /bin, however your process dictates) and add a reference to that .dll, your errors should go away.  If you do not have a copy of the .dll anymore, you can download the Silverlight 2 SDK and get the .dll from there as well.&lt;br /&gt;&lt;br /&gt;For a more detailed reference on ensuring your Silverlight 2 application work with Silverlight 3, check out the following link:&lt;br /&gt;&lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc645049(VS.95).aspx"&gt;Ensuring That Your Silverlight 2 Applications Work with Silverlight 3&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;For a more detailed reference on persisting the Silverlight 2 ASP.NET server controls, take a look to the following whitepaper:&lt;br /&gt;&lt;b&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=153377"&gt;ASP.NET Server Controls for Silverlight in the Silverlight 3 SDK&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;One of the better references I have seen for parameters that can be passed to an &amp;lt;objectgt; tag:&lt;br /&gt;&lt;b&gt;&lt;a href="http://weblogs.asp.net/lduveau/archive/2009/07/22/silverlight-3-object-tag-param-list-aka-where-is-my-asp-silverlight-control.aspx"&gt;Silverlight 3 object tag param list&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-7667397634992157394?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/7667397634992157394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/02/dealing-with-removal-of-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7667397634992157394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/7667397634992157394'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/02/dealing-with-removal-of-aspnet.html' title='Dealing With the Removal of the ASP.NET Silverlight Server Controls in Silverlight 3'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-8350971452987034542</id><published>2010-01-30T02:04:00.008-05:00</published><updated>2010-03-08T08:57:38.565-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='BitLocker'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><title type='text'>How To: Set Up BitLocker Full Disk Encryption + Pre-Boot Pin in Windows 7 Ultimate</title><content type='html'>&lt;span style="font-family:arial;"&gt;Ok, this goes in the "and Beyond..." category because this post is not specific to .NET, but about setting up full disk encryption using a product by Microsoft named BitLocker. BitLocker is included is some of the premium Windows Vista and Windows 7 editions; specifically this post speaks of how to set up full disk encryption on Windows 7 Ultimate Edition.&lt;br /&gt;&lt;br /&gt;There are several reasons for using full disk encryption; sometimes it is a requirement of the company you work for, or maybe you have sensitive information that needs to be secured in the event of your computer being lost or stolen. While traditionally you may think of using BitLocker just for laptops because of their portability which brings an increased risk of loss or theft, this could be done on a desktop with the appropriate hardware required as well.&lt;br /&gt;&lt;br /&gt;I will preface these directions with some cautions and warnings. The process although not rocket science, is a series of steps that must be followed quite closely with no variations. I myself have had some unsuccessful attempts at setting up the encryption, which caused an OS failure, and the need to reformat and reinstall the OS again. That being said... "BACK UP EVERYTHING IMPORTANT BEFORE SETTING UP ENCRYPTION!" Ideally, you would do this initially upon getting a new laptop with Windows 7, or after doing a fresh install. That way if you run into any major issues, you can re-image the machine to its default configuration and start over again. I do believe that encryption overall makes the hard drive a tad bit more volatile, so regardless of the success of encrypting your disk, I recommend backing up important files from time to time after encryption is complete.&lt;br /&gt;&lt;br /&gt;There are a few prerequisites to using BitLocker and full disk encryption. 1st, you need to have Administrative rights on the machine. The 2nd I already spoke of and that is needing Windows 7 Ultimate. The 3rd is a device that is imbedded in the laptop or machine called a TPM or "Trusted Platform Module". The TPM is responsible for generating and storing a keyset used for the drive encryption and for integrity checks of the system boot files. This results in securing the system volume with encryption and integrity checking the system boot files to ensure that nothing has been tampered with and the system drive is located in the original computer. Only then is decryption preformed. While there are software only solution for full drive encryption, they are more susceptible to hackers than BitLocker used with a TPM. Microsoft has published a wealth of detail on the underlying workings of BitLocker and the TPM, so I will not repeat it here. If you are interested, check out either of the following sites:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://blogs.technet.com/bitlocker/" target="_blank"&gt;BitLocker Drive Encryption Team Blog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/windows/aa905065.aspx" target="_blank"&gt;TechNet: BitLocker Drive Encryption&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Alright now to the meat and potatoes of this project. Remember, try to follow each step as closely as possible without deviation for the nest results.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 1&lt;/u&gt;&lt;/u&gt;&lt;/span&gt;:&lt;/b&gt; Backup all important files. Let me say again... Back up all important files. Just in case you have any issue with setting up BitLocker, you will not have lost all of your important data.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 2:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt; Update the BIOS for your machine to the most up to date version. Each motherboard or machine is going to have their own website for instructions and downloading and updating the BIOS. For example Dell has a site for its updates, ASUS has a site for their motherboard updates, etc. Oh, and if you are reading this and not sure what the BIOS is... I recommend to halt this procedure and not continue. Just my advice.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 3:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt; Log into Windows after the BIOS is updated and go to the following: Start -&gt; Control Panel -&gt; BitLocker Encryption. Find your Hard Drive and select "Turn BitLocker On". It should probably not work giving you the message below stating a TPM could not be found. If for some reason the BitLocker process begins because your TPM was already configured, should cancel the process and do the 2nd part of Step # 4: Configuring the boot sequence from the BIOS.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/S2PbHMf8YZI/AAAAAAAAADY/b8MEyLtNQuo/s1600-h/BitLocker1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432426492199723410" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_o-C99bmODDI/S2PbHMf8YZI/AAAAAAAAADY/b8MEyLtNQuo/s320/BitLocker1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 4:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt; Enter the BIOS on boot and Enable the TPM and configure the boot sequence. 1st, enter the BIOS and find the TPM settings. They are probably under a 'Security' heading or something similar. All BIOS menus are different, so I don’t have the specific directions for each one, but navigate around until you find it. Once you do, select the option to enable it. 2nd, reconfigure the boot sequence. Make sure that any option for USB or Flash drives boot AFTER the Hard Drive. This sort of undocumented step caused me a lot of failed encryptions in later steps. The reason is that upon doing the BitLocker System Check, the system reboots and checks to make sure the generated keys placed on your USB Flash Drive actually work properly, prior to actually doing the encryption. Well if the USB is ordered to boot prior to the hard drive, the machine thinks you are using the USB as a boot device and forfeits the BitLocker check. You need to have the hard drive boot prior to the USB drive. No worries, though, if you ever need to boot from a DVD or flash, just go back in and switch the order to do whatever processing you need and then switch it back. Save your changes and exit the BIOS.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 5:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt; Set up BitLocker and the TPM. Log all the way back into Windows (do not shut down in-between) and go back to the BitLocker Encryption option in the Control Panel. Press "Turn On BitLocker" again. This time the BitLocker process will recognize a TPM enabled and being the process. You should see screens such as the following below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_o-C99bmODDI/S2Pbeb3Wy8I/AAAAAAAAADg/9g_w0Su1Unc/s1600-h/BitLocker2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432426891461446594" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_o-C99bmODDI/S2Pbeb3Wy8I/AAAAAAAAADg/9g_w0Su1Unc/s320/BitLocker2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Press 'Next' to begin BitLocker preparations:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/S2PbpfoUqnI/AAAAAAAAADo/TkFH7dkc2tM/s1600-h/BitLocker3.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432427081450695282" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_o-C99bmODDI/S2PbpfoUqnI/AAAAAAAAADo/TkFH7dkc2tM/s320/BitLocker3.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Press 'Next' to begin the allocation of space for BitLocker:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/S2PcCuC_PAI/AAAAAAAAADw/Am4tsEI7Eno/s1600-h/BitLocker3.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432427514817362946" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_o-C99bmODDI/S2PcCuC_PAI/AAAAAAAAADw/Am4tsEI7Eno/s320/BitLocker3.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Press 'Restart Now' and allow the machine to reboot as displayed below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/S2PcNhfrczI/AAAAAAAAAD4/Bkl9JLEi_ek/s1600-h/BitLocker4.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432427700426601266" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_o-C99bmODDI/S2PcNhfrczI/AAAAAAAAAD4/Bkl9JLEi_ek/s320/BitLocker4.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Upon logging back into Windows, BitLocker will continue the process automatically, so do not attempt to open anything else. You will see the screen below, and to continue the process press 'Next':&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/S2PcURTYcZI/AAAAAAAAAEA/AZhnwMzOwNs/s1600-h/BitLocker5.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432427816339141010" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_o-C99bmODDI/S2PcURTYcZI/AAAAAAAAAEA/AZhnwMzOwNs/s320/BitLocker5.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Upon completing the steps above, you will be prompted to reboot the computer so that the TPM can be configures. Press 'Restart' as directed. Upon rebooting, you will see a basic MS-DOS old school looking screen informing you that the TPM has been modified and do you want to allow the modification. Allow the modification and follow the directions to press the appropriate button. In my case I selected the 'Modify' (not the 'Ignore') so that the TPM configuration could be modified. Upon completion, the machine will reboot. Log all the way back into Windows. The BitLocker process will proceed automatically again. You should see a screen like below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_o-C99bmODDI/S2PceUE-TJI/AAAAAAAAAEI/_cMv1t6uycM/s1600-h/BitLocker6.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432427988882705554" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_o-C99bmODDI/S2PceUE-TJI/AAAAAAAAAEI/_cMv1t6uycM/s320/BitLocker6.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;One the TPM hardware has been configured you will see a screen like below; press 'Next' to continue the process:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/S2PclemL5aI/AAAAAAAAAEQ/BSbolEaXw8w/s1600-h/BitLocker7.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432428111965447586" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_o-C99bmODDI/S2PclemL5aI/AAAAAAAAAEQ/BSbolEaXw8w/s320/BitLocker7.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;At this point you will be prompted to save off the recovery keys. These are the keys that are stored in the TPM, and are only needed in the event of system tampering or breech. I recommend doing all (3) options, and storing the keys to a USB drive, printing them off, and saving them off to a location OTHER THAN the system drive (secure network share, etc.). Obviously I should not need to explains too much here that the keys regardless of type (paper, USB, file) need to be locked away. Don’t leave the USB on the desk next to the laptop, or the paper with the keys folded under the machine. That is like leaving the keys to the car in the door lock. Continuing on...press each option in the screen below to save off the keys:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/S2PeSwLB2EI/AAAAAAAAAEY/TBS5nYgrSbU/s1600-h/BitLocker8.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432429989289121858" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_o-C99bmODDI/S2PeSwLB2EI/AAAAAAAAAEY/TBS5nYgrSbU/s320/BitLocker8.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 6:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt; Run the BitLocker Check (USB with keys saved from Step # 5 required for this step). After saving the keys from above, press 'Next. You will see the screen below asking if you want to run the BitLocker check. While not required, I recommend doing it. You don't want to encrypt the drive until you have tested that the generated keys actually work. Check the box to run the BitLocker check and make sure that the USB drive IS INSERTED in the machine. Press 'Next' and the following reminder and reboot screens will be displayed:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/S2PecPNtPGI/AAAAAAAAAEg/0bOr8bVmYho/s1600-h/BitLocker9.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432430152240675938" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_o-C99bmODDI/S2PecPNtPGI/AAAAAAAAAEg/0bOr8bVmYho/s320/BitLocker9.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/S2PejgZGIvI/AAAAAAAAAEo/EZfD42Ugzuo/s1600-h/BitLocker10.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432430277110932210" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 149px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_o-C99bmODDI/S2PejgZGIvI/AAAAAAAAAEo/EZfD42Ugzuo/s320/BitLocker10.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 7:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt; Full drive encryption. Upon a successful reboot and USB keys check, the BitLocker process will automatically being the encryption process of the system volume. This will take several hours depending on the size of the drive, but you can continue to work in the background if needed. However, do not reboot or shut down during the encryption process. You can lock your machine if needed. The encryption dialog (shown below) will display the progress.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_o-C99bmODDI/S2Pe-xCDE0I/AAAAAAAAAEw/ijP5KE9SyPg/s1600-h/BitLocker11.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432430745434133314" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 157px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_o-C99bmODDI/S2Pe-xCDE0I/AAAAAAAAAEw/ijP5KE9SyPg/s320/BitLocker11.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 8:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt; Configure the machine policy to require a pre boot PIN + TPM (Optional). Once the encryption is complete, you are technically done. The drive is encrypted and secure. You will notice upon reboot you are never prompted for the keys or a password. That's normal. The TPM has the keys, and if there was any breech or integrity failure, you would be prompted for the keys. Otherwise the authentication occurs in the background and is seamless.&lt;br /&gt;&lt;br /&gt;However, to strengthen your security you may want to configure a pre boot PIN that works separately but in conjunction with the TPM. To accomplish this, follow Step # 8 and Step # 9 and Step # 10.&lt;br /&gt;&lt;br /&gt;We need to open the Group Policy editor for the machine. Goto Start -&gt; and type in gpedit.msc and press 'Enter'. Then Goto: Local Computer Policy &gt; Computer Configuration &gt; Administrative Templates &gt; Windows Components &gt; BitLocker Drive Encryption &gt; Operating System Drives and right click the option "Require additional authentication at startup" and select "Edit". The screen is displayed below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/S2Pf7LuZ2yI/AAAAAAAAAFI/MoKgu-YSQfw/s1600-h/BitLocker12_2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432431783391648546" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 284px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_o-C99bmODDI/S2Pf7LuZ2yI/AAAAAAAAAFI/MoKgu-YSQfw/s320/BitLocker12_2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Select "Enabled" and then select "Require startup PIN with TPM" under the "Configure TPM startup PIN:" dropdown. Click "Apply, "OK" then close the dialog and Group Policy editor. This now allows us to configure the pre boot PIN from the command prompt.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 9:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt; Goto Start and type in cmd but do NOT press enter. Once the cmd application displays in the start menu, right click it and state "Run as Administrator". Click "Yes" on any security dialogs that may appear. To configure the pin we need to use the manage-bde.exe tool. To configure the PIN, enter the following and then press 'Enter':&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;manage-bde -protectors -add %systemdrive% -tpmandpin&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You will be prompted to enter a PIN. (Note: I did notice if you still have the USB with the keys inserted into the machine, this process does not work - the command prompt never asks you to enter the PIN; make sure to remove it before doing this process). The PIN by default can only be numeric. There is an option in the group policy editor from Step # 7, to allow complex PINs for this process, but wars not all systems support it. Since you may not find that out until reboot, and not be able to log back in, I suggest just using a numeric PIN. You will be prompted to enter it twice, and upon success, see a screen like the one below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_o-C99bmODDI/S2PfzN7iwMI/AAAAAAAAAFA/AAXmP9rTsOs/s1600-h/BitLocker12.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5432431646544675010" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 162px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_o-C99bmODDI/S2PfzN7iwMI/AAAAAAAAAFA/AAXmP9rTsOs/s320/BitLocker12.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:#336666;"&gt;&lt;u&gt;Step # 10:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt; Reboot and test the PIN. Upon rebooting, after the quick flash of your system manufacture screen, you should receive an old MS-DOS style screen prompting you for your PIN. It tells you the function keys can be used to represent numbers, but I always just use the keypad and it works fine. If needed, the option is there. Upon entering the correct PIN the machine will continue booting into Windows. One note on the pre-boot PIN: I have found that if you have your USB containing the keys inserted upon boot, it assumes you are validated and skips the prompting of the PIN. Since your USB drive should be locked away, you will be prompted for the PIN, but again, another nice option if needed.&lt;br /&gt;&lt;br /&gt;And that is it! Hopefully your encryption process went well and you are complete at this point. I have done this process on 7 different machines with success, so I know it works when followed as directed. Your drive will now be secure with BitLocker. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-8350971452987034542?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/8350971452987034542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/01/how-to-set-up-bitlocker-full-disk.html#comment-form' title='25 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8350971452987034542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8350971452987034542'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/01/how-to-set-up-bitlocker-full-disk.html' title='How To: Set Up BitLocker Full Disk Encryption + Pre-Boot Pin in Windows 7 Ultimate'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_o-C99bmODDI/S2PbHMf8YZI/AAAAAAAAADY/b8MEyLtNQuo/s72-c/BitLocker1.jpg' height='72' width='72'/><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-8067650570738292651</id><published>2010-01-26T23:54:00.001-05:00</published><updated>2010-01-27T15:53:15.083-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2008'/><title type='text'>Add Missing Build Configuration DropDown to VS.NET</title><content type='html'>&lt;span style="font-family:arial;"&gt;If you are like me, then you probably enjoy the convenience of the Build Configuration menu inside of Visual Studio.NET. This is the menu that contains the "Debug" and "Release" modes for project deployment configuration. Well when I build a new machine or re-install VS.NET, I notice that the build dropdown is not always displayed by default. So here are a few simple steps to get the menu back being displayed.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;1. Goto the View -&gt; Toolbars-&gt; Customize menu in VS.NET. Select the 'Build' category on the left side, and scroll down to "&lt;strong&gt;Solution Configuration&lt;/strong&gt;". Click and drag it to the location on your VS.NET menu where you would like it to be located. At this point you probably notice the dropdown is added, but is greyed out, and might not even have any option shown similar to the picture below (Step # 2 fixes this):&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/S2Cmi3AkHBI/AAAAAAAAACg/DH3peXPYipg/s1600-h/BuildConfiguration1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 94px; height: 75px;" src="http://2.bp.blogspot.com/_o-C99bmODDI/S2Cmi3AkHBI/AAAAAAAAACg/DH3peXPYipg/s320/BuildConfiguration1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5431524268420897810" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2. To now enable the menu goto the Tools -&gt; Options menu. On the left side expand the "Projects and Solutions" section and select "General". Then on the right hand side, check the box that states "&lt;strong&gt;Show advanced build configurations&lt;/strong&gt;".&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_o-C99bmODDI/S2Cmu1-sIxI/AAAAAAAAACo/LG21JB6KaBQ/s1600-h/BuildConfiguration2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 308px; height: 174px;" src="http://2.bp.blogspot.com/_o-C99bmODDI/S2Cmu1-sIxI/AAAAAAAAACo/LG21JB6KaBQ/s320/BuildConfiguration2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5431524474303030034" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;That's it! You should now have an enabled build configuration menu in VS.NET.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_o-C99bmODDI/S2Cm6PWEAYI/AAAAAAAAACw/Tm4zkSC7Tsw/s1600-h/BuildConfiguration3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 99px; height: 75px;" src="http://3.bp.blogspot.com/_o-C99bmODDI/S2Cm6PWEAYI/AAAAAAAAACw/Tm4zkSC7Tsw/s320/BuildConfiguration3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5431524670090510722" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1528805174514452404-8067650570738292651?l=allen-conway-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-conway-dotnet.blogspot.com/feeds/8067650570738292651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/01/add-missing-build-configuration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8067650570738292651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1528805174514452404/posts/default/8067650570738292651'/><link rel='alternate' type='text/html' href='http://allen-conway-dotnet.blogspot.com/2010/01/add-missing-build-configuration.html' title='Add Missing Build Configuration DropDown to VS.NET'/><author><name>Allen Conway</name><uri>http://www.blogger.com/profile/07010967958393033081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_o-C99bmODDI/SrpHNECVGRI/AAAAAAAAAAo/Pckvkip1PcM/S220/AboutMe.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_o-C99bmODDI/S2Cmi3AkHBI/AAAAAAAAACg/DH3peXPYipg/s72-c/BuildConfiguration1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1528805174514452404.post-4783221281916510454</id><published>2010-01-10T21:48:00.014-05:00</published><updated>2010-11-01T16:54:28.690-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>How To: Create an ASP.NET style Windows Authentication Policy for WCF Services</title><content type='html'>&lt;p&gt;&lt;span style="font-family:arial;"&gt;For those of you that program on a Windows Domain probably in a corporate environment, you were probably well familiar with using Windows Authentication in .asmx web services to restrict or permit users access. Do you remember how easy it was in a .asmx web service to allow only a specific user or group? Take a look below from the only setting needed in the web.config file associated with the web service:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&lt;authorization&gt;&lt;br /&gt;   &lt;allow roles="MyCompany\AdminUsers"&gt;&lt;br /&gt;   &lt;!--Deny annonomys users--&gt;&lt;br /&gt;   &lt;deny users="?"&gt;&lt;br /&gt;   &lt;!--Deny all users (except the ones specifically allowed)--&gt; &lt;br /&gt;   &lt;deny users="*"&gt;&lt;br /&gt;&lt;/authorization&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;That was it! Now let's not start off on the wrong foot here or give the wrong impression. I am a huge advocate of WCF over .asmx services and definently think it is the way to go. With WCF having such a broad use capability and granular level of control and functionality, came the loss of some of the bundled up functionality that was specific to IIS hosted .asmx web services. This is not a bad thing at all.&lt;br /&gt;&lt;br /&gt;However, those of us that work with WCF came to quickly realize that with just a small configuration you could easily configure WCF to only allow Windows Authenticated users to access the service, but that was it. There was no clean direct way to restrict the Windows Users or Groups in a 'blanket' fashion as was the case with .asmx web services and the configuration shown above. Not even setting the WCF service to ASPCompatibilityMode could directly accomplish the configuration above.&lt;br /&gt;&lt;br /&gt;So there are (2) main ways to get around this issue. The 1st method to get around this would be to define PrincipalPermission attributes on every method to define its security requirements. This means hardcoding the security requirements, and is not as flexible as info that comes from a .config file. In some cases this method by method style of security may be desired, but often our services are an all or nothing style of access.&lt;br /&gt;&lt;br /&gt;The 2nd solution, and the focus of this article, is to intercept the authorization calls to your WCF service and examine the identity of the user making the call to determine if they are authorized. We as developers are provided the ability to extend the 'ServiceAuthorizationManager' class and override the '&lt;strong&gt;CheckAccessCore()&lt;/strong&gt;' method to define our own custom authorization policy for the service. It is within this method that you can scrutinize the individual roles, groups, or users authorized by extracting the WindowsIdentity of the context, and then either permitting or rejecting access based on your requirements. Within here you could pull the authorized roles, users, or groups from the WCF .config file.&lt;br /&gt;&lt;br /&gt;To get right to the code, below I have provided the implementation of the overriden '&lt;strong&gt;CheckAccessCore()&lt;/strong&gt;' method. The robust comments within should detail well what each step is doing:&lt;br /&gt;&lt;pre class="brush: vb.net"&gt;&lt;br /&gt;Imports System.Configuration&lt;br /&gt;Imports System.Security.Principal&lt;br /&gt;Imports System.IdentityModel.Tokens&lt;br /&gt;&lt;br /&gt;''' &lt;summary&gt;&lt;br /&gt;''' The Identity Model infrastructure in Windows Communication Foundation (WCF) supports an extensible claims-based authorization&lt;br /&gt;''' model. Claims are extracted from tokens and optionally processed by custom authorization policies and then placed into an&lt;br /&gt;''' AuthorizationContext. An authorization manager examines the claims in the AuthorizationContext to make authorization decisions.&lt;br /&gt;''' By default, authorization decisions are made by the ServiceAuthorizationManager class; however these decisions can be&lt;br /&gt;''' overridden by creating a custom authorization manager. To create a custom authorization manager, create a class that derives&lt;br /&gt;''' from ServiceAuthorizationManager (this class) and implement CheckAccessCore method (done in this class). Authorization&lt;br /&gt;''' decisions are made in the CheckAccessCore method, which returns 'true' when access is granted and 'false' when access is denied.&lt;br /&gt;''' In our case, we are examining the Windows Identity of the current user's context and checking it against some predefined&lt;br /&gt;''' permitted users and roles from the AppSettings section of the associated services' .config file.&lt;br /&gt;''' &lt;/summary&gt;&lt;br /&gt;''' &lt;remarks&gt;Because of performance issues, if possible you should design your application&lt;br /&gt;''' so that the authorization decision does NOT require access to the message body.&lt;br /&gt;''' Registration of the custom authorization manager for a service can be done in code or configuration.&lt;br /&gt;'''&lt;/remarks&gt;&lt;br /&gt;Public Class CustomAuthorizationManager&lt;br /&gt;  Inherits ServiceAuthorizationManager&lt;br /&gt;&lt;br /&gt;  Protected Overloads Overrides Function CheckAccessCore(ByVal operationContext As OperationContext) As Boolean&lt;br /&gt;&lt;br /&gt;     'For mex support (starting WCF service, etc.)&lt;br /&gt;     'NOTE: Other than for service startup this will NOT be true because the WCF&lt;br /&gt;     'configuration dictates that WindowsCredentials must be sent and Anonymous users&lt;br /&gt;     'are NOT allowed.&lt;br /&gt;     If operationContext.ServiceSecurityContext.IsAnonymous Then&lt;br /&gt;         Return True&lt;br /&gt;     End If&lt;br /&gt;&lt;br /&gt;     'If Windows Authentication has been defined in the binding and either of the (2)&lt;br /&gt;     'predefined AppSettings are populated, proceed to authorize current user/group against allowed users or groups.&lt;br /&gt;     If (ConfigurationManager.AppSettings("AuthorizedGroups") IsNot Nothing) OrElse _&lt;br /&gt;         (ConfigurationManager.AppSettings("AuthorizedUsers") IsNot Nothing) Then&lt;br /&gt;&lt;br /&gt;         Dim IdentityIsAuthorized As Boolean = False&lt;br /&gt;&lt;br /&gt;         'Extract the identity token of the current conte
