You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to open a rather old VS 2008 Unity solution I do get the following error in VSCode and Atom:
[INFO] Starting OmniSharp at 'c:\test\test.sln'...
[INFO] Started OmniSharp from 'c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\jrieken.vscode-omnisharp\bin\omnisharp.cmd' with process id 12448...
[INFORMATION:OmniSharp.Startup] Omnisharp server running using stdio at location 'c:\test' on host 8816.
[INFORMATION:OmniSharp.Dnx.DnxPaths] Using runtime 'c:\test\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1'.
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Scanning 'c:\test' for DNX projects
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] No project.json based projects found
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Loading project from 'c:\test\test.csproj'.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Detecting projects in 'c:\test\test.sln'.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Using toolset 2.0 for c:\test\test.csproj
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in 'c:\test'.
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Could not find any CSX files
[INFORMATION:OmniSharp.Startup] Solution has finished loading
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Using toolset 2.0 for c:\test\test.csproj
[WARNING:OmniSharp.MSBuild.MSBuildProjectSystem] Failed to process project file 'c:\test\test.csproj'.
System.ArgumentException: The parameter 'frameworkName' cannot be an empty string.
Parameter name: frameworkName
at System.Runtime.Versioning.FrameworkName..ctor(String frameworkName)
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create(MSBuildOptions options, ILogger logger, String solutionDirectory, String projectFilePath, ICollection`1 diagnostics)
at OmniSharp.MSBuild.MSBuildProjectSystem.CreateProject(String projectFilePath)
c:\test\test.csproj(0,0)
System.ArgumentException: The parameter 'frameworkName' cannot be an empty string.
Parameter name: frameworkName
at System.Runtime.Versioning.FrameworkName..ctor(String frameworkName)
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create(MSBuildOptions options, ILogger logger, String solutionDirectory, String projectFilePath, ICollection`1 diagnostics)
at OmniSharp.MSBuild.MSBuildProjectSystem.CreateProject(String projectFilePath)
Our MSBuild project/solution support is rather preliminary and does not cater for many scenarios at present. Issue #202 details some of the other issues.
@filipw The gist @pampersrocker linked to seems to contain the relevant .csproj files that are producing the issue (the key line in his fixed version is the addition of the <TargetFrameworkMoniker>...</TargetFrameworkMoniker> line.
When I try to open a rather old VS 2008 Unity solution I do get the following error in VSCode and Atom:
Here's a Gist for the Minimal reproduction case (test.sln and test.csproj, fixed_test.csproj contains the workaround below): https://gist.github.com/pampersrocker/7d38b839eda1d06a4598
I've nailed down the bug to the following line:
https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs#L91 (or the other ones from the other #ifs)
Whats the purpose of the
TargetFrameworkMoniker
?I can get it working when I add a
TargetFrameworkMoniker
into the csproj file, see https://gist.github.com/pampersrocker/7d38b839eda1d06a4598#file-fixed_test-csproj-L14However this should not be needed as msbuild and VS 2008 can parse and build the projects without any problems.
When I create a new ConsoleApplication Project with VS 2015, everything works as expected.
The text was updated successfully, but these errors were encountered: