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

1.6-Beta5 (and other versions) incompat with old upgraded project #1050

Closed
mcmonkey4eva opened this issue Dec 16, 2016 · 9 comments
Closed
Assignees
Milestone

Comments

@mcmonkey4eva
Copy link

( Moved from https://github.com/dotnet/cli/issues/4999 )

The error has moved a few line numbers but otherwise persists...

Path: C:\Users\mcmonkey\.vscode\extensions\ms-vscode.csharp-1.6.0-beta5\bin\omnisharp\OmniSharp.exe

[WARNING:OmniSharp#MSBuild] Failed to process project file 'c:\Github\FreneticDocs\FreneticDocs.csproj'.
c:\Github\FreneticDocs\FreneticDocs.csproj(1,1)
System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at Microsoft.Build.Shared.FileUtilities.MakeRelative(String basePath, String path)
   at Microsoft.Build.Evaluation.Evaluator`4.ThrowForImportedProjectWithSearchPathsNotFound(ProjectImportPathMatch searchPathMatch, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
   at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
   at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
   at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create(String projectFilePath, String solutionDirectory, ILogger logger, MSBuildOptions options, ICollection`1 diagnostics) in C:\Projects\omnisharp-roslyn\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs:line 108
   at OmniSharp.MSBuild.MSBuildProjectSystem.CreateProjectFileInfo(String projectFilePath) in C:\Projects\omnisharp-roslyn\src\OmniSharp.MSBuild\MSBuildProjectSystem.cs:line 282

For a bit of background, the project was started on a public release of .NET Core CLI (I believe 1.0.0 Preview 2-1), with a project.json file, then upgraded to .NET Core CLI 1.0.0 Preview 5 to .csproj via dotnet migrate.

It's an ASP.NET MVC setup. the Csproj file is posted for the original issue at http://pastebin.com/VBxaXzwA

OS is a standard and regularly updated installation of Windows 10.

dotnet --info:

.NET Command Line Tools (1.0.0-preview5-004232)

Product Information:
 Version:            1.0.0-preview5-004232
 Commit SHA-1 hash:  355b6233cb

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.0-preview5-004232
@DustinCampbell
Copy link
Member

@mcmonkey4eva: I have a couple of questions:

  1. Do you have Visual Studio installed on this machine? If so, which version?
  2. Could you take a look %UserProfile%\.vscode\extensions and see if there is more than one ms-vscode.csharp-* folder?

@DustinCampbell
Copy link
Member

Note that I couldn't reproduce the issue with your project file. I got the following in my OmniSharp log.

Starting OmniSharp server at 12/16/2016, 6:22:42 AM
    Target: c:\Projects\bug-test

OmniSharp server started
    Path: C:\Users\dusti\.vscode\extensions\ms-vscode.csharp-1.6.0-beta5\bin\omnisharp\OmniSharp.exe
    PID: 21668

OmniSharp: -s c:\Projects\bug-test --hostPID 6840 --stdio DotNet:enablePackageRestore=false --encoding utf-8
[INFORMATION:OmniSharp.Startup] Omnisharp server running using Stdio at location 'c:\Projects\bug-test' on host 6840.
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Initializing in c:\Projects\bug-test
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Auto package restore: False
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Update workspace context
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Resolving projects references
[INFORMATION:OmniSharp#MSBuild] MSBuildExtensionsPath environment variable set to C:\Users\dusti\.vscode\extensions\ms-vscode.csharp-1.6.0-beta5\bin\omnisharp\msbuild
[INFORMATION:OmniSharp#MSBuild] MSBUILD_EXE_PATH environment variable set to C:\Users\dusti\.vscode\extensions\ms-vscode.csharp-1.6.0-beta5\bin\omnisharp\msbuild\MSBuild.exe
[INFORMATION:OmniSharp#MSBuild] MSBuildSDKsPath environment variable set to C:\Users\dusti\.vscode\extensions\ms-vscode.csharp-1.6.0-beta5\bin\omnisharp\msbuild\Sdks
[INFORMATION:OmniSharp#MSBuild] No solution files found in 'c:\Projects\bug-test'
[INFORMATION:OmniSharp#MSBuild] Add project: c:\Projects\bug-test\test.csproj
[INFORMATION:OmniSharp#MSBuild] Update project: test
[INFORMATION:OmniSharp.Script.ScriptProjectSystem] Detecting CSX files in 'c:\Projects\bug-test'.
[INFORMATION:OmniSharp.Script.ScriptProjectSystem] Could not find any CSX files
[INFORMATION:OmniSharp.Startup] Configuration finished.

I'll try reproducing the issue by starting with a web project created with Preview2 and then migrating it to Preview 5.

@DustinCampbell
Copy link
Member

No dice. 😞 I did the following:

preview2-3131: dotnet new -t web
preview5-4232: dotnet migrate

Then, I performed a dotnet restore and opened the project in VS Code. I got similar results to what I got with your project.

@DustinCampbell
Copy link
Member

Definitely let me know which versions of Visual Studio you have installed on this machine (if any) when you get a chance.

@DustinCampbell
Copy link
Member

OK. I just took a look at the OmniSharp bits installing in 1.6-beta5, and it looks like it actually has the wrong binaries. My original fix does fix this issue, but the binary does not include it. This was probably just an error in publishing. I should have it fixed soon.

@DustinCampbell
Copy link
Member

I pushed 1.6-beta6 which should fix the problem for real this time.

@DustinCampbell
Copy link
Member

I verified that my fix is properly in 1.6-beta6 this time.

@DustinCampbell DustinCampbell added this to the 1.6 milestone Dec 17, 2016
@DustinCampbell DustinCampbell self-assigned this Dec 17, 2016
@mcmonkey4eva
Copy link
Author

Woo! That did it! Thanks! :)

@DustinCampbell
Copy link
Member

Awesome.

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

No branches or pull requests

2 participants