-
SCSF Solution file is checked out from TFS when it is opened in Visual Studio 2008 SP1
4 CommentsThe UX Patterns & Practices (Sustained Engineering) team was working on a task trying to find the causes why the solution file of an SCSF Solution is checked out from Team Foundational Server (TFS) when it is opened in Visual Studio 2008 SP1. We found that the issue appears when some properties are added to the GlobalSection(ExtensibilityGlobals) section inside the Solution file. So we created a workaround that saves the properties that cause the automatic checked out in other file than the solution file, an XML file.
Note: This issue was investigated based in a customer’s problem who uses TFS as Source Control, but it is possible that the issue appears when the solution is binded to other Source Control for the same reason. Also, the provided workaround should work in your case too. Cause of the Issue
As I said, we detected that the issue appears when some properties are added to the GlobalSection(ExtensibilityGlobals) section inside the Solution file. After trying to find the cause in different environments (with different configurations among Visual Studio 2008 SP1, GAX & SCSF), we arrived to the conclusion that the issue is not related neither to GAX nor SCSF, and may be related directly to Visual Studio (because the issue also appears without GAX & SCSF).This issue appears when creating a SCSF solution, because the GP happens to store some properties in this section, but the checkout when opening the solution everytime is not caused by SCSF itself.
Workaround
To avoid using the problematic section in the solution file, we created a custom SCSF Guidance Package that saves the content of this section in a separated XML file. In this way, the Visual Studio does not get knowledge about these properties avoiding the check out.
Downloads
Here you can find some stuff that you should use to fix the Guidance Package with the Workaround, or, if you prefer, you can download directly the fixed Guidance Package or an installer:
Disclaimer: The code is provided “AS IS” with no warranties, and confers no rights. - SCSF GP (fix for TFS) – Modified Classes.zip: Contains all the modified classes and files to perform the Workaround manually, following the steps below.
- SCSF GP (fixes for TFS & VS2008SP1) – Source Code.zip: Contains the source code of the Guidance Package with the workaround applied and Visual Studio 2008 SP1′s fixes.
- SCSF GP (fixes for TFS & VS2008SP1) – Installer.zip: Contains an installer to directly install the fixed Guidance Package.
Note: The Visual Studio 2008 SP1′s fixes was provided by Mariano Converti, you can find more information about these in his post. Steps to update the Guidance Package
To perform these steps you should download the SCSF GP (fix for TFS) – Modified Classes.zip file from the Downloads section and install GAT 2008.
- Open the SCSF Guidance Package.
- Create a new Global Value Provider class named XmlGlobalValueProvider. Located it in \SmartClientFactoryPackage\ValueProviders folder of the Guidance Package solution. The code for this class can be found in the downloaded zip file.
- Update SetGlobalValueAction class to use XML file. The class is located in the \SmartClientFactoryPackage\Actions folder of the Guidance Package solution. The code for this class can be found in the downloaded zip file.
- Update all references to “Microsoft.Practices.RecipeFramework.Library.ValueProviders.GlobalValueProvider, Microsoft.Practices.RecipeFramework.Library”. They should now reference Microsoft.Practices.SmartClientFactory.ValueProviders.XmlGlobalValueProvider. This can be done by using Quick Replace.
- Update ViewTemplateReferenceCS and ViewTemplateReferenceVB classes, so they get the CommonProjectGuid from the xml file. The code for this classes can be found in the downloaded zip file.
- Open the Recipes\Common\CreateSmartClientFactorySolutionCommon.xml.
- Add the <Input Name=”SolutionPath” RecipeArgument=”SolutionDir” /> tag to each of these actions:
- SaveRootNamespace
- SaveShellProjectGuid
- SaveCommonProjectGuid
For example:
<Action Name=“SaveRootNamespace” Type=“Microsoft.Practices.SmartClientFactory.Actions.SetGlobalValueAction, Microsoft.Practices.SmartClientFactory.GuidancePackage” PersistValue=“true” ValueName=“RootNamespace“>
<Input Name=“SolutionPath” RecipeArgument=“SolutionDir” /> <!–ADDED TAG TO ACTION–>
<Input Name=“Value” RecipeArgument=“RootNamespace” />
</Action> - Register the Guidance Package.
Important: If you use this without the fix for VS2008 SP1, you will need to replace this line:
if (reference.Name == referenceIdentity) return true;
in both classes for this one:
if (reference.Identity == referenceIdentity) return true;Steps to update the Source Control files
This steps are required if you have an existing solution that you want to use with the new Guidance Package:
- Open the solution file of the SCSF Solution for edit (i.e in notepad) and cut the Global Section(Extensibility Globals) section entirely. You will use the values from this section in the next step.
- Create an XML file in the same directory where your solution file is located named global.xml. Its content should be this:
<GlobalSection>
<ShellProjectGuid>{YOUR SHELL PROJECT GUID}</ShellProjectGuid>
<CommonProjectGuid>{YOUR COMMON PROJECT GUIDE}</CommonProjectGuid>
<RootNamespace>{YOUR ROOT NAMESPACE}</RootNamespace>
</GlobalSection>
For example (using the values that you copied from the solution file):
<GlobalSection>
<ShellProjectGuid>90ae59ae-e404-4102-9076-9fe9ca60f47e</ShellProjectGuid>
<CommonProjectGuid>9993ae7c-e9ea-4e6a-8374-c8f213bc9721</CommonProjectGuid>
<RootNamespace>MySolutionNamespace</RootNamespace>
</GlobalSection>
- Check both files in.
- Open the solution in Visual Studio and check that the new Guidance Package is enabled.
In this way, the next time you open the solution in Visual Studio, the solution file should not be checked out.
I hope this helps you. Please, leave your comment if you have any doubt about the issue or the workaround.
Thanks,
Eze
-
4 Comments:
Leave a comment
Your email address will not be published.
Martin Darilek said on May 14, 2009:
Hello,
we have the same issues with checking-out solutions as You described above. But given hyperlinks for downloading patches does not work. Is it possible create new correct download site?
Thanks
Martin D.
esculli said on May 15, 2009:
Thanks Martin for the information, I have fixed the links, so you should be able to download the different files.
Please, contact me again if you have problems with the solution or implementing it.
Greetings,
Eze
Uri Goldstein said on June 24, 2009:
Hi Ezequiel,
I’m experiencing a similar problem after having installed a DXCore add-in called CodeStyleEnforcer. It has nothing to do with the SCSF. However, it also embeds a GlobalSection(ExtensibilityGlobals) section and also triggers a checkout of the .sln every time it is opened.
Would you happen to know what the cause of the problem is? The workaround naturally will not solve my problem.
Thanks,
Uri
software development uk said on October 14, 2009:
Interesting,
thanks for those download links and your examples keep up the good work
Thanks for bringing this up