ModernRonin / ProjectRenamer

Conveniently rename your csproj files
Other
155 stars 14 forks source link

Unhandled exception. InvalidProjectFileException: SolutionParseNestedProjectError #23

Closed garycass closed 3 years ago

garycass commented 3 years ago
Unhandled exception. Microsoft.Build.Exceptions.InvalidProjectFileException: SolutionParseNestedProjectError  C:\Users\gary.cass\source\repos\LOBO\LOBO.sln
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, String resourceName, Object[] args)
   at Microsoft.Build.Construction.ProjectInSolution.GetUniqueProjectName()
   at Microsoft.Build.Construction.SolutionFile.ParseSolution()
   at Microsoft.Build.Construction.SolutionFile.ParseSolutionFile()
   at Microsoft.Build.Construction.SolutionFile.Parse(String solutionFile)
   at ModernRonin.ProjectRenamer.Application.<>c__DisplayClass3_0.<Run>g__findProject|17() in C:\Projects\Github\ProjectRenaming\ModernRonin.ProjectRenamer\Application.cs:line 204
   at ModernRonin.ProjectRenamer.Application.Run() in C:\Projects\Github\ProjectRenaming\ModernRonin.ProjectRenamer\Application.cs:line 27
   at ModernRonin.ProjectRenamer.Program.Main(String[] args) in C:\Projects\Github\ProjectRenaming\ModernRonin.ProjectRenamer\Program.cs:line 92

Solution has four projects. Successfully used the tool to rename one, but second one fails with this error. Very simple project consisting of a number of .cs modules, some of which are in a sub-folder, but this was also the case for the successful one. There is no nested project or solution.

The .csproj file contents are as follows:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup Label="Globals">
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <LangVersion>9.0</LangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Identity.Web" Version="1.8.2" />
    <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
  </ItemGroup>

  <ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
  </ItemGroup>
</Project>

I am using version 2.1.2 of the tool, running on Windows 10.

ModernRonin commented 3 years ago

Hi,

I think this might be the same issue as #24, which I just fixed. Can you please update ProjectRenamer and verify?

If the problem persists with 2.1.3, then I would need the contents of your .sln file, please - because the error actually originates from the parsing of the solution file.

If the problem has gone away, please close the issue :-)

Thanks, MR

garycass commented 3 years ago

All OK following update,

ModernRonin commented 3 years ago

thanks for letting me know!