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

csproj (c#) project to project reference to fsproj (f#) #1567

Closed
mikehaas763 opened this issue Sep 7, 2017 · 8 comments
Closed

csproj (c#) project to project reference to fsproj (f#) #1567

mikehaas763 opened this issue Sep 7, 2017 · 8 comments

Comments

@mikehaas763
Copy link

mikehaas763 commented Sep 7, 2017

Maybe this just is an incomplete part of the sdk as of right now. I have started from latest stable .net core (dotnet cli) 2.0.0. I've created a solution, then an f# lib project and a c# console app. They're both added to the solution. I then used the dotnet cli to add a project to project reference to my C# project, pointing to the F# project. However, I can't import the namespace in my C# file. It just can't find the F# namespace. Should this work?

image

Here's the contents of my csproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <ItemGroup>
    <ProjectReference Include="..\RxStore.Core\RxStore.Core.fsproj" />
  </ItemGroup>

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

</Project>
@nguerrera
Copy link
Contributor

cc @KevinRansom

@DustinCampbell
Copy link
Member

This is dotnet/vscode-csharp#371.

@nguerrera
Copy link
Contributor

@mikehaas763 To confirm what @DustinCampbell said, is this only happening to you in VS Code or also in Visual Studio? Does dotnet build on the command line succeed?

@cyr-l
Copy link

cyr-l commented Sep 21, 2017

Just adding my two cents here, but I do face the same error.

@nguerrera Here is what works fine:

  • Visual Studio 2017
  • Visual Studio for Mac
  • dotnet build

Only VS Code (Omnisharp) is having trouble loading the referenced F# project.

[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        No solution files found in '/Users/cbioley/code/castle-black/src/CastleBlack'
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/cbioley/code/castle-black/src/CastleBlack/CastleBlack.csproj
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        The target "GetTargetPath" does not exist in the project.
/Users/cbioley/code/castle-black/src/CastleBlack/CastleBlack.csproj

[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Update project: CastleBlack
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Found referenced project outside root directory: /Users/cbioley/code/castle-black/src/CastleBlack.F/CastleBlack.F.fsproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/cbioley/code/castle-black/src/CastleBlack.F/CastleBlack.F.fsproj
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        The target "Compile" does not exist in the project.
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file '/Users/cbioley/code/castle-black/src/CastleBlack.F/CastleBlack.F.fsproj'.
/Users/cbioley/code/castle-black/src/CastleBlack.F/CastleBlack.F.fsproj

[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Unable to resolve project reference '/Users/cbioley/code/castle-black/src/CastleBlack.F/CastleBlack.F.fsproj' for 'CastleBlack'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/cbioley/code/castle-black/src/CastleBlack'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Services.WorkspaceHelper
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Startup
        Configuration finished.

@mikehaas763
Copy link
Author

@nguerrera I'll try out my project again this weekend and post back

@cspaniard
Copy link

@mikehaas763 Hi... any updates on this... ? I am having the same problem...

TIA,
David

@an-dr-eas-k
Copy link

I am facing this issue with similar errors, when referencing a managed c++ vcxproj project.

[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Update project: CsProject
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Found referenced project outside root directory: c:\tmp\cpt\vsCodeCppCs\CppProject\CPTCommon.vcxproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: c:\tmp\cpt\vsCodeCppCs\CppProject\CPTCommon.vcxproj

It says: The type or namespace name 'xxx' could not be found (are you missing a using directive or an assembly reference?)

@nguerrera
Copy link
Contributor

Closing as duplicate of dotnet/vscode-csharp#371

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

No branches or pull requests

6 participants