VS2005 Language service in VS2008
I have developed a language service for VS2005. I try to use it in VS2008.
Everything is fine. I can create a new project, type in some code, compile
it and run it.
I can add a C# project to my solution and everything is still fine.
But, as soon as I add a reference from the project written in my language
(so, a VS2005 SDK language service used in VS 2008), I can not rebuild the
solution because the C# project does not compile anymore:
error MSB4019: The imported project "C:\Microsoft.CSharp.targets" was not
found. Confirm that the path in the <Import> declaration is correct, and that
the file exists on disk.
But, if I try to compile it alone, it compiles. So, it does not compile if I
compile it with my own language project.
Note that I try it in a virtual machine on Vista/VS2008 only, so there are
no VS2005.
It seems it is about $(MSBuildToolsPath) the is used in the <import>.
What can I do? Do I need a specific .vstemplates for VS2008? do I need a
specific .targets for my own language or both?
---------------------------------------------
I can provide some information that can be helpful:
1. I can compile my project with MSBuild within a VS2008 command prompt.
Everything is fine.
2. I'm still unable to compile the whole solution from VS2008, nor my own
language project.
3. I added some <Message> in MSBuild. It seems MSBuild v3.5 is used when run
from command line, but MSBuild 2.0 is used when compiled from VS2008. If I
compile the C# Project in my test solution only, it uses MSBuild 3.5. If I
compile my own language project, it compiles with MSBuild 2.0.
4. If I change a file of the C# project and I try to recompile the solution,
it compiles well the C# program with MSBuild 3.5, but it fails when searching
for referenced C# project output.
5. If I change my code to use MSBuild 3.5 instead of 2.0, it produces
another error:
Target "SplitProjectReferencesByType" in project "UnitTestLibrary1.tsproj"
C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1007,13):
error MSB4067: The element <_ProjectReferenceWithConfiguration> beneath
element <ItemGroup> is unrecognized.
Done building project "UnitTestLibrary1.tsproj" -- FAILED.
Build FAILED.
======= RebuildAll: 1 succeeded, 1 failed, 0 skipped =======
In all these cases, I run VS2008 and VS2008 command prompt as an
administrator in a Vista Virtual Machine.
Thanks.
date: Tue, 1 Jul 2008 11:25:00 -0700
author: Ludovic Dubois Ludovic