-
Notifications
You must be signed in to change notification settings - Fork 678
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
MSBuild does not locate targets for MonoGame #1396
Comments
Hi! Could you provide your OmniSharp Log after opening this project? To display the log, select View->Output to display the Output pane and select "OmniSharp Log" from the drop-down in the top-right corner of the pane. |
Additionally, if you are using a different shell other than bash, could you let us know which one? |
Just give me a couple hours to end $job, and I will give more details. Thanks! |
Yes, I am using Bash.
I do that, in both situations, from the command line: code file.cs / code file.csproj In both situations, the output pane, has a dropdown with only two options, Tasks and Extensions, and both show an empty page. Also, and this might be relevant, when doing 'code file.csproj' code opens the XML file and displays it :-O Thanks |
Would you be willing to provide the project you're using? Note that we don't provide completion for loose .cs files outside of project. |
OK for the loose .cs file. I was not sure, and therefore just mentioned it so you could clarify. Not sure if you need the .csfile only, or everything, so I just uploaded my workdir here: http://eremita.di.uminho.pt/~ambs/TugEngine.tar.gz (it is a monogame project that compiles perfectly well with 'xbuild'). Thank you |
OK. I've updated the title based on what I see on my Mac. I opened your solution and a .cs file. Then, I selected View-Output to display the VS Code Output pane and picked "OmniSharp Log" from the upper-right corner of the Output pane. In here, I see an exception like this:
Do you see something similar? |
Out of curiosity, did this work for you in the past? Or, are you new to VS Code? |
It never worked. I am new using Code (just migrated from Mac - Xamarin to Linux). |
FWIW, I'm trying Ubuntu 16.04 now. |
Hehehe, I imagine it works, as nobody else has complained. But I can't manage to get anything of it. |
We'll see. I'm also using the latest beta of C# for VS Code |
Is there a way to install the beta from code, directly? |
No. You can use the instructions from here: https://github.com/OmniSharp/omnisharp-vscode/wiki/Installing-Beta-Releases. |
I had to apt-get install gtk-sharp3 and MonoGame. After doing that, I can build your project with xbuild. However, I get the same error that I listed above. Do you see the same? |
I do not see any error at all :-( |
After opening the TugEngine folder and a .cs folder, you don't have an OmniSharp Log in View->Output? |
ok, now I have some feedback
|
But still no completion :-) |
Right. That exception above is the reason why. Essentially, it's not finding the MonoGame targets file that's installed. Once it fails to find that, it bails on processing the project further. |
I think the problem so far was I was opening files and not folders (?). So, vscode needs to find data about MonoGame but the installer did not place it in the correct place. |
No, that's unlikely. MSBuild (and xbuild -- now deprecated) have... unconventional ways of locating files. It's more likely that we need to do something in OmniSharp to locate the targets properly. |
ok, I can find that file here: (msbuild or MSBuild -- command not found) |
Yup. OK. Here's a workaround for you. It's not great, but'll get your project working. Add an "omnisharp.json" file to the directory that you're opening in VS Code with the following content: {
"msbuild": {
"MSBuildExtensionsPath": "/usr/lib/mono/xbuild"
}
} Be sure to keep that file in the root folder that you open in VS Code and it should get things working for you. |
Just great. Probably next versions can do that automatically |
Cool. We'll take a look at addressing this in OmniSharp soon. In the meantime, just adding that should fix it for any MonoGame project. |
I would suggest keeping this around for reference while not fixed, but if you would like, be my guest closing it. |
I've got a fix for this in PR here: OmniSharp/omnisharp-roslyn#923. Once it's merged, it'll appear in C# for VS Code once we take a new version of OmniSharp. |
I never realized this was a bug.... I've been constantly just recreating symlinks to folders that contain targets file... well my life is gonna get a whole lot easier :D |
Environment data
dotnet --info
output:VS Code version:
$ code --version
1.11.2
6eaebe3b9c70406d67c97779468c324a7a95db0e
C# Extension version: 1.8.1
Steps to reproduce
I open code with a standard C# hello world project, write 'Console.' and no completion is shown.
Expected behavior
Expected the list of available methods from the System.Console class
Actual behavior
none.
The text was updated successfully, but these errors were encountered: