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

Variables in ProjectReference include attribute should be parsed #1377

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

Comments

@ErwinSteffens
Copy link
Contributor

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
Copy link
Member

forki commented Jan 12, 2016

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

@ErwinSteffens
Copy link
Contributor Author

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
Copy link
Member

forki commented Jan 12, 2016

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

@ErwinSteffens
Copy link
Contributor Author

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
Copy link
Contributor Author

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 as completed in ccf8462 Jan 12, 2016
@forki
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants