[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/pabloperalta] September 2008 - Posts - Pablo Peralta's Blog

September 2008 - Posts

 

I am sharing an interesting article that gives a first look at what is coming in Visual Studio 2010.

The complete article is available here.

I am pasting some points that I consider pretty relevant:

Overview

Microsoft is offering a first look at the next version of its Visual Studio integrated development environment (IDE) and platform, which will be named Visual Studio 2010 and the .Net Framework 4.0. There's a lot promised in the new release (expected to ship, duh, in 2010), from improved software testing tools to software engineering modeling capabilities to integrated development and database functions for the application lifecycle management (ALM).

 

 Application Lifecycle Management

A key goal in VSTS 2010, says Microsoft, is to help democratize ALM by bringing all members of a development organization into the application development lifecycle, and remove many of the existing barriers to integration.

For the IT manager or CIO, says Mendlen, VSTS will give clarity and visibility into the state of the project throughout the lifecycle, using Team Foundation Server-enabled dashboards customized for her role. 

 

Agile Tools, Built-In

Visual Studio 2010 also will sport features to integrate Agile methodologies into the tech stack using Team Foundation Server. 

The result of right-clicking on a method in the VS text editor, selecting "Generate Sequence Diagram⬦". A UML 2.1.1 sequence diagram depicting the call chain originating from the selected method. 

 

Putting Quality Earlier in the Development Lifecycle

In Visual Studio 2010, he says, tools will help create a direct relationship between unit tests that must be run and the code a developer is writing. This "must-do" testing feature, called test prioritization, will get the developers to check their code against at least the highest-priority unit tests.

So, new in Visual Studio 2010 will be a video-capture feature recording what's going on as the QA professional tests the software.

This isn't only video capture. These tools (which internally the VSTS team currently calls "Tivo for debugging" but surely will have a marketing-approved name by release time) also record the state of the application as the tester is testing it.

In other words, when the QA person clicks "Create new bug," the video and rich debug log become part of the record.

 

Merging of Developer, DBA Roles

Microsoft is merging the database professional edition. 

As Microsoft sees it, the roles of the database-centric developer and "regular" developer are less distinct than they once were, so the company is merging its VSTS database and development products. As of October 1, those who belong to the Microsoft Developer Network (MSDN) and currently own Visual Studio Team System 2008 Development Edition or Visual Studio Team System 2008 Database Edition will receive for free the Visual Studio Team System 2008 Development Edition, Visual Studio Team System 2008 Database Edition, Visual Studio 2005 Team System for Software Developers and Visual Studio 2005 Team System for Database Professionals.

While deploying WCF services in IIS6 I came across the annoying 404 error. That was a bit strange and hence, I started to search.

I am sharing here a solution that is quite simple and not so new, but it is a little tip that could save a lot of time :)

The error is described here:

http://support.microsoft.com/kb/315122/en-us

SYMPTOMSWhen you request dynamic content such as an Active Server Pages (ASP) page, an ASP.NET page, an Internet Services API (ISAPI) application, or a Common Gateway Interface (CGI) application on a Microsoft Windows Server 2003 server that is running Internet Information Services (IIS) 6.0, you may receive one of the following error messages: Error message 1HTTP Error 404 - File Not Found Error message 2HTTP Error 404- File or Directory not found Back to the topCAUSEBy default, when IIS is installed on any version of the Windows Server 2003 family, IIS only serves static content (HTML). RESOLUTION
Enable a Pre-existing Web Service Extension in IIS 6.0

To permit IIS to serve content that requires a specific ISAPI or CGI extension that is already listed in the Web service extensions list, follow these steps:
1. Open IIS Manager, expand the master server node (that is, the Servername node), and then select the Web service extensions node.
2. In the right pane of IIS Manager, right-click the extension that you want to enable. In this example, this is ASP.NET v2.0.50727.
3. Click to select the Allow check box.

 

Hi! I came across with this error in SQL Server Management Studio  everytime I made some modifications in a table, i.e. adding relationships.

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

It was pretty tedious and generated a lot of doubts to me. Then, after making a quick search I found this great post from Brian Knight which explains how to avoid this behavior 'by design' :)

 In a nutshell, the solution is:

This is by design and can be quickly fixed in Management Studio by unchecking a property. To fix this in Management Studio, go to Tools -> Options then go to the Designer Page and uncheck "Prevent saving changes that require table re-creation".

Complete info, here: http://pragmaticworks.com/community/blogs/brianknight/archive/2008/06/04/sql-server-2008-designer-behavior-change-saving-changes-not-permitted.aspx

I am going to share something that we needed recently and I understand it is pretty useful in many scenarios.

Scenario:

To generate a hash using a secret key so as to add a new level of security, avoiding that someone gets into the middle and tamper the information being sent by regenerating the same hash again.

This is what is known as MAC (Message Authentication Code). In essence, the result is an encrypted hash.

Method

There are several mechanisms to generate this (HMACMD5 , HMACSHA1, etc.). Currently, Microsoft is recommending the use of SHA256, hence, I chose HMACSHA256.

Code

Here I am sharing the relevant parts of the code that allows doing this:

using System.Security.Cryptography;

        public string GetMACHash(string textToHash)

        {

            //  secret key shared by sender and receiver.

            byte[] secretkey = new Byte[64];

            string key = null;

            string result = null;

 

           //get secret key

            key = "MySecretKey"; //esto podemos invocar a un metodo que traiga este valor de la registry por ejemplo

            secretkey = System.Text.UTF8Encoding.UTF8.GetBytes(key);

 

            // Initialize the keyed hash object.

            HMACSHA256 myhmacsha256 = new HMACSHA256(secretkey);

 

            // Compute the hash of the text.

            byte[] bytedText = System.Text.UTF8Encoding.UTF8.GetBytes(textToHash);

 

            byte[] hashValue = myhmacsha256.ComputeHash(bytedText);

 

            //Base-64 Encode the results and strip off ending '==', if it exists

            result = Convert.ToBase64String(hashValue).TrimEnd("=".ToCharArray());

 

            //set response

            return result;

        }

 

References

Here is a good article that talks about MACs.

http://dotnetslackers.com/articles/security/Hashing_MACs_and_Digital_Signatures_in_NET.aspx

Here is the information about HMACSHA256 class

http://msdn.microsoft.com/en-us/library/system.security.cryptography.hmacsha256.aspx

 

Hi, I had to change the SMTP server that I am using in my Team Foundation Server 2008.

Unfortunately, as in other cases with TFS, changing configurations is not a straight forward task, not also a friendly one L.

You have to get through tables in the DBs or .configs. In the case you want to change SMTP server the configurations are on the following .configs files:

-          SMTP Configuration in TFS Server

o    C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\Services\Web.config

-              1: <appSettings>

-              2:   <add key="ConnectionString" value="Application Name=TeamFoundation;Persist Security Info=False;Initial Catalog=TfsIntegration;Data Source=TFS2008;Integrated Security=SSPI"/>   

-              3:   <add key="eventingEnabled" value="true" />

-              4:   <add key="DetailedExceptions" value="false" />

-              5:   <add key="emailNotificationFromAddress" value="tfs2008@mydomain.com" />

-             6:   <add key="smtpServer" value="mySmtpServer" />

-              7: 

-              8:   <!-- Optional Alert Settings

-              9:        AlertUseReplyTo: True, False (default: True). Specifies that the ReplyTo property of the

-             10:                    email alert should be set. When false, the From property is set.

-             11:   <add key="AlertUseReplyTo" value="True" />

-             12:   -->

-             13: </appSettings>

 

-          SMTP Configuration in TFS Web Access

o    C:\Program Files\Microsoft Visual Studio 2008 Team System Web Access\Web\web.config

-           1: <webAccessSettings>
-              2:  
-              3:   <!-- Some settings removed for brevity. -->
-              4:  
-              5:   <!-- 
-              6:   Specifies whether sending query results and work items as email is enabled.
-              7:   Make sure to enable/disable mailSettings section in <system.net> below for the sender username and password
-              8:   -->
-              9:   <emailSettings sendingEmailEnabled="true" />
-             10:  
-             11: </webAccessSettings>
-             12:  
-             13: <!-- ** Email Settings ** -->
-             14: <system.net>
-             15:   <mailSettings>
-             16:     <smtp deliveryMethod="network" from="fromaddress@domain.com">
-             17:  
-             18:       <!-- Use default credentials -->
-             19:       <!--<network host="mail.example.com" port="25" defaultCredentials="true" />-->
-             20:       
-             21:       <!-- To specify a username and password, comment out the <network> section 
-             22:       above, and uncomment the one below -->
-             23:       <network host="smtpHost" port="25" defaultCredentials="false" userName="smtpUsername" password="smtpPassword" />
-             24:     
-             25:     </smtp>
-             26:   </mailSettings>
-             27: </system.net>

 

I found a very useful post from David Barrett here. I strongly recommend it for deeper details.

Hope the information is useful, thanks

PP

 

More Posts