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

The given path's format is not supported #1036

Closed
jmbeach opened this issue Nov 29, 2017 · 10 comments
Closed

The given path's format is not supported #1036

jmbeach opened this issue Nov 29, 2017 · 10 comments
Labels

Comments

@jmbeach
Copy link
Contributor

jmbeach commented Nov 29, 2017

When trying to run Omnisharp:

Omnisharp.exe -p 2000 -s "D:\Path\to\my\soluntion.sln"

I get the error:

{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectSystem","Message":"Detecting projects in 'D:\\Path\\to\\my\\solution.sln'."},"Seq":10,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"ERROR","Name":"OmniSharp.Stdio.Host","Message":"The project system 'OmniSharp.MSBuild.ProjectSystem' threw exception during initialization.\r\nSystem.NotSupportedException: The given path's format is not supported.\r\n   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)\r\n   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)\r\n   at OmniSharp.MSBuild.ProjectSystem.GetProjectPathsFromSolution(String solutionFilePath)\r\n   at OmniSharp.MSBuild.ProjectSystem.Initalize(IConfiguration configuration)\r\n   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost, IConfiguration configuration, ILogger logger)"},"Seq":11,"Type":"event"}

Not sure what's wrong here.

@jmbeach
Copy link
Contributor Author

jmbeach commented Nov 29, 2017

I did realize I was using the stdin executable instead of http like I meant to, but same issue with http.

fail: OmniSharp.Http.Startup[0]
      The project system 'OmniSharp.MSBuild.ProjectSystem' threw exception during initialization.
System.NotSupportedException: The given path's format is not supported.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at OmniSharp.MSBuild.ProjectSystem.GetProjectPathsFromSolution(String solutionFilePath)
   at OmniSharp.MSBuild.ProjectSystem.Initalize(IConfiguration configuration)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost, IConfiguration configuration, ILogger logger)

@filipw
Copy link
Member

filipw commented Nov 30, 2017

what is the path here - I am asking because I think you redacted it out?
You'd get exception like this if you use invalid path i.e. with : or | in the path, so perhaps yours is invalid?

@jmbeach
Copy link
Contributor Author

jmbeach commented Nov 30, 2017

I didn't post the path because it has a customer name in it, but it is in the form "D:\Path\to\my\project.sln". There are no special characters in it unless the ":" in "D:" could cause it. Do I need to have unix paths somehow?

@jmbeach
Copy link
Contributor Author

jmbeach commented Nov 30, 2017

info: OmniSharp.Http.Startup[0]
      Starting OmniSharp on Windows 6.2.9200.0 (x64)
info: OmniSharp.Cake.CakeProjectSystem[0]
      Detecting Cake files in 'D:\Code\Customers\redacted'.
info: OmniSharp.Cake.CakeProjectSystem[0]
      Could not find any Cake files
info: OmniSharp.DotNet.DotNetProjectSystem[0]
      Initializing in D:\Code\Customers\redacted
info: OmniSharp.DotNet.DotNetProjectSystem[0]
      Auto package restore: False
info: OmniSharp.DotNet.DotNetProjectSystem[0]
      Update workspace context
info: OmniSharp.DotNet.DotNetProjectSystem[0]
      Resolving projects references
info: OmniSharp.MSBuild.ProjectSystem[0]
      Detecting projects in 'D:\Code\Customers\redacted'.
fail: OmniSharp.Http.Startup[0]
      The project system 'OmniSharp.MSBuild.ProjectSystem' threw exception during initialization.
System.NotSupportedException: The given path's format is not supported.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at OmniSharp.MSBuild.ProjectSystem.GetProjectPathsFromSolution(String solutionFilePath)
   at OmniSharp.MSBuild.ProjectSystem.Initalize(IConfiguration configuration)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost, IConfiguration configuration, ILogger logger)
info: OmniSharp.Script.ScriptProjectSystem[0]
      Detecting CSX files in 'D:\Code\Customers\redacted'.
info: OmniSharp.Script.ScriptProjectSystem[0]
      Could not find any CSX files
info: OmniSharp.Http.Startup[0]
      Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
info: OmniSharp.Http.Startup[0]
      Configuration finished.
info: OmniSharp.Http.Startup[0]
      Omnisharp server running on port '2000' at location 'D:\Code\Customers\redacted' on host -1.
System.AggregateException: One or more errors occurred. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.NativeMethods.uv_loop_size()
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvLoopHandle.Init(Libuv uv)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelThread.ThreadStart(Object parameter)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.Start(Int32 count)
   at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[TContext](IHttpApplication`1 application)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()
   at OmniSharp.Http.Host.Start()
   at OmniSharp.Http.Program.<>c__DisplayClass0_0.<Main>b__1()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at OmniSharp.HostHelpers.Start(Func`1 action)
---> (Inner Exception #0) System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.NativeMethods.uv_loop_size()
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvLoopHandle.Init(Libuv uv)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelThread.ThreadStart(Object parameter)<---

Press any key to continue . . .

Full output (note there's another issue with libuv, but I think I know what that's about)

@nickspoons
Copy link
Member

@jmbeach If you have a theory about that libuv issue I'd love to hear it, I'm currently struggling with exactly that, after building the latest master. I'm on a 64bit Windows machine so my exe is at ...artifacts\publish\OmniSharp.Http\win7-x64\OmniSharp.exe, and I think it's trying to use a 32 bit libuv for some reason.

Does that sound like what you're experiencing, or is this a different issue?

@jmbeach
Copy link
Contributor Author

jmbeach commented Nov 30, 2017

@nickspoons I got that solved. I had x86 libuv in my PATH environment variable, but I needed x64

Snippet of my PATH:

image

@jmbeach
Copy link
Contributor Author

jmbeach commented Nov 30, 2017

I guess omnisharp-roslyn defaults to building for x64

@nickspoons
Copy link
Member

Ah OK thanks. I don't have it in my path, so I'm not quite sure where omnisharp is getting it from. Thanks anyway.

@jmbeach
Copy link
Contributor Author

jmbeach commented Dec 15, 2017

Found the issue. One of the projects in my solution is an ASP.NET website. When OmniSharp runs the method GetProjectPathsFromSolution in OmniSharp.MsBuild.ProjectSystem.cs, it sees the website's RelativePath as http://localhost:55237.

@filipw
Copy link
Member

filipw commented Mar 1, 2018

This was fixed by #1066 and #1084

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

No branches or pull requests

4 participants