-
Notifications
You must be signed in to change notification settings - Fork 676
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
Errors when building solution which contains both C# .csproj and F# .fsproj projects. #371
Comments
Hi @jpierson, how are you building the project within VS Code? |
Default msbuild task. I'll try to post the content when I have a chance. On Wed, May 25, 2016, 11:49 AM Dustin Campbell notifications@github.com
|
Sorry, I'm not sure I understand. Do you have a tasks.json set up to build your project within VS Code? Could I see the content of that? |
I'm not sure if this is the same problem that the original author describes, but I'm seeing that intellisense/omnisharp within VS Code doesn't know how to handle a referenced F# project. Please see my sample project here: https://github.com/jp7677/hellocoreclr. Within src I have a c# and an f# project. When opening the c# class that uses the referenced f# project (https://github.com/jp7677/hellocoreclr/blob/master/src/app/GetHelloWorldAction.cs) omnisharp gets to work, but can't resolve the f# class/module. The project builds and runs just fine using "dotnet build"/"dotnet run". This is my project.json (https://github.com/jp7677/hellocoreclr/blob/master/src/app/project.json) where I reference the f# project like:
PS: Thanks a lot for VS Code, its a really cool project! |
@jp7677: That's generally expected (at least if the project isn't built yet), since neither OmniSharp nor the C# Extension for VS Code have any notion of F#. |
Hi @DustinCampbell, thanks for your answer. What do mean by "at least if the project isn't built yet"? Is there a way to give a hint to Omnisharp/C# Extension how to resolve references or to point it to an assembly? Even after building VS Code can't resolve the types coming from the f# project. |
Sorry for not being clear @jp7677. My point was that the C# Extension for VS Code should be able to resolve types from the F# project if it's output is built and on disk. If it doesn't, that's definitely a bug. However, it will not be able to resolve types if the F# project's assembly is not built, like it can with other C# projects. Does that make sense? |
Makes totally sense, thanks @DustinCampbell ;) |
In my case, my C# project references two bin-wrapped libraries, one is an F# library and the other is a C# library. Same results as above. Compiles and executes fine via |
I'm having the same issue. @jp7677 did you ever solved your issue? |
@DustinCampbell anything we can do to help you nail this issue? |
@luisrudge No, unfortunately not, my VS Code still complains with above message. Though would also love to help to get this resolved. |
@DustinCampbell what we can do to help fix this? |
Me too. Repro: open Logary https://github.com/logary/logary and navigate to |
It would seem that it's "just to try to reproduce it" and then PR it. |
I have a pretty good idea what's causing this. I have a plan to fix it, but it'll need to wait until 1.11. |
I'll leave this open until there's a new C# for VS Code beta with this fix. |
I just wanted to let everyone here know that I just released on a new beta of C# for VS Code that should fix this issue: 1.3.0-beta5. You can following these instructions if you're interested in trying it out. |
So excited for this fix! Just tried it out and works perfectly. Thank you so much! |
Awesome! Thanks for confirming. |
@DustinCampbell It works for me too, which is veeeeery cool, thanks! |
Is there a chance to get intelisense from referenced f# projects as well? |
You will need to build the F# projects first. |
That is, build the project and then restart OmniSharp or VS Code. There's future work to watch the metadata output of now C# projects and reload it. |
I just noticed that we didn't have a work item tracking this, so I added OmniSharp/omnisharp-roslyn#1008. |
I am still seeing this behavior -- even with 1.14.0. and after "build the F# projects first." Here is how I reproduce...
add this line code to program.cs:
All the above succeeds on the command line. However, opening in VS Code shows these errors:
I only see the "GetTargetPath" error when I am referencing an F# library from a C# project. I do not see it on a C#-only project. |
Hey @WallaceKelly : Sorry for the delay. Could you file a new issue rather than necro-ing a closed issue? Thanks! |
I see the following error for each .fsproj project referenced by another C# .csproj project.
The text was updated successfully, but these errors were encountered: