Welcome to MSDN Blogs Sign in | Join | Help

I have been asked to suggest books on Project Management. As I pulled together the list, I thought should publish it here also because someone else may find it useful.

Good books to start with are:

·         Absolute Beginner's Guide to Project Management by Greg Horine, http://www.amazon.com/Absolute-Beginners-Guide-Project-Management/dp/0789731975/ref=sr_1_1?ie=UTF8&s=books&qid=1220383621&sr=1-1

·         Applied Software Project Management by Andrew Stellman and Jennifer Greene, http://www.amazon.com/Applied-Software-Project-Management-Stellman/dp/1600330568/ref=sr_1_2?ie=UTF8&s=books&qid=1220383343&sr=1-2

·         Project Management: A Systems Approach to Planning, Scheduling, and Controlling by Harold Kerzner, http://www.amazon.com/Project-Management-Approach-Scheduling-Controlling/dp/0471741876/ref=sr_1_3?ie=UTF8&s=books&qid=1220383621&sr=1-3

    • If you have reached the end of Kerzner’s book, you are really done with the theory of project management.

And after some time of practicing project management, you may decide to become a certified Project Management Professional. I found that going through certification significantly helped me to study different aspects of PMing. I used time on searching and analyzing bad and good practices; seeking reasons for why projects fail and critically evaluate how I run projects and what I do wrong. If you decide to go for PMP certificate, I recommend books listed below.

·         The PMP Exam: How to Pass on Your First Try by Andy Crowe, http://www.amazon.com/PMP-Exam-Pass-Your-First/dp/0972967303

o   The online course for this book is outstanding!

·         PMP Exam Prep, Fifth Edition: Rita's Course in a Book for Passing the PMP Exam by Rita Mulcahy, http://www.amazon.com/PMP-Exam-Prep-Fifth-Passing/dp/1932735003/ref=pd_sim_b_2

o   Beware very tricky sample questions, answers to which are based on long deductions of events that are not stated in the question.

Of course, you will have to read PMBOK also.

·         A Guide to the Project Management Body of Knowledge, Third Edition (PMBOK Guides) by Project Management Institute, http://www.amazon.com/Guide-Project-Management-Knowledge-Guides/dp/193069945X/ref=pd_bxgy_b_text_b  

 

Hope that helps.

 

While I was playing with Microsoft AdCenter API, I have encountered this error:

Error 'An endpoint configuration section for contract 'Microsoft.AdCenter.ICampaignManagementService' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.' encountered.

Out of curiosity, I searched the web for guidance to troubleshoot this error. Surprisingly, I have found very confusing posts of forums with no clear guidance on how to fix the problem. However there seems to be a very simple solution in VS2008 SP1, unless I am missing something.

  1. Open app.config file and check the list of bindings for the service
  2. Pick one binding and copy it to your source as a parameter to a constructor of Service Client class created by "Service Reference" dialog.

That's it. In my example, the app.config file looked like this:

image

Now I was going to use HTTPS connection to the service and as such I am choosing to use "BasicHttpBinding_ICampaignManagementService" binding, which means modifying source code from:

             svcCampMgt = new CampaignManagementServiceClient();

to

             svcCampMgt = new CampaignManagementServiceClient("BasicHttpBinding_ICampaignManagementService");

This change complete fixes the problem. Now some WCF guru can probably point out several other reasons for this error, but hey, for simple scenarios, this change should fix the error just fine.

I have been playing with Microsoft AdCenter API today. The samples do not exactly build in Visual Studio 2008 SP1 without any changes to them. At least for me. After I added "Service Reference" to https://sandboxapi.adcenter.microsoft.com/Api/Advertiser/V5.1/CampaignManagement/CampaignManagementService.svc and integrated code from "How to Check the Status of an Ad Group in C# (V5.1)", I have seen several compile errors. The first one was:

C:\Users\nikolad\Documents\Work\PDC2008\demo\csharp_example\Program.cs(70,21): error CS1501: No overload for method 'GetKeywordAdAssociationsByAdIds' takes '1' arguments

which just opens "pandora box" of errors to follow. Long story short, all of errors can be quickly fixed. Attaching to this thread a source that worked for me. Note: project name was csharp_example, not adCenter as in the original example.

In case you have missed the announcement, PDC2008 registration is now open.  You can advantage of the Early Bird discount and save $200 on your registration. The conference takes place in Los Angeles on October 27-30, 2008. I will be there to introduce the technology my team has been working on. And this is alo a great chance to hear details about the future of Windows, mobility and the next version of Visual Stuio. See you at the conference!

 

Here is another interesting feature of VS2008 about which I could not find any documentation about on MSDN. If we go back to the example from my last post, debugging (F5) the WCF Service Client project is going to start WCF Host Service. However running the same WCF Service client program (Ctrl+F5) is going to result in error:

Unhandled Exception: System.ServiceModel.EndpointNotFoundException: Could not connect to http://localhost:8731/Design_Time_Addresses/WcfServiceLibrary/Service1/.

TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8731.

---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8731

 

I have to admit that the reason for the error was immediately obvious to me. But if I put myself in shoes of someone who is new to VS or web services, I hardly see how she is expected to figure out the next step from this cryptic error message. And because of a general nature of the error it is easy to get off track if follow discussions of this error on MSDN forum or on other sites.

So what is the root cause for the error? The answer is simple – the service is not running. Client attempts to establish connection to the address of the service on the localhost and it fails to do so because service listener is not running. And this is why it is a TCP error, which reminds us that HTTP is built on top of TCP and it relies on TCP to establish connection to the address.

Now that we establish the root cause for the error, how can one fix it? There are several ways to get Ctrl+F5 running:

  • Set service as a startup project and change Start Options
    • In Solution Explorer, right click on the name of the service project (WcfServiceLibrary in our example) and select Set as StartUp Project
    • In Solution Explorer, right click on the name of the service project (WcfServiceLibrary) and select Properties
    • Open Debug Tab in Project properties
    • Change Command line Arguments within Start Options from

      /client:"WcfTestClient.exe"

      To

          /client:"<pathToClient.exe>"

      where pathToClient.exe is the path to the EXE of your client that you have just built. In my case I replaced it with a full path to WcfServiceClient.exe in bin\Debug folder of the project.

    • CONS of this method is that you would have to change project properties again if you would like to run the standard WcfTestClient.exe to test the service later on
  • Run client after starting debugging of the service
    • In this case you need to start debugging the service project (F5) and then from another instance of Visual Studio or from the command line start the client.
  • Host service
    • Hosting a service this is a whole another topic. It is described in relatively well details on MSDN in Hosting Services topic. I will postpone discussion of details for now.

You may choose any way to solve this error you'd like.

Looking through documentation for Windows Communication Foundation (WCF) on MSDN, I am surprised to find almost none information about cool  features of VS2008 added specifically to make development with WCF in VS2008 easier. Most of topics still talk about VS2005.  So I have decided to put a start into this and publish a small “Getting Started” tutorial.  The following subset of VS2008 features is mentioned in the tutorial:

1) New WCF Service wizards

2) Add Service Reference option in Solution Explorer

3) Integration of WCF Host Service and WCF Test Client with VS2008

Here is a brief outline:

1. Troubleshooting tip that may save a lot of your time.

2. Creating WCF Service using VS2008 wizards

3. Testing of WCF Service using VS2008 integration with WCF Host Service and WCF Test Client

4. Creating service client for WCF service using VS2008 support for adding references to service.

 

First, let me start with that tip which is a proven time saver.

Troubleshooting Tip#1: If you run Windows Vista same as I do, it you may save your time if you run Visual Studio 2008 as Administrator. Otherwise you are going to face access related errors all the time. You may either start Visual Studio 2008 by right clicking on its icon and selecting Run as Administrator or modify its shortcut to always run as administrator by changing properties of the shortcut (right click on the icon, select properties, select Advanced, check the Run this program as an administrator). Hopefully your VS2008 IDE runs as admin at this moment so let’s continue.

Creating WCF Service

In this part we create a simple Web Service using wizards of VS2008 only. Here are the steps:

  1. Open Visual Studio 2008.
  2. Create a WCF Service Library project.
  • In the New Project dialog, select Visual Basic or Visual C#, then choose WCF node and choose WCF Service Library.
  • Name the project and find location for it. I have selected WcfServiceLibrary as a name for the project and WCFinVS2008 as a name for the solution.

clip_image002

  • Hit OK and IDE is going to generate project and source to it.

You are pretty much done at this moment. Hit F5 and you should see WCF Test client loading you service first and then showing it in the navigation pane as pictured below.

clip_image004

Troubleshooting Tip#2: If you see WCF Service Host coming up with an error

System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8731/Design_Time_Addresses/WcfServiceLibrary/Service1/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied

as pictured below

clip_image006

then you have missed the Troubleshooting Tip#1 and you do not run VS2008 as Administrator. Go back to IDE, stop debugging (Shift+F5), save all your work, close and re-open VS2008, load WcfServiceLibrary project again and hit F5. Now you should see the state for your service showing as started pictured above. You are ready to test the service with WCF Test client tool which is now integrated with Visual Studio 2008.

Testing WCF Service using WCF Host Service

WCF Test client provides a basic summary to what it can do in order to help you to test your service. You need to select the operation you want to test, then enter the parameters and wait for result from the service. In our example, double-click on GetData() method listed on the left and the right side of the test client should change to let you start testing the service.

clip_image008

Now you can enter value and click on Invoke to get result for the service.

clip_image010

Another cool part of the tool is the XML tab which let you see SOAP envelops used to form client to service request and service to client response.

clip_image012

Anyway, you are done testing the service with WCF tools and it is time to start building an actual client to this service. Close WCF Test client, go back to VS2008 IDE and stop debugging session (Shift+F5).

Creating client to WCF Service

If you think that it was easy to create a WCF service in VS2008, wait till you see how it is easy to create a client to a web service using VS2008 support for WCF. However first you need to understand the term "service reference". . Without going explaining all technical details, in VS2008 a service reference is a representation of a web service as class within the project. VS2008 generates all necessary code and integrates it with your project. Your code can communicate with the service by calling into methods of the class that represents service reference. Let’s demonstrate this using the service we have created in Creating WCF Service section.

1) Create a new project within WCFinVS2008 solution by doing the following steps:

a. In Solution Explorer (on the upper right), right-click WCFinVS2008 solution title (not the project), and select Add, and then New Project.

clip_image014

b. In the Add New Project dialog, choose Console Application, and name it WcfServiceClient and save it into the default location. Note, that selecting Console Application is not required. You can add service reference to pretty much any type of project. We choose to use Console application because this is the simplest type of projects offered in VS2008.

2) Add Reference to WcfService to the new created WcfServiceClient

a. In Solution Explorer (on the upper right), right-click WCFServiceClient project title and select Add Service Reference. This should open Add Service Reference dialog.

b. Click on Discover button on the right side of the dialog. This is going to discover all services that are part of the current solution and the dialog should change to dialog pictured below:

clip_image016

c. Click OK and let VS2008 generate the code for this reference and add it to WcfServiceClient project.

Troubleshooting Tip#2: If you see WCF Service Host coming up with an error

System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8731/Design_Time_Addresses/WcfServiceLibrary/Service1/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied

as pictured below

clip_image018

Then you may have already guessed that you need to follow guidance in Troubleshooting Tip#1. You may also notice that VS2008 also issues another error

There was an error downloading metadata from the address. Please verify that you have entered a valid address.

pictured below

clip_image020

Well this means that service is not accessible and VS2008 cannot download metadata required for building the service. In our case, we know the reason – someone missed the Troubleshooting Tip#1. But in general case a number of reasons may cause this error all of which boils down to one thing – VS2008 cannot connect to the service and cannot download data required for building reference.

Anyway, if you see the error, click OK in Error dialog, close WCF Service Host window, click Cancel in Add Service Reference, save all files, close and re-open VS2008 as administrator, open WCFinVS2008 solution and repeat steps 2 from above.

3) Adding calls to Web Service from the client

a. Open Program.cs by click on the name of the file in Solution Explorer (on the upper right).

b. Within Main() method calls to service as listed below

static void Main(string[] args)
{
       // create an instance of a client to a service
       ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();

       // calling into GetData()
       string data = client.GetData(1);
       Console.WriteLine(“Data returned from GetData() method: {0}”, data);

       // calling into GetDataContract()
       ServiceReference1.CompositeType composite = new ServiceReference1.CompositeType();
       composite.BoolValue = true;
       composite = client.GetDataUsingDataContract(composite);
       Console.WriteLine(“String returned from GetDataUsingDataContract() method: {0}”, composite.StringValue);
      

       //holding window open just for demonstration purposes

       Console.WriteLine("Press any key to exit the program");
       Console.ReadKey();
}

