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.13.0-beta4 fails to resolve output dll #1821

Closed
jetersen opened this issue Oct 30, 2017 · 13 comments
Closed

1.13.0-beta4 fails to resolve output dll #1821

jetersen opened this issue Oct 30, 2017 · 13 comments

Comments

@jetersen
Copy link

jetersen commented Oct 30, 2017

Environment data

dotnet --info output:

dotnet --info
.NET Command Line Tools (2.0.2)

Product Information:
 Version:            2.0.2
 Commit SHA-1 hash:  a04b4bf512

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.0.2/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

VS Code version: 1.17.2
C# Extension version: C# 1.13.0-beta4

Steps to reproduce

tbh, I dno 😐

Expected behavior

resolve output file correctly

Actual behavior

Starting OmniSharp server at 10/30/2017, 4:46:09 PM
    Target: /Users/bob/bitbucket/ourapps/bobapp/BOB.sln

OmniSharp server started wth Mono
    Path: /Users/bob/.vscode/extensions/ms-vscode.csharp-1.13.0-beta4/.omnisharp/omnisharp/OmniSharp.exe
    PID: 54944

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 15.0 - "/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin"
            2: StandAlone 15.0 - "/Users/bob/.vscode/extensions/ms-vscode.csharp-1.13.0-beta4/.omnisharp/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 15.0 - "/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin"
            CscToolPath = /Users/bob/.vscode/extensions/ms-vscode.csharp-1.13.0-beta4/.omnisharp/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/bob/bitbucket/ourapps/bobapp'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Found 2 Cake files.
[warn]: OmniSharp.Cake.CakeProjectSystem
        Cake script service not connected. Aborting.
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /Users/bob/bitbucket/ourapps/bobapp
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Detecting projects in '/Users/bob/bitbucket/ourapps/bobapp/BOB.sln'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/bob/bitbucket/ourapps/bobapp/BOB.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/bob/bitbucket/ourapps/bobapp/BOB.iOS/BOB.iOS.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/bob/bitbucket/ourapps/bobapp/BOB.Droid/BOB.Droid.csproj
[warn]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '25' is less than $(TargetFrameworkVersion) 'v8.0'. Using API-26 for ACW compilation.
[warn]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'Widex.BOB, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Widex.BOB.dll'
  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00124] in <93e3fd215cb8496582dc8fb5d19f9914>:0 
  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (System.String fullName, Mono.Cecil.ReaderParameters parameters) [0x00007] in <93e3fd215cb8496582dc8fb5d19f9914>:0 
  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (System.String fullName) [0x00000] in <93e3fd215cb8496582dc8fb5d19f9914>:0 
  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly (System.String fileName) [0x00007] in <93e3fd215cb8496582dc8fb5d19f9914>:0 
  at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res, System.Collections.Generic.ICollection`1[T] jars, System.Collections.Generic.ICollection`1[T] resolvedResourceDirectories, System.Collections.Generic.ICollection`1[T] resolvedAssetDirectories, System.Collections.Generic.ICollection`1[T] resolvedEnvironments) [0x0024c] in <32f51031eaf74a37ae16fa6aad9819c9>:0 
  at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute () [0x000f0] in <32f51031eaf74a37ae16fa6aad9819c9>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in <76dd0031e0df4aa99d9befb4c4585c69>:0 
  at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x0022d] in <76dd0031e0df4aa99d9befb4c4585c69>:0 
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        Could not load assembly 'Widex.BOB, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00124] in <93e3fd215cb8496582dc8fb5d19f9914>:0 
  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (System.String fullName, Mono.Cecil.ReaderParameters parameters) [0x00007] in <93e3fd215cb8496582dc8fb5d19f9914>:0 
  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (System.String fullName) [0x00000] in <93e3fd215cb8496582dc8fb5d19f9914>:0 
  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly (System.String fileName) [0x00007] in <93e3fd215cb8496582dc8fb5d19f9914>:0 
  at Xamarin.Android.Tasks.GetAdditionalResourcesFromAssemblies+<>c__DisplayClass36_0.<Execute>b__1 () [0x000df] in <32f51031eaf74a37ae16fa6aad9819c9>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <ac812cae460544af83bd6cf54c5eee87>:0 
  at System.Threading.Tasks.Task.Execute () [0x00010] in <ac812cae460544af83bd6cf54c5eee87>:0 
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file '/Users/bob/bitbucket/ourapps/bobapp/BOB.Droid/BOB.Droid.csproj'.
/Users/bob/bitbucket/ourapps/bobapp/BOB.Droid/BOB.Droid.csproj

[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/bob/bitbucket/ourapps/bobapp/BOB.iOS.Tests/BOB.iOS.Tests.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/bob/bitbucket/ourapps/bobapp/BOB.UnitTests/BOB.UnitTests.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/bob/bitbucket/ourapps/bobapp/BOB.SoundClassVisualization/BOB.SoundClassVisualization.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Update project: BOB
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Update project: BOB.iOS
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Update project: BOB.iOS.Tests
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Update project: BOB.UnitTests
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Update project: BOB.SoundClassVisualization
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/bob/bitbucket/ourapps/bobapp'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Program
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Program
        Configuration finished.
[info]: OmniSharp.Stdio.Program
        Omnisharp server running using Stdio at location '/Users/bob/bitbucket/ourapps/bobapp' on host 54896.
@DustinCampbell
Copy link
Member

Since the error is coming through Xamarin's Android task, do you need to build first or do anything special?

@jetersen
Copy link
Author

@DustinCampbell project is already built, and I don't know about any special command 😐

@DustinCampbell
Copy link
Member

Does this assembly exist anywhere?

Could not load assembly 'Widex.BOB, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?

@jetersen
Copy link
Author

Very much so :)
Exists under the shared code project, under ./bin/Release/Widex.BOB.dll

@DustinCampbell
Copy link
Member

DustinCampbell commented Oct 30, 2017

Hmmm... I wonder if the problem is that OmniSharp is simply defaulting to "Debug". Could you place the following omnisharp.json file in your repo root and see if anything changes?

{
    "MsBuild": {
        "Configuration": "Release"
    }
}

@DustinCampbell
Copy link
Member

Is there any chance you could share the project? I'd love to get this under the debugger and see what's happening.

@jetersen
Copy link
Author

Wish I could, and I cannot recreate the issue :(

@DustinCampbell
Copy link
Member

@Casz: I assume that this issue is still reproducible for you with the latest version of C# for VS Code (1.13) that was released a couple of days ago?

@DFVSQY
Copy link

DFVSQY commented Nov 10, 2017

@DustinCampbell I reproduce this issue with C# extension 1.13.0.
Follow below step:
1.run "dotnet new console" to create a C# console project.
2.open "program.cs" ,then the issue will reproduce.

I think this issue is caused by 2 msbuild instances, but the C# plugin doesn't locate right one.
The OmniSharp Log:

Starting OmniSharp server at 2017-11-10 17:46:03
    Target: c:\Users\Administrator\Desktop\test

OmniSharp server started
    Path: C:\Users\Administrator\.vscode\extensions\ms-vscode.csharp-1.13.0\.omnisharp\OmniSharp.exe
    PID: 4236

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Visual Studio Professional 2017 15.4.27004.2008 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin"
            2: StandAlone 15.0 - "C:\Users\Administrator\.vscode\extensions\ms-vscode.csharp-1.13.0\.omnisharp\msbuild\15.0\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Professional 2017 15.4.27004.2008 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin"
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'c:\Users\Administrator\Desktop\test'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in c:\Users\Administrator\Desktop\test
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        No solution files found in 'c:\Users\Administrator\Desktop\test'
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: c:\Users\Administrator\Desktop\test\test.csproj
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file 'c:\Users\Administrator\Desktop\test\test.csproj'.
c:\Users\Administrator\Desktop\test\test.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: 找不到指定的 SDK“Microsoft.NET.Sdk”。  c:\Users\Administrator\Desktop\test\test.csproj
   在 Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
   在 Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, Boolean throwOnFileNotExistsError)
   在 Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement)
   在 Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   在 Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   在 Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)
   在 Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
   在 Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
   在 Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings)
   在 Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
   在 Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   在 OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.LoadProject(String filePath, String solutionDirectory, ILogger logger, MSBuildInstance msbuildInstance, MSBuildOptions options, ICollection`1 diagnostics, ImmutableArray`1& targetFrameworks)
   在 OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create(String filePath, String solutionDirectory, ILogger logger, MSBuildInstance msbuildInstance, MSBuildOptions options, ICollection`1 diagnostics)
   在 OmniSharp.MSBuild.MSBuildProjectSystem.LoadProject(String projectFilePath)

[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\Users\Administrator\Desktop\test'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Program
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Program
        Configuration finished.
[info]: OmniSharp.Stdio.Program
        Omnisharp server running using Stdio at location 'c:\Users\Administrator\Desktop\test' on host 2664.

I want to know how can i select the second msbuild instance(StandAlone 15.0 - "C:\Users\Administrator.vscode\extensions\ms-vscode.csharp-1.13.0.omnisharp\msbuild\15.0\Bin") ?

@DFVSQY
Copy link

DFVSQY commented Nov 10, 2017

@DustinCampbell Additionally, i also have installed vs2017 and C# module.

@jetersen
Copy link
Author

@DFVSQY THANKY YOU for finding a way to reproduce 🚀

@DustinCampbell
Copy link
Member

@Casz : This is not the same as the original issue that you filed here. @DFVSQY : it looks like you're encountering in #1849.

@JoeRobich
Copy link
Member

A lot has changed with O# project loading since this issue was opened. If this is still a problem, please open a new issue at https://github.com/OmniSharp/omnisharp-roslyn

@JoeRobich JoeRobich closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2024
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

5 participants