如何修复损坏的csproj文件?

Chr*_*boo 7 xml git rebase csproj visual-studio

我是一个正在研究项目的小组,并且正准备使用git从主分支重新启动我的分支.当rebase启动时,它突然崩溃并给我这个错误消息:

The project file could not be loaded. Name cannot 
begin with the '<' character, hexadecimal value 0x3C.
Line 173, position 2.
Run Code Online (Sandbox Code Playgroud)

"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>
Run Code Online (Sandbox Code Playgroud)

小智 6

只需删除csproj文件中以下文本的类型

*** <<<<<<<<<<<<<<<<

- - - - -矿

'>>>>>>>>>>>>>>>>>>>>> ***

并重新加载项目,它将正常工作。


Lan*_*mes 0

当我想和我的朋友合并一个ASP.NET MVC项目时,我也遇到了这样的问题,问题是当我使用git合并我们的项目时,.csproject的文件有几个差异,所以我无法打开项目;

最后我用sublime打开文件,发现问题是我在项目中添加了几个css样式表,然后修复csproject文件中的合并冲突并打开项目,最后解决项目中的其他冲突。