4) Select WCFServiceClient as Startup project

a. In Solution Explorer (on the upper right), right-click on WCFServiceClient project title and select Set as Startup Project.

5) Start debugging by hitting F5

a. You should a command window opening pictured below

image

That’s it. You have built a simple web service and its client using WCF in VS2008. Now, this is a very simple scenario far away from a real world scenario. However it should give a taste of what it is to create a web service in VS2008.

Recently several external people have asked me what Program Manager in Microsoft do and what I do. And I have decided to put one post on my blog with answers to both questions. Let's start with discussing what Program Manager within Microsoft actually is and what it does and then briefly talk about me specifically. First of all, based on my experience of talking to PMs in Microsoft, if you ask 10 PMs what they are suppose to do, you are most likely getting 10 different answers. However there are common patterns which together form a picture of this position. I have started with searching web for any previous discussions. And there are several interesting posts already on the web that talk about PM in Microsoft in details.

Most referenced post is from Steven Sinofsky's Microsoft TechTalk named PM at Microsoft from 2005/12/16. It is long read with a primary focus on "Technical PM" role. Feel free to read it all, but to summary, here are key takeaways:

  • "The job title "program manager" is a bit of a misnomer, since program managers do not program nor do they manage." This is very true. We do not program. From my experience, I have developed only one piece of real code that is still checked in Visual Studio source tree. I did write many lines of code that went into demos, samples, etc, but those do not count. And PM does not manage people unless she or he is a manager of Program Managers, of course.
  • "PM is one equal part of a whole system." This ties back to "nor they manage" part. PM is just part of the team who has very specific job responsibilities and contribution to the overall success of the product.
  • "Program Management [was created] with the explicit goal of partnering with development and working through the entire product cycle as the advocate for end-users and customers" This is still very true and remains very crucial part of a PM job. PM always has to stay focused on the value of the work to the customer. From my experience, once you lost this focus, the final result is not going to make customers happy, which in turn does not make you or your team happy.
  • "PM … focus on the big picture of "what are we trying to do" and on the details of the user experience, the feature set, the way the product [gets] used." Or as one of my manager used to say, PM has to see forest behind trees. Understand why we do what we do, and what is next and why.
  • "Phases to program management: learn, convince, spec, refine". The key point is not said in clear here is that PMs constantly go through these phases non-stop. Every day and many time several times a day new problem shows up on your screen. You have to learn, understand, think of solutions and propose one in a written document or verbally.
  • "Learn --> [Inputs of learning are customer problems, products and technologies out there]. Output of learning is a prototype". This is the most fun part of a PM job. You get a chance to talk to people who actually use the product. You hear problems, you analyze problems, you think of solutions. Usually you talk to all sorts of people outside of your team and in your team. You fly to conferences, read articles, blogs, emails, bug reports, talk to people again, talk to devs, testers, leads and managers. You have to list all problems and all solutions you can find, and attempt to propose a solution based on pros/cons, time, cost, etc. And at the end of the day, there is a proposed solution and/or prototype that preliminary seems like a good thing to do.
  • "Convince --> [Input of convince is the proposed solution.] Output of convince phase is a plan and goals" This is a challenging part. Here where a PM has fun to hearing everything bad about the proposed solution and other better solutions not considered originally. You eventually ended up tweaking solution to find middle ground such that everyone is willing to support the plan and the goals going forward.
  • "Spec --> [Input of Spec is the plan with the list of areas for specing.] Output of spec phase are a series of written specifications" The specification is really general term in PM job. For features and product, it means official document following official template. Many times it is less official document that describes the solution. Overall this it is basically a document that answers on 4 questions - Why? What? When? And How?
  • "Refine --> [Input of Refining is the plan and specs]. Output is the product" This is a constant loop where you go back and force from original plan to deliverables and tweak plan or deliverables until product achieves level of quality that meets expectations of majority of customers. Actually based on my experience, this is where we spend most of our time. PMs are focused on two things: managing change and managing scope. With change, we must understand impact of this change on schedule, cost (resources) and scope of the final product. With scope, we have to check, double check and repeat the check again to ensure that the final results of the team's work are actually what were planned for and it is still what customers are waiting for.

