Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8000237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:43:44+00:00 2026-06-04T15:43:44+00:00

I have the following code: using System; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace MyTasks {

  • 0

I have the following code:

using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

namespace MyTasks
{
    public class SimpleTask : Task
    {
            public override bool Execute()
            {
                    return true;
            }
    }
}

I have the following MSBuild script:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Target Name="Build">
      <MakeDir Directories= "bin"/>
      <Csc Sources="SimpleTask.cs" References="Microsoft.Build.Utilities,Microsoft.Build.Framework"      TargetType="library"
           OutputAssembly=".\bin\SimpleTask.dll" />
   </Target>
</Project>

It fails with the following message:

broersa@build01:~/task$ xbuild SimpleTask.proj
XBuild Engine Version 2.10.8.1
Mono, Version 2.10.8.1
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.

Build started 5/27/2012 12:08:32 PM.
__________________________________________________
Project "/home/broersa/task/SimpleTask.proj" (default target(s)):
        Target Build:
                Tool /usr/bin/dmcs execution started with arguments:  /out:./bin/SimpleTask.dll SimpleTask.cs /target:library /reference:Microsoft.Build.Utilities,Microsoft.Build.Framework
: error CS0006: Metadata file `Microsoft.Build.Utilities' could not be found
        Task "Csc" execution -- FAILED
        Done building target "Build" in project "/home/broersa/task/SimpleTask.proj".-- FAILED
Done building project "/home/broersa/task/SimpleTask.proj".-- FAILED

Build FAILED.
Errors:

/home/broersa/task/SimpleTask.proj (default targets) ->
(Build target) ->

        : error CS0006: Metadata file `Microsoft.Build.Utilities' could not be found

         0 Warning(s)
         1 Error(s)

Time Elapsed 00:00:00.4351060

Xbuild calls the dmcs compiler but the Microsoft.Build.Utilites assembly has references to .net 2.0 assemblies. When I compile by hand with gmcs (2.0) it works. But I can’t get it working with xbuild.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:43:45+00:00Added an answer on June 4, 2026 at 3:43 pm

    Set the Toolsversion to 2.0 in the Project xml tag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: using System; using System.Diagnostics; using System.IO; using PdfSharp.Pdf.Printing; namespace
I have the following code using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace
I have a DLL with the following code using System.Text; using Microsoft.Win32; using System.Diagnostics;
I have a DLL with the following code using System.Text; using Microsoft.Win32; using System.Diagnostics;
I have the following code: [Thank you Mike Rosenblum!] using System; using Microsoft.Office.Interop.Excel; using
I have extracted the following code from selenium IDE.(c# remote control) using System; using
I have the following code public static byte[] Compress(byte[] CompressMe) { using (MemoryStream ms
I have the following Code and web method: public class RaumklassenHelper { internal static
In my code-behind I have the following in the class: public ObservableCollection<int> ints; Its
I have the following code: using (BinaryReader br = new BinaryReader( File.Open(FILE_PATH, FileMode.Open, FileAccess.ReadWrite)))

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.