My company has developed an application using the Visual Studio 2010 Isolated Shell and implemented a custom project using MPF10. We have a need to upgrade the application to use the Visual Studio 2013 Isolated Shell so I am attempting to convert our application.
I have installed VS2013, VS2013 SDK and VS2013 Isolated Shell on my system. I have updated the target framework to 4.5 for all C# projects in our application's solution, and updated all references in all C# projects to use VS 12.0 assemblies. I have also upgrade MPF source files to MPFProj12.
After some difficulties I successfully migrate application to VS2013.
I can open application and also package loads correctly, but the problem occurs when I am trying to open existing project or create new project inside shell application.
The problem occurs in MPF when ProjectNode uses service type of IVsBuildManagerAccessor for building the project. It looks like the SVsBuildManagerAccessor.BeginDesignTimeBuild() method behaves differently in VS 2013 and the build is not initialized properly.
When executing »BuildManager.DefaultBuildManager.PendBuildRequest(requestData);" we get an exception:
- An exception of type 'System.InvalidOperationException' occurred in Microsoft.Build.dll but was not handled in user code
- Additional information: The operation cannot be completed because BeginBuild has not yet been called.
I also noticed that when ServiceProvider is getting service type of SVsBuildManagerAccessor "this.Site.GetService(typeof(SVsBuildManagerAccessor)) as IVsBuildManagerAccessor;" regardless MsBuld version 4.0 is already loaded it also loads MsBuild version 12.0.
I can make workaround if I modify the ProjectNode code, to skip the design time build initialization and instand of IVsBuildManagerAccessor always use the BuildManager.DefaultBuildManager.BeginBuild() method directly.
After using this workaround everything seems to work fine for now.
I am not sure if this temporary workaround will solve problem in general.
Does anybody have similar problems when upgrading VS Shell isolated project to VS Shell 2013?
Probably I should wait for Managed Package Framework for Projects for VS2013.
Thanks.
Uros