Now Steven Sinofsky's post is not the only one that talks about PM in Microsoft. There are several others, I am listing them below.

  • Nice picture of what PM does at Mike Deem's blog, http://radio.weblogs.com/0105395/stories/2002/03/27/whatIsAMicrosoftProgramManager.html Not sure why PM face is not a happy face. We actually have no choice but being very happy when dev, test and customers are happy about the current release and plans for the next release.
  • Interesting summary of an interview with Cynthia Solomon, former PM for Excel, http://www.stcwvc.org/galley/0209/b01prog_management.htm. Similarly to Steven's post, she stresses out writing functional specs, usability and managing implementation without managing developers and testers who actually develop the feature. This is true to say that "the lead without authority" is a synonym for the PM in a team. Very hard position to be in actually.
  • Series of PM Tips on ASP.NET Team blog, http://weblogs.asp.net/aspnet-team/archive/tags/Program+Manager/default.aspx.
  • Post on Program Managers @ Microsoft on Microsoft JobsBlog. Nice overview of what HR looking in candidates for PM position. What I have found amazing is that the author of the blog says that "Project Management is just one small skill that [she looks] for when talking with potential PM candidates" and that "We are usually not looking for straight up project managers". And this is after she lists 5 core skills of a project manager – gathering and analyzing information, decision making, building relationship with customers, communication skills, work across groups. Perhaps what she thinks of "Project Management" being a schedule management. I believe, this is what she is trying to clarify with the sentence where she mentions Microsoft Project. I hope they do hire great project managers, because being a PM in Microsoft is just about being project manager on many projects with one area of the product.

Speaking of my job specifically, description of a PM job in Steven's post is very close to what I do. Both in Visual C++ and here in Windows Core Networking, I am a technical PM working with a group of developers and testers on a part of the bigger product. It used to be Visual Studio now Windows. My time is spent between the 4 phases outlined by Steven. Sometimes I am more focused on a particular phase such as learning or planning. I talk to customers and partners on regular bases. Learn about their problems and work with my team on finding solutions. In VC Libraries, I used to own all functional specifications and design documents for features in the product. In my new team, I own the functional spec and only reviewer of design document and other documents. This is expected considering that I am relatively new person to the team and climbing learning curve on details surrounding technology in this product. I do manage the schedule, any changes to the schedule and scope, and track progress on schedule and scope completion. Hopefully sometime soon my team can start talking about features we are building to external customers. At that time I will shift focus to building presentation and demos for conference and meetings with external customers. Until then, we are in "refine" stage of the product cycle and this is what I do on daily basis.

At this point I feel I have answered both questions. Hopefully the answers are complete. Let me know otherwise. As I find anything else to add, I will just add it to here.

I would like to let readers of my blog know that today is my last day with Visual C++ team. Starting next Monday I am going to be on Windows Core Networking team. For a reader of my blog, this change of my position means that the content of future posts on my blog is going to be less focused on Visual C++. For some short period of time, I may still cover and answer questions about Visual C++ features in Orcas. But as I spend more time with my new team, content is going to change to cover projects and technologies I am working on then. In future, you are welcome to use Visual C++ team blog is and its contact form to get answers to specific questions about VC++ going forward.

 

Great news everyone! VS2008 Beta 2 has been just released and you may download it and installed it on your computer. Beta 2 previews two major improvements in VC++ Express for VS2008, about which I am very excited about. This is why I have decided to briefly mention them on my blog.

The first change is that with VC++ Express 2008 Beta 2 you are not asked anymore to download 1 GB Platform SDK in order to build Windows applications that use Win32 API. Once you download VC++ Express, it is going to installs a complete set of Windows headers and libraries from Windows Vista SDK. They are installed by default during the second step after installation of .Net Framework 3.5. This is the same set of headers and libraries that all other versions of Visual Studio install on your hard drive.  In addition, VC++ IDE has all standard wizards for creating Windows applications, DLLs and static libraries.  We are also able to keep download size of VC++ Express for 2008 small, actually even smaller that size of VC++ Express for VS2005. The trick is that documentation and samples are now part of separate package and we used the space for including Windows SDK. Isn’t it a great change?

