Я только что прошел каждый проект в решении и обновил его до .NET Framework 4.6.1 => 4.7.2, и только один проект не может быть загружен. Когда я пытаюсь перезагрузить проект, он выдает эту ошибку:
3:07 PM Project 'MyProject' load finished with warnings: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1. at (1:1)
3:07 PM Project 'MyProjectEmailService' load failed: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1. C:\Projects\Repo\Source\MyProject\MyProjectEmailService\MyProjectEmailService.csproj at (1:1)
3:07 PM Project 'MyProjectEmailService.Tests' load finished with warnings: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1. at (1:1)
3:07 PM Project 'MyProjectEmailService.Tests' load finished with warnings: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1. at (1:1)
3:08 PM Project 'MyProjectEmailService' load failed: The project file could not be loaded. The 'Project' start tag on line 2 position 2 does not match the end tag of 'Target'. Line 281, position 5. C:\Projects\Repo\Source\MyProject\MyProjectEmailService\MyProjectEmailService.csproj at (281:5)
3:09 PM Project 'MyProjectEmailService' load failed: The project file could not be loaded. The 'Project' start tag on line 2 position 2 does not match the end tag of 'Target'. Line 281, position 5. C:\Projects\Repo\Source\MyProject\MyProjectEmailService\MyProjectEmailService.csproj at (281:5)
Из того, что я могу сказать, похоже, что что-то не так с линией 281 в MyProjectEmailService.csproj
В строке 281 я нахожу </target>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\OctoPack.3.6.1\build\OctoPack.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OctoPack.3.6.1\build\OctoPack.targets'))" />
<Error Condition="!Exists('..\..\packages\Selenium.Firefox.WebDriver.0.23.0\build\Selenium.Firefox.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Selenium.Firefox.WebDriver.0.23.0\build\Selenium.Firefox.WebDriver.targets'))" />
<Error Condition="!Exists('..\..\packages\Selenium.WebDriver.GeckoDriver.0.24.0\build\Selenium.WebDriver.GeckoDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Selenium.WebDriver.GeckoDriver.0.24.0\build\Selenium.WebDriver.GeckoDriver.targets'))" />
</Target>
<Import Project="..\..\packages\OctoPack.3.6.1\build\OctoPack.targets" Condition="Exists('..\..\packages\OctoPack.3.6.1\build\OctoPack.targets')" />
<Import Project="..\..\packages\Selenium.Firefox.WebDriver.0.23.0\build\Selenium.Firefox.WebDriver.targets" Condition="Exists('..\..\packages\Selenium.Firefox.WebDriver.0.23.0\build\Selenium.Firefox.WebDriver.targets')" />
<Import Project="..\..\packages\Selenium.WebDriver.GeckoDriver.0.24.0\build\Selenium.WebDriver.GeckoDriver.targets" Condition="Exists('..\..\packages\Selenium.WebDriver.GeckoDriver.0.24.0\build\Selenium.WebDriver.GeckoDriver.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Вот первые строки файла csproj
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Как я могу это исправить и заставить мой проект загружаться правильно? Кроме того, просто дайте мне знать, если вам нужна дополнительная информация.