This project is read-only.
1

Resolved

Exception while loading an msbuild project

description

In the current master branch when loading a C# project I get an exception from ProjectFileLoader.cs in GetLoaderForProjectTypeGuid. It tries to read the ProjectTypeGuid which is a string for me and not a string array:
        public static IProjectFileLoader GetLoaderForProjectTypeGuid(Workspace workspace, Guid guid)
        {
            return workspace.Services.FindLanguageServices<IProjectFileLoader>(
                d => ((string[])d["ProjectTypeGuid"]).Any(g => guid == new Guid(g)))
                .FirstOrDefault();
        }
Looking at the history, GetLoaderForProjectFileExtension seems to have been updated but GetLoaderForProjectTypeGuid may have been forgotten?

Changing the delegate to d => (guid == new Guid((string)d["ProjectTypeGuid"]))) fixed that for me.

comments

dcazzulino wrote Jan 3, 2015 at 11:46 PM

Sent PR that fixes this. I've verified it on a clean VM with just VS2012 Update 4.

https://roslyn.codeplex.com/SourceControl/network/forks/dcazzulino/msbuild4/contribution/7871