The second change is not as big as the first one but it is still helpful to you. You may now package your applications together with DLLs and manifests for CRT library within your application local folder. No need to build MSI out of MSMs using WiX or download and install 3MB of VCRedist.EXE. Just copy a corresponding folder with CRT library from \vc\redist folder into your application local folder and you can now run your application on another computer.  VC++ 2005 Express does not install CRT DLLs into \vc\redist folder and you had to either follow steps describe in this post on my blog or download and install VCRedist.EXE. Copying folder into one folder from vc\redist to your application folder is much easier than either building MSI with WiX or searching on the web, downloading and installing VCRedist.EXE. Yet another fix to what is a big problem to VC++ 2005 Express.

Now you may have some questions on your mind. And I will try to predict what those are and made an attempt to answer them in this post also. The first question may be on whether one should expect ATL and MFC be included with VC++ Express in the future. At this moment, I can only say that I am aware of discussions about this change. However I am not aware of any concrete plans for this change and surely nothing changes for VS2008. Another question may be about plans for including VCRedist.EXE into VC++ Express. For this I can say that the plan is to keep page from which VCREdist.EXE can be downloaded rather including into VC++ Express install. If you have any other questions, please feel free to leave it in comments or send me email. Otherwise stay tuned and check VC Blog for any other announcements of future changes in VC++. For now, go ahead and download VC++ 2008 Express Beta2 or other versions of VS2008 Beta 2  and try it out.

 

Today when I have been cleaning folders on my hard drive, I have found yet another demo project.  I have built it sometime ago to demonstrate how how one can have C# and C++ project in one solution and link them both into one binary using C++ linker. It looks like it had never found its way to my blog and I have decided to fix this by posting it today.

For this demo, I have generated WCF service server and client in C# and then build C# code into a .netmodule and linked it together with C++ code into one binary. Same time I build C# as another client just for testing purpose. Most if not all code is generated from IDE using standard wizards.

To achieve this I had to do the following in addition to generating all C# code:

1)      I created a Pre-Build event using information from Build.log for C# project to link C# code into a .net module

2)      I changed linker settings for C++ code.

a.       I have added path to C# .netmodule to Add Module Assembly (/ASSEMBLYMODULE)

b.      I had to change to use LTCG in Debug mode also

c.       and Additional Includes settings in command line

3)      Added #using<> in my cpp code to reference C# .net module

4)      Changed Additional include settings such that compiler can find .netmodule when compiling C++ code.

 

That should be all one has to do to repeat this task. When I worked on the sample, I was primarily interested in demonstrating that using similar approach one can keep most of application native and rebuild one component as managed (/clr) in order to start using C# code and VS IDE wizards for generating WCF service clients. Perhaps someone else may find this sample interesting. I am attaching a zip file with source code to the post.

I thought I should write a short post on this issue. It had been discussed before on forums and in bugs. Long story short, VS2005 SP1 does update all VC++ redistributable MSMs in \Program Files\Common Files\Merge Modules. Or I guess I should say, it is built to update them. However if it did not update them or some of them, there two primary reasons for that:

1) Something went wrong in SP1 installer and it never reached a point when it installs these files. Check installation log for SP1 and repeat install. Sometimes you may need to reinstall VS2005 also first.

2) You might have used Orca to view content of RTM version of MSMs. Orca has this "feature" of modifying timestamp of MSM when it opens it, even when no edits are made to content. To workaround this "feature", VC is marking MSMs as read-only in Orcas. Of course, if you have changed timestamp of the file by hand, you are going to see the same behavior.

Usually uninstalling VS2005 SP1, repairing or re-installing VS2005 and then installing VS2005 SP1 again fixes all problems including non updated MSMs.

 

Sometime last week source control and issue tracker data has been corrupted on one of CodePlex servers. As you may have already guessed, all source code for the ATL Server project has been lost with no ability to recover it. This time we were lucky. Trevor and I were able to re-construct last known good source of the project from local copies on our hard drives. I have resubmitted source code, re-build and re-tested the release. We have learned now from this accident and planning to keep copies on our hard drives. Please try downloading new release and see if everything has been recovered. Next work item for me is to do a quick re-test on Visual Studio Orcas Beta 1. I have tried before with pre-released Beta 1 build, so I am quite confident that I won't find anything new. But just as a sanity test, I will go through one more time later tomorrow.

