MSB4019: The imported project "C:\Microsoft.CSharp.targets" was not found.

1,224 views
Skip to first unread message

Frank Schwieterman

unread,
Jan 30, 2012, 4:47:25 PM1/30/12
to DotLess (Less Css for .NET)
When I try to build dotless via psake, I receive error message
"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.". What is the right way to fix this? I'm thinking it may
require I have VS2008 installed (I only have VS2010 installed). $
(MSBuildToolsPath) is not defined, whatever value it should be.

C:\src\dotless [master]> .\psake.ps1 .\default.ps1 build
Executing task, Clean...
Executing task, Init...
1.2.2.0
Generating assembly info file: C:\src\dotless\src\dotless.Core
\Properties\AssemblyInfo.cs
Generating assembly info file: C:\src\dotless\src\dotless.Test
\Properties\AssemblyInfo.cs
Generating assembly info file: C:\src\dotless\src\dotless.Compiler
\Properties\AssemblyInfo.cs


Directory: C:\src\dotless


Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 1/30/2012 1:45 PM build
d---- 1/30/2012 1:45 PM release
Executing task, build...
Microsoft (R) Build Engine Version 2.0.50727.5420
[Microsoft .NET Framework, Version 2.0.50727.5448]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

C:\src\dotless\src\dotless.Compiler\dotless.Compiler.csproj(106,11):
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.
Error: compile failed

Luke Page

unread,
Jan 31, 2012, 7:05:57 AM1/31/12
to dot...@googlegroups.com
Dotless builds and compiles fine without 2008 installed. I just have 2010.

A google search for that error gets this:
http://social.msdn.microsoft.com/Forums/en/msbuild/thread/4c8249db-85ad-4356-9313-5d47411f1a1a

suggesting you need to set MSBuildToolsPath.

I'm sorry I can't remember what steps I took to get the dotless build
working - but I remember I just searched for each error and fixed it -
its all environmental things.

Reply all
Reply to author
Forward
0 new messages