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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:20:14+00:00 2026-06-09T15:20:14+00:00

I have a C# solution for a web project (actually it’s an Orchard CMS

  • 0

I have a C# solution for a web project (actually it’s an Orchard CMS site, but this is not important) that’s version controlled under Mercurial (using Tortoise HG BTW), which has some projects that are in separate repositories (and are subrepositories of the solution repository). Hg files are never included anywhere in the solution, they are nowhere shown in Visual Studio.

When I try to publish the solution (or build the deployment package) with the “Only files needed to run the application” option selected under the web project properties the package built contains the hg files (like the whole .hg folder) of the subrepositories.

This is mostly harmless (besides publishing a bunch of unnecessary files), but publishing can also fail completely with the following message:

Error Copying file SubRepoFolder.hg\store\data_libraries_parallel_extensions_extras_coordination_data_structures_async_coordination_async_reader_writer.cs.i to obj\Release\Package\PackageTmp\SubRepoFolder.hg\store\data_libraries_parallel_extensions_extras_coordination_data_structures_async_coordination_async_reader_writer.cs.i failed. The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

I have no idea what to do next, how to prevent VS from building files that it supposedly doesn’t see. Any help would be greatly appreciated.

  • 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-09T15:20:15+00:00Added an answer on June 9, 2026 at 3:20 pm

    It turns out the fact that this is an Orchard solution is an important fact!

    There’s this line in Orchard.Web.csproj:

    <Target Name="CustomCollectFiles">
    <ItemGroup>
      ...
      <_CustomFiles Include="Media\**\*;App_Data\**\*;Modules\**\*;Themes\**\*;Core\**\*" Exclude="**\obj\**;@(Orchard-Web-Bins -> '**\%(Filename)%(Extension)');**\*.csproj.user;**\*.hg*" />
    

    It’s used to copy files from Orchard-specific folders to the build package. Notice that it’s supposed to exlude Mercurial files and folders, but it isn’t. I changed the line to this:

    <_CustomFiles Include="Media\**\*;App_Data\**\*;Modules\**\*;Themes\**\*;Core\**\*" Exclude="**\obj\**;@(Orchard-Web-Bins -> '**\%(Filename)%(Extension)');**\*.csproj.user;**\.hg\**" />
    

    Note the “*” after .hg. Yes, this took me approximately three hours, walking through every build config option I could find to arrive at this.

    Now this only excludes .hg folders, but not .hg files (like .hgignore or .htags) but I don’t care: those are harmless in contrary to the .hg folders that include a bunch of files.

    This blogpost helped me.

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

Sidebar

Related Questions

I have two projects in my solution. First project is web site (actually web
I have Solution with web site MyProject. I need publish this web site. In
I have searched this web looking for an answer, but it seems that this
I have a solution that contains two projects. One project is an ASP.NET Web
I'd like to have a web project in a solution that is set to
I have a solution called StoreExample It has one web project - StoreExample.Web It
Do you have one solution with the web application project, class libraries, database project
I have two projects in my solution   1- asp.net web project.   2-
I have two projects in my solution... a domain project and MVC3 web project
My project consist of: MVC, WEB API solution. I have generated an ADO.NET entity

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.