Actually it has been available for download for several days now, but I was looking on Orcas features and completely forgot to mention it on my blog. Here they are:

You can use the to install SP1 versions of VC++ libraries on computers that do not have Visual Studio installed. You need SP1 version of VC++ libraries for applications that you build with VC++ Express SP1 or Visual Studio 2005 SP1.

BTW it does not require Windows Installer 3.0, it works just fine with Windows Installer 2.0. And yes, it can be installed on Windows Vista. I guess they are re-using old templates I have been created for RTM release of VCRedist.EXE. I will have to check with VC Release folks on that.

A reader of the previous post on my blog has posted two questions about using SP1 version of VCRedist.EXE as a boostrapper package. I felt that the topic is important enough to discuss it in a dedicated post rather than comments on another post. Here are quotes of original comments:

 

I'm trying to redistribute vc_redist.exe, but the version that I can download from the web and my version install with visual studio seem to be different:

The version of vc_redist.exe downloaded from the microsoft website seems to be:  8.0.50727.42

While the version of the libraries used by VC seem to be 8.0.50727.762

Is there anywhere on the microsoft website that has the newer version?

 

SP1 version of VCRedist is installed by VS2005 SP1 update on the hard drive and it is also available as a download. The SP1 version of  VCRedist.EXE is installed into the same place where RTM version was, %VSINSTALLDIR%\SDK\v2.0\BootStrapper\Packages\vcredist_*\

One may use it to redistribute SP1 versions of VC++ Libraries. 

 

VS2005 SP1 version of VCRedist.EXE is a major upgrade to RTM version of VCRedist.EXE. Before installing of SP1 version of libraries, it is going uninstall RTM version or any other earlier than SP1 version of VCRedist.EXE. Only then it is going to install new versions of VC++ libraries.

 

When it is used as part of  bootstrapper (setup.exe), RTM version of VCRedist.EXE may be downloaded instead of SP1 version because of incorrect product code specified in product.xml. Here is another quote from the comment I have received:

 

As the click once deployment seems to only check for the installation on the local machine thus:

 <InstallChecks>

   <MsiProductCheck Property="VCRedistInstalled" Product="{A49F249F-0C91-497F-86DF-B2585E8E76B7}"/>

 </InstallChecks>

I noticed this post on Aaron Stebner's blog:

http://blogs.msdn.com/astebner/archive/2007/01/24/updated-vc-8-0-runtime-redistributable-packages-are-included-in-visual-studio-2005-sp1.aspx

It includes the statement:

<quote>

One additional note - the data files included with the Visual Studio deployment bootstrapper tool were not updated with the new SP1 detection mechanism.  This means that if you build a setup project in VS 2005 SP1 and include the VC redist package as a prerequisite, your setup will end up downloading and installing the VC redist package on systems that already have the original VS 2005 version of this redist package installed.  Because of the major upgrade functionality, this will not harm users' systems at all, but it will result in a slight time delay due to an unnecessary download and install.

</quote>

It appears that the product code has been changed to: {7299052b-02a4-4627-81f2-1818da5d550d} but the prerequisites definitions haven't for the bootstrapper.  As a result, the bootstrapper code will still fail as I described above.  

 

Aaron is right that product.xml is not updated with the new product code. It contains old MSI Product code that corresponds to RTM version of VCRedist.EXE. product.xml is used in building boostrappers (setup.exe) and Clickonce deployment for detection of this version of bootstrapper package already installed on the computer. If product code is not updated, each time a bootstrapper launches install, it is going to attempt to re-install VCRedist.EXE again. To work around the issue, it is possible to change that line of product.xml with a new MSI Product code, which is {7299052b-02a4-4627-81f2-1818da5d550d} for the x86 package, {071c9b48-7c32-4621-a0ac-3f809523288f} for the x64 package or {0f8fb34e-675e-42ed-850b-29d98c2ece08} for the ia64 package. Developer support team may also help out with this issue if contacted using ways described on http://support.microsoft.com. I apologize for not catching this before SP1 was released. We are investigating why it slipped through our testing of SP1. Meanwhile for VS2005 SP1 and VS2005 hotfixes you may use the workaround or request new product.xml from the support team.

