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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:41:57+00:00 2026-05-11T05:41:57+00:00

Is there a way to use add-as-link when dragging and dropping source files or

  • 0

Is there a way to use add-as-link when dragging and dropping source files or entire source trees into a C# project?

Currently, dragging a tree of source files onto a C# project will cause Visual Studio to copy all files to mirror tree below my solution file.

This can be avoided with the the add-as-link option as depicted in the picture below. However, it gets tedious for large trees or when some files in a directory are already part of the project.

Screenshot of the add-as-link functionality in Visual Studio http://jaapsuter.com/images/add_cs_file.jpg

I’ve looked in Tools->Options, searched the web, and held various magic key combinations when dragging and dropping, to no avail.

I’m tempted to write a script that just globs my .cs files and runs a regular expression over my .csproj file. I’m aware of NAnt, Premake, and other solutions – but I’d like something lightweight.

  • 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. 2026-05-11T05:41:58+00:00Added an answer on May 11, 2026 at 5:41 am

    What you can also do if you don’t find a solution is bind a directory to your project by hand once and let the project find all .cs files in that directory automatically when it loads.

    This is easily done by changing your MSBuild file in the following way:

    <ItemGroup>   <Compile Include='SomeDirectory\**\*.cs'/> </ItemGroup> 

    This will take all .cs files in SomeDirectory and include them to the project. This is very useful if there are often a lot of files added to the project. However, it may break on some machine adding useless files. That’s why I would only recommend that on an external project that’s not editable in your current workspace.

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

Sidebar

Related Questions

Is there a way to use ArrayList() method to add strings to an array
Is there any way of registering clicks to a callto: link with the use
Is there a way to use PowerShell to view the contents of the GAC?
Is there a way to use the CompiledQuery.Compile method to compile the Expression associated
Is there any way to use server controls in ASP.NET MVC? Specifically I need
Is there a way to use ASP.NET in browsers that javascript is not enabled?
Is there any way to use ActiveRecord calculations while also acquiring relevant field names?
Is there a way to use simple sql queries on ASP MVC without using
Is there a way to use a Cocoa IBOutlet in Python? Or do I
Is there a way to use data from the current context to filter nodes

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.