Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatException: Unrecognized Guid format. #3528

Closed
sigiesec opened this issue Mar 21, 2019 · 5 comments
Closed

FormatException: Unrecognized Guid format. #3528

sigiesec opened this issue Mar 21, 2019 · 5 comments

Comments

@sigiesec
Copy link

Description

When running paket update, I get a FormatException. Paket version is 5.198.0

Expected behavior

Paket update succeeds.

Actual behavior

Paket fails with the following output (with --verbose):

 - Installing for projects
   - paket.references -> [...].csproj
Installing to [...].csproj with ToolsVersion 4
    - Deleting Paket Reference nodes
Performance:
 - Resolver: 5 seconds (1 runs)
    - Runtime: 196 milliseconds
    - Blocked (retrieving package details): 196 milliseconds (3 times)
    - Blocked (retrieving package versions): 5 seconds (2 times)
    - Not Blocked (retrieving package versions): 1 times
 - Disk IO: 4 milliseconds
 - Average Request Time: 722 milliseconds
 - Number of Requests: 6
 - Runtime: 6 seconds
Paket failed with
-> FormatException: Unbekanntes Guid-Format.
   StackTrace:
        bei System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException)
        bei System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)
        bei System.Guid.Parse(String input)
        bei Paket.ProjectFileModule.makePathNode@1380(ProjectFile project, XmlNode node, Boolean referenceOutputAssembly, String path)
        bei Paket.ProjectFileModule.getInterProjectDependencies@1362.GenerateNext(IEnumerable`1& next)
        bei Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
        bei Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
        bei Paket.InstallProcess.dependencies@235-10[a](GroupName groupName, FSharpFunc`2 findDependencies, Dictionary`2 projectCache, Dictionary`2 dependencyGraph, Dictionary`2 referenceFiles, ProjectFile projectFile)
        bei [email protected](ProjectFile projectFile)
        bei Paket.BindingRedirects.applyBindingRedirects@183-6[a](Boolean isFirstGroup, Boolean createNewBindingFiles, Boolean cleanBindingRedirects, IEnumerable`1 allKnownLibNames, FSharpFunc`2 bindingRedirects, ProjectFile projectFile)
        bei Paket.BindingRedirects.applyBindingRedirectsToFolder[a](Boolean isFirstGroup, Boolean createNewBindingFiles, Boolean cleanBindingRedirects, String rootPath, IEnumerable`1 allKnownLibNames, FSharpFunc`2 bindingRedirects)
        bei Paket.InstallProcess.InstallIntoProjects[a](InstallerOptions options, Boolean forceTouch, DependenciesFile dependenciesFile, LockFile lockFile, FSharpList`1 projectsAndReferences, FSharpMap`2 updatedGroups)
        bei Paket.UpdateProcess.SmartInstall(DependenciesFile dependenciesFile, UpdateMode updateMode, UpdaterOptions options)
        bei <StartupCode$Paket-Core>[email protected](Unit unitVar0)

        bei Paket.Utils.RunInLockedAccessMode[a](String lockedFolder, FSharpFunc`2 action)
        bei [email protected](ParseResults`1 results)
        bei Paket.Program.processWithValidationEx$cont@42[a](Boolean silent, FSharpFunc`2 commandF, a result, Unit unitVar)
        bei Paket.Program.processWithValidation[T](Boolean silent, FSharpFunc`2 validateF, FSharpFunc`2 commandF, ParseResults`1 result)
        bei Paket.Program.handleCommand(Boolean silent, Command command)
        bei Paket.Program.main()

In english, the exception message is "Unrecognized Guid format."

I suspect that this refers to a Guid specified in some .csproj file, but there is not enough information to identify the offending file/location. There are more .csproj files than the one mentioned above, and at least in the mentioned one the only Guid entry is

    <ProjectGuid>{29C06D6C-678D-4354-A64A-FE33C6DA974A}</ProjectGuid>

which does not look suspicious.

@sigiesec
Copy link
Author

sigiesec commented Mar 21, 2019

The last time it ran successfully was several months ago, it the meantime a failure occurred before it reached this point, which I only fixed today. The last successful run was using paket 5.156.7

@sigiesec
Copy link
Author

I think I found the cause, there was a project reference without any Guid resp. an empty string, like this:

  <ItemGroup>
    <ProjectReference Include="[...].csproj">
      <Project>
      </Project>
      <Name>[...]</Name>
    </ProjectReference>
  </ItemGroup>

Apparently, the earlier version of paket accepted this, since the file has not changed since the last successful build.

I can add the proper Guid to the project files, but it seems like a regression. At least, a more informative error message should be displayed in such a case.

@forki
Copy link
Member

forki commented Mar 25, 2019

do you have a small repro for me?

@sigiesec
Copy link
Author

I managed to reproduce it with a small example: https://github.com/sigiesec/paket-3528

@forki
Copy link
Member

forki commented Jun 4, 2019

thanks for reporting. Fix is under way

@forki forki closed this as completed in 949a861 Jun 4, 2019
forki added a commit that referenced this issue Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants