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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:18:11+00:00 2026-06-14T17:18:11+00:00

In a .NET C# project which uses GIT for source control, I keep getting

  • 0

In a .NET C# project which uses GIT for source control, I keep getting malformed csproj files after rebasing to get the most recently commited code. This is my process:

  1. commit my code
  2. build and run tests
  3. rebase to “get latest”
  4. curse the heavens, as the csproj file is screwed up… AGAIN

Here’s the output on the rebase:

D:\GitHub\AwesomeProject>git rebase master
First, rewinding head to replay your work on top of it...
Applying: added getstatus call
Using index info to reconstruct a base tree...
M       Host/Host.csproj
M       Host/packages.config
M       Trees/Trees.csproj
M       Trees/packages.config
M       UnitTests/UnitTests.csproj
<stdin>:1229: trailing whitespace.
  <!-- To modify your build process, add your task inside one of the targets bel
ow and uncomment it.
warning: 1 line adds whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging UnitTests/UnitTests.csproj
Auto-merging Trees/packages.config
CONFLICT (content): Merge conflict in Trees/packages.config
Auto-merging Trees/Trees.csproj
Auto-merging Host/packages.config
CONFLICT (content): Merge conflict in Host/packages.config
Auto-merging Host/Host.csproj
Failed to merge in the changes.
Patch failed at 0001 added getstatus call

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".

There are conflicts, but as you can see it auto-merged the csproj files, and it did it incorrectly!! The XML of the csprojfile is not valid and the project doesn’t load. Here’s a stripped down verstion of what it looks like:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  ... most of one version the project file
  <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  ... most of the other version the project file
  <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>

Why is this happening? And how can I improve my process to deal with it?

  • 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-14T17:18:12+00:00Added an answer on June 14, 2026 at 5:18 pm

    You may want to use a .gitattributes file to use a slightly different merge driver. I have found that this has helped with mine:

    *.csproj -text merge=union
    *.sln -text merge=union
    

    You can read more about it here to see if there are options you like better.

    You can also tell git to take a little longer thinking about its merges with the patience option like this: (read more here)

    git rebase -s recursive -X patience
    

    The only other thing that I can think of is to make sure that you pull code often so that the merges git has to do are smaller.

    FYI, if you want you can do a rebase on the same line at the same time that you do a pull like this: (and you can still pass in the recursive and patience options the same)

    git pull --rebase origin master
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an ASP.NET MVC project which uses the MarkdownDeep Editor to add
I'm trying to add a navigational menu for my project which uses the ASP.NET
I have a C# project A which uses a .net wrapper DLL and a
I'm working on a project which uses the following technologies: C# (.NET 4.0) WCF
Working on an ASP.NET 4.0 project, which uses user controls to dynamically generate a
I have Visual Studio .Net project which uses ADO connection to call stored procedure
I'm looking at working on a project which uses C#.NET (sitting on a windows
So I am working on a project which uses ASP.NET. I am trying to
I have a VB.net project which uses a background worker to do some stuff.
I have a maintenance project which uses Authorize.Net for payment. Currently, the system provides

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.