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

  • SEARCH
  • Home
  • 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 6777533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:09:33+00:00 2026-05-26T16:09:33+00:00

I can build my project with the following command… csc /reference:lib\Newtonsoft.Json.dll SomeSourceFile.cs … but

  • 0

I can build my project with the following command…

csc /reference:lib\Newtonsoft.Json.dll SomeSourceFile.cs

… but when I use this command…

msbuild MyProject.csproj

… with the following .csproj file my .dll reference isn’t included. Any thoughts?

<PropertyGroup>
    <AssemblyName>MyAssemblyName</AssemblyName>
    <OutputPath>bin\</OutputPath>
</PropertyGroup>

<ItemGroup>
    <Compile Include="SomeSourceFile.cs" />
</ItemGroup>

<ItemGroup>
    <Reference Include="Newtonsoft.Json">
        <HintPath>lib\Newtonsoft.Json.dll</HintPath>
    </Reference>
</ItemGroup>

<Target Name="Build">
    <MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" />
    <Csc Sources="@(Compile)" OutputAssembly="$(OutputPath)$(AssemblyName).exe" />
</Target>

  • 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-05-26T16:09:34+00:00Added an answer on May 26, 2026 at 4:09 pm

    You didn’t get your Reference group hooked up to the Csc task. Also the references the way you specified could not be used directly inside the task. Tasks that ship with MSBuild include ResolveAssemblyReference, that is able to transform short assembly name and search hints into file paths. You can see how it is used inside c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets.

    Without ResolveAssemblyReference, the simplest thing that you can do is to write it like this:

    <PropertyGroup> 
        <AssemblyName>MyAssemblyName</AssemblyName> 
        <OutputPath>bin\</OutputPath> 
    </PropertyGroup> 
    
    <ItemGroup> 
         <Compile Include="SomeSourceFile.cs" /> 
    </ItemGroup> 
    
    <ItemGroup> 
        <Reference Include="lib\Newtonsoft.Json.dll" />
    </ItemGroup> 
    
    <Target Name="Build"> 
        <MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" /> 
        <Csc Sources="@(Compile)" References="@(Reference)" OutputAssembly="$(OutputPath)$(AssemblyName).exe" /> 
    </Target> 
    

    Notice that Reference item specifies direct path to the referenced assembly.

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

Sidebar

Related Questions

In Delphi 2009, how can I build a project using command line. I tried
My project runs perfectly fine with following commands: C:\project\<project_name>\ant -lib ant\lib -buildfile applications/<sub-project-path>/ant/build.xml deploy
I just found the IUI project on google code where you can build websites
I recently started learning JavaFX. At the moment I can't build any JavaFX project
Can we set the build settings for different targets in the project build settings
really can't understand, how to build correctly project that uses boost.python. I've included boost_(python/thread/system)-mt.
I need to build a online project monitoring system for my project. Can anyone
How can we make our build process (Dev Studio 2005) for a .NET project
I'm trying to perform the following post build step in a VS2008 project: sn.exe
We have a project structure like following: sharedlib (lib-project, containing classes, that are useful

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.