Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Invalid path when DNX and project dependencies are on a different partition #2596

Closed
victorhurdugaci opened this issue Aug 31, 2015 · 6 comments
Assignees
Milestone

Comments

@victorhurdugaci
Copy link
Contributor

You can reproduce this easily by cloning DNX on a different partition on Windows.
For example, have the OS on C: and dnx cloned on D:

Then run the Bootstrapper functional tests.

Result:

System.NotSupportedException: The given path's format is not supported.
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean c
heckForDuplicates, Boolean needFullPath)
   at System.IO.Path.GetFullPath(String path)
   at Microsoft.Dnx.Runtime.ApplicationHostContext.InitializeCore(ApplicationHostContext context) in D:\aspnet\dnx\src\M
icrosoft.Dnx.Runtime\ApplicationHostContext.cs:line 191
   at Microsoft.Dnx.Runtime.ApplicationHostContext.GetRuntimeLibraries(ApplicationHostContext context, Boolean throwOnIn
validLockFile) in D:\aspnet\dnx\src\Microsoft.Dnx.Runtime\ApplicationHostContext.cs:line 40
   at Microsoft.Dnx.ApplicationHost.DefaultHost.Initialize(RuntimeOptions options, IServiceProvider hostServices, IAssem
blyLoadContextAccessor loadContextAccessor, IFileWatcher fileWatcher) in D:\aspnet\dnx\src\Microsoft.Dnx.ApplicationHost
\DefaultHost.cs:line 115
   at Microsoft.Dnx.ApplicationHost.DefaultHost..ctor(RuntimeOptions options, IServiceProvider hostServices, IAssemblyLo
adContextAccessor loadContextAccessor, IFileWatcher fileWatcher) in D:\aspnet\dnx\src\Microsoft.Dnx.ApplicationHost\Defa
ultHost.cs:line 49
   at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args) in D:\aspnet\dnx\src\Microsoft.Dnx.ApplicationHost\Progr
am.cs:line 56
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider service
Provider) in D:\aspnet\dnx\src\Microsoft.Dnx.Runtime.Sources\Impl\EntryPointExecutor.cs:line 43
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, FrameworkName targetFramework) in D
:\aspnet\dnx\src\Microsoft.Dnx.Host\Bootstrapper.cs:line 100
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework) in D:\aspnet\dnx
\src\Microsoft.Dnx.Host\RuntimeBootstrapper.cs:line 158
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework) in D:\aspnet\dnx\src\
Microsoft.Dnx.Host\RuntimeBootstrapper.cs:line 26

The problem is that the relative path is formed incorrectly when it is on a different partition:

../../../../../../../../D:/aspnet/dnx/src/Microsoft.Dnx.Compilation.Abstractions/project.json

@davidfowl I think this is caused by your change

@davidfowl
Copy link
Member

It's actually a combination of changes. @BrennanConroy Looks like bug in the GetRelativePath logic.

@davidfowl
Copy link
Member

@victorhurdugaci I assume you found this running our tests? Our tests shouldn't be using project references to the dnx. That's something we need to fix but I'm glad it found this bug

@victorhurdugaci
Copy link
Contributor Author

Yes, I ran the tests

@BrennanConroy
Copy link
Member

So should it just resolve to D:/aspnet/dnx/etc...?

@davidfowl
Copy link
Member

Yes

@davidfowl davidfowl changed the title Invalid path when DNX and dependecies are on a different partition Invalid path when DNX and project dependencies are on a different partition Sep 2, 2015
@BrennanConroy
Copy link
Member

8ec9f73

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants