Devlico.Us
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @devlicious

Derik Whittaker

Thoughts on Software Development, .Net, OOP, Design Patterns and all things cool



NAnt/MSbuild build error MSB4019 -- Missing Targets

I was trying to setup our new build server today and received this error:

error MSB4019: the imported project <Path to .net framework here>\Microsoft.CompactFramework.CSharp.targets was not found.

At first I was a bit confused as to what was going one, how could you not find my targets file?  And of course this was working just fine on my laptop (always works on you machine), but not the build server.

Before I dive into the solution for this, I would like to pause to review what was on the build box.

Environment Overview:

Build Server: Team City
Build Script: NAnt
Build Action: MSBuild
Software Installed: .Net 2.0 SDK, .Net 3.5 SDK, .Net 3.5 Compact Framework SDK, need tools for build.  NO Visual Studio IDE's

Onto the Solution:

Ok, now that we know what the server setup was like, lets get onto the solution.

For what ever reason my build server did not contain any .targets files for the compact framework.    These files are normally found in your c:\Windows\Microsoft.Net\Framework\v3.5 folder, but mine were missing.  The easiest way to fix this issue is to grab these files off of the server/laptop that has them and copy/paste them onto the server that does not.  This worked just fine for me.

Note: My issue was with missing targets for the compact framework, but have heard reports of the same thing happening with other .targets files. 

Hope this helps someone.

Till next time,


Published Sep 19 2008, 07:19 AM by Derik Whittaker
Filed under: ,

Comments

Nick said:

No offense buddy... but ummm... the error was "targets not found in this directory" and the solution was to copy the targets to that directory.

Not exactly a stumper.

# September 19, 2008 11:12 AM

Derik Whittaker said:

@Nick,

Agreed, in hindsight it was not hard.

But in the heat of the moment you do not think straight some times.

# September 19, 2008 11:19 AM

Dan Sniderman said:

I've usually just bit the bullet and installed Visual Studio on the build machine.   I know there are potential licensing issues - but it was for a TFS installation - and I'm pretty sure I read SOMEWHERE that it was legit to do so (I should probably double check that sometime..)

# September 19, 2008 3:18 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Derik Whittaker

Derik is a .Net Developer/Architect specializing in WinForms working out the northern suburbs of Chicago. He is also believer and advocate for Agile development including SCRUM, TDD, CI, etc.

When Derik is not writing code he can be found spending time with his wife and young son, climbing on his bouldering wall, watching sports (mostly baseball), and generally vegging out. Check out Devlicio.us!

Our Sponsors

Red-Gate!