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 247413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:15:26+00:00 2026-05-11T21:15:26+00:00

How do I go about compiling a .net 3.5 class library into a dll

  • 0

How do I go about compiling a .net 3.5 class library into a dll with Nant (0.86)?

This is what I have so far:

How do I go about referencing a system dll in the GAC? This line done seem to work.

<include name="System.ComponentModel.DataAnnotations.dll"/>

This is my script:

<?xml version="1.0"?>
<project name="MyCorp.Data" default="all">

  <property name="debug" value="true" />

  <target name="all"/>

  <target name="clean" description="remove all build products">
    <delete dir="build"  if="${directory::exists('build')}" />
  </target>

  <target name="init">
    <mkdir dir="build" />
  </target>

    <target name="compile" 
            depends="init"
            description="compiles the application">
        <csc target="library" output="build\${project::get-name()}.dll" debug="${debug}">
            <sources>
                <include name="src\MyCorp.Data\**\*.cs" />                             
            </sources>
            <references>                        
          <include name="tools\subsonic\subsonic.dll"/>
          <include name="lib\log4net\log4net.dll"/>
          <include name="System.ComponentModel.DataAnnotations.dll"/>
            </references>                        
        </csc>
    </target>

</project>

I got this far by using JP Boodhoos post

  • 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-11T21:15:26+00:00Added an answer on May 11, 2026 at 9:15 pm

    You can’t reference DLLs in the GAC using NAnt (that I know of), you need to have the physical DLL somewhere (e.g. in your project lib folder) and reference it like a normal DLL:

    <include name="lib\System\System.ComponentModel.DataAnnotations.dll"/>
    

    One way to grab a copy of a GAC DLL is to cd to C:\Windows\assembly\GAC_MSIL from a command prompt, and list the contents with dir. This is a hidden GAC directory. If you find the assembly you need, cd into that, and you will find folders for different .NET versions (e.g. 3.5.0.0). cd into the right one and you should find the DLL itself which you can copy out. On my computer I found it at:

    C:\Windows\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\3.5.0.0__31bf3856ad364e35

    I think if you use MSBuild instead of csc you don’t need hard references to GACed DLLs, it will find them for you.

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

Sidebar

Ask A Question

Stats

  • Questions 174k
  • Answers 174k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer foreach (record in recordset) {     if (!(Roles.RoleExists(record["Role"])) {… May 12, 2026 at 2:51 pm
  • Editorial Team
    Editorial Team added an answer Tortoisesvn has its own internal svn libraries and does not… May 12, 2026 at 2:51 pm
  • Editorial Team
    Editorial Team added an answer It is used to ignore the default style of a… May 12, 2026 at 2:51 pm

Related Questions

I'm an asp.net newbie. I have inherited a base of asp.net mvc code and
Are there any 'good' resources for porting a VB.NET winforms application to C#? I'm
I'm converting the header files of a C library to D modules, and was
I have created a dynamic typing system in C in order to create a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.