【发布时间】:2015-05-23 16:15:48
【问题描述】:
我在一个项目组中工作,并且正准备使用 git 使用来自 master-branch 的新更新来重新定位我的分支。当 rebase 开始时,它突然崩溃并给我这个错误消息:
The project file could not be loaded. Name cannot
begin with the '<' character, hexadecimal value 0x3C.
Line 173, position 2.
“csproj”文件似乎已损坏。我怎样才能解决这个问题?问题如下:
<ItemGroup>
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\IdentityConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\Startup.Auth.cs" />
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\CategoryController.cs" />
<<<<<<< HEAD
<Compile Include="Controllers\GalleryController.cs" />
=======
<Compile Include="Controllers\CheckoutController.cs" />
>>>>>>> Checkout Works. something wrong with Authorization. No need be logged
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\ManageController.cs" />
<Compile Include="Controllers\PhotoController.cs" />
<Compile Include="Controllers\ShoppingCartController.cs" />
<Compile Include="Controllers\StoreController.cs" />
<Compile Include="Controllers\StoreManagerController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
【问题讨论】:
-
是交互式变基吗?是否可以删除所有与项目相关的文件并重新导入项目? (尝试备份)
-
顺便说一句,csproj 和其他 IDE 相关的文件通常不受版本控制。它们应该被添加到 .gitignore
-
@NickVolynkin 嗨。尝试重新导入项目。没有运气。仍然收到错误消息,并且卡在“rebase 1/2”上。您是说 csproj 不应该在主文件中吗?我应该删除它吗?
-
过了一会儿,我找到了解决方案。事实证明它非常简单。如果您有同样的问题,请查看此:github.com/articles/resolving-a-merge-conflict
-
@NickVolynkin csproj 文件绝对是源代码控制的候选者。
标签: xml git visual-studio rebase csproj