I have received several questions about a case when developers find two or more references to different versions of CRT or MFC or ALT libraries in application manifest. Usually application manifest would look similar to the following:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

  <dependency>

    <dependentAssembly>

      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

    </dependentAssembly>

  </dependency>

  <dependency>

    <dependentAssembly>

      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

    </dependentAssembly>

  </dependency>

</assembly>

Notice underlined version of assembly. This manifest tells Windows loader to load two different versions of the same assembly. The loader is going to do what it is told to. But the problem arises when it can only find one version (50608) of them. There are two cases when this may happen:

1)     The oldest version of VC++ library is installed in WinSxS folder. For example, author of the application may have redistributed VS2005 RTM version of CRT library using MSMs or VCRedist.EXE, but ones parts of application were rebuilt with VS2005 SP1 and deployed to the same machine, SP1 versions of MSMs or VCRedist.EXE were not deployed to the same machine.

2)     It is not possible to have two versions of a private assembly in one folder. For example, an author of an application has deployed the RTM version of CRT library as a private assembly in application’s local folder. After application is rebuilt with SP1, the author faces a challenge of having two copies of same files/folders in application local folder. If she keeps RTM version, Windows loader is going to complain about SP1 version missing. If she keeps SP1 version, Windows loaders is going to fail to find RTM version. Windows shows a message box which says :”The application has failed to start because of side-by-side configuration is incorrect,” and event viewer shows error details similar to “Activation context generation failed for "…\foo.exe".Error in manifest or policy file. A component version required by the application conflicts with another component version already active.” Bottom line, application does not start.

The root cause of the issue is that not all parts of application’s source code are built with the same version of VC++ libraries and tools. The linker catches some cases and reports errors when it tries to link objects and libraries built with different versions of compiler. However it is still possible to get pass the linker and an application may get these two dependencies in its manifest.

There is one solution to the problem and two workarounds.

The solution. To fix the problem, you must rebuild all parts of your code with the newest toolset and libraries. Make sure you have cleaned up all binaries built by the old toolset and started full rebuild of the whole source base. Also check that old versions of headers and import libraries for VC++ libraries are not on INCLUDE and LIB path and they are not used during the build.

 If you cannot rebuild all your code and use one version of VC libraries, there are two ways to work around this problem:

Workaround#1: Install the newer version (8.0.50727.762 in this case) of VC++ MSMs or VCRedist.EXE on a machine where your application is going to run. Once policy for VC++ assemblies is installed on that machine they are going to redirect all loads of older versions (8.0.50608.0) to the newest version available on the machine.

Workaround#2: If you are redistributing VC++ libraries in application’s local folder, you need to add an application configuration file that redirects an attempt to load 8.0.50608.0 version to 8.0.50727.762 version.  Configuration file has to have same name as the exe plus .config extension and has to be right next to exe or embedded into the EXE. Here is an example of a configuration file that one would use to resolve issue with the manifest from above:

<configuration>

       <windows>

              <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

      <dependentAssembly>

        <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

        <bindingRedirect oldVersion="8.0.41204.256-8.0.50727.762" newVersion="8.0.50727.762"/>

      </dependentAssembly>

    </assemblyBinding>

       </windows>

</configuration>

This file basically redirects attempts to load any version of VC CRT greater or equal to 8.0.41204.256 (VS2005 Beta 1) and less than 8.0.50727.762(VS2005 SP1) to load VS2005 SP1 version of VC CRT. It is similar to what the policy file does for a case when CRT is installed into WinSxS folder.

Overall my recommendation is to never use static libraries for which you do not have a source code. Using a static library without its source always puts a set of restrictions on build configuration of a binary that consumes it. There are ways to build a “clean” static library, but they are not well known among developers and it is very rare to find a static library that can be consumed in a code built with different versions of compiler, linker and libraries. If source code is not provided, I would only take a dependency on a DLL and only if its APIs are cleanly designed to obey rules of data exchange across DLL boundary. COM and .Net class assemblies are designed to address this problem and they are the easiest technologies to use in this scenario.

More Posts Next page »
 
Page view tracker