Skip to content

Variables in ProjectReference include attribute should be parsed #1377

Closed

Description

@ErwinSteffens

Paket should parse macro's/variables in the ProjectReference include attribute used. We have the following include path which is not accepted by Paket:

<ProjectReference Include="$(SolutionDir)Subfolder\MyProject\MyProject.csproj">
    <Project>{b5ff0cfe-5699-4b6e-922a-e1f5ea5f948d}</Project>
    <Name>MyProject</Name>
</ProjectReference>

Paket gives the following error when parsing the csproj file:

Unable to parse C:\MySolution\Project1\$(SolutionDir)Subfolder\MyProject\MyProject.csproj:
      Could not find a part of the path 'C:\MySolution\Project1\$(SolutionDir)Subfolder\MyProject\MyProject.csproj'.

For us it is good enough to just resolve the SolutionDir only. When accepted we can try to fix it ourself. Is there already a method which resolves macro's/variables available within the Paket source?

Activity

  1. forki commented on Jan 12, 2016

    @forki
    Member

    can you please run the same command with -v and give the full error message?

  2. ErwinSteffens commented on Jan 12, 2016

    @ErwinSteffens
    ContributorAuthor

    I can include the full log, but I think this is the most important path. I do not get much more error information when using -v:

    Installing to C:\Work\ManagedCodeGit\CrossPoint.Service.CrossConnectServer\CrossPoint.Service.CrossConnectServerProxy\CrossPoint.Library.CrossConnectServerProxy.csproj
        - Deleting Paket Reference nodes
    Unable to parse C:\Work\ManagedCodeGit\CrossPoint.Service.CrossConnectServer\CrossPoint.Database\CrossPoint.Database\$(SolutionDir)CrossPoint.Library.Core\CrossPoint.Framework\CrossPoint.Framework.csproj:
          Could not find a part of the path 'C:\Work\ManagedCodeGit\CrossPoint.Service.CrossConnectServer\CrossPoint.Database\CrossPoint.Database\$(SolutionDir)CrossPoint.Library.Core\CrossPoint.Framework\CrossPoint.Framework.csproj'.
    Unable to parse C:\Work\ManagedCodeGit\CrossPoint.Service.CrossConnectServer\CrossPoint.Database\CrossPoint.Library.Core\CrossPoint.Framework\CrossPoint.Framework.csproj:
          Could not find a part of the path 'C:\Work\ManagedCodeGit\CrossPoint.Service.CrossConnectServer\CrossPoint.Database\CrossPoint.Library.Core\CrossPoint.Framework\CrossPoint.Framework.csproj'.
    
  3. forki commented on Jan 12, 2016

    @forki
    Member

    I was interested in the call stack from where this error is thrown.

  4. ErwinSteffens commented on Jan 12, 2016

    @ErwinSteffens
    ContributorAuthor

    It does not give a stacktrace, only the exception message. This method fails in the ProjectFile.fs on line 1116:

    static member TryLoad(fileName:string) =
        try
            Some(ProjectFile.LoadFromFile(fileName))
        with
        | exn -> 
            traceWarnfn "Unable to parse %s:%s      %s" fileName Environment.NewLine exn.Message
            None
    
  5. ErwinSteffens commented on Jan 12, 2016

    @ErwinSteffens
    ContributorAuthor

    Here is the stacktrace:

    System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Work\ManagedCodeGit\CrossPoint.Database\CrossPoint.DataAccess\$(SolutionDir)CrossPoint.DataAccess.Database\CrossPoint.DataAccess.Database.csproj'.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
       at System.IO.FileInfo.OpenRead()
       at Paket.ProjectFile.LoadFromFile(String fileName) in C:\Probeer\Paket\src\Paket.Core\ProjectFile.fs:line 1113
       at Paket.ProjectFile.TryLoad(String fileName) in C:\Probeer\Paket\src\Paket.Core\ProjectFile.fs:line 1118
    
  6. forki commented on Jan 12, 2016

    @forki
    Member

    please try with 2.42.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions