Variables in ProjectReference include attribute should be parsed #1377

Closed
ErwinSteffens opened this Issue Jan 12, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@ErwinSteffens
Contributor

ErwinSteffens commented Jan 12, 2016

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?

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Jan 12, 2016

Member

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

Member

forki commented Jan 12, 2016

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

@ErwinSteffens

This comment has been minimized.

Show comment
Hide comment
@ErwinSteffens

ErwinSteffens Jan 12, 2016

Contributor

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'.
Contributor

ErwinSteffens commented Jan 12, 2016

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'.
@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Jan 12, 2016

Member

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

Member

forki commented Jan 12, 2016

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

@ErwinSteffens

This comment has been minimized.

Show comment
Hide comment
@ErwinSteffens

ErwinSteffens Jan 12, 2016

Contributor

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
Contributor

ErwinSteffens commented Jan 12, 2016

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
@ErwinSteffens

This comment has been minimized.

Show comment
Hide comment
@ErwinSteffens

ErwinSteffens Jan 12, 2016

Contributor

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
Contributor

ErwinSteffens commented Jan 12, 2016

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

@forki forki closed this in ccf8462 Jan 12, 2016

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Jan 12, 2016

Member

please try with 2.42.4

Member

forki commented Jan 12, 2016

please try with 2.42.4

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