Closed pawlos closed 7 years ago
Hi Pawlos, thanks for reporting this.
A couple of questions, first is your C# project using the old project.json
format or the new .csproj
format? Also, if you navigate to http://localhost:65530/api/il/
do you get a response (you should see the message "pong").
If you go to Help / Toggle Developer Tools then you should see some basic log output, though I'm in the process of improving the logging for the next version.
@JosephWoodward project.json
as it's stated in the issues and also in the description that's the only supported now. The code is actually copied from your blog post (http://josephwoodward.co.uk/2016/12/in-memory-c-sharp-compilation-using-roslyn)
If I navigate to the address I do get the pong
response.
In the developer tools I can see that the server is listening ([Extension Host] Server output: Now listening on: http://localhost:65530) but the network tab does not actually have any requests - I assume there should be one to that address. That's from macOS - I can later check on Windows.
I think I see what the problem is, can you rename your class's filename to Hello (so it matches your type name) and try again please? I ran into this issue the other day where there's a problem if the filename is different to a class in the file.
@JosephWoodward yup. It works if I rename the .cs file to match the type. Is this a requirement/limitation or it's just a bug needed to be resolved?
It's a bug that I found the other day that needs to be resolved.
What's happening is, because VS Code is a text editor it has no concept of a type (just a file), VS Code IL Viewer sends the filename to the background service which locates the type by the filename. I'm going to have to look to see if I can load the file, and parse the type, or use OmniSharp to get the type.
The difficulty/question comes, when there's more than one type in a file - which one do we pick (all of them I suppose)?
I've created an issue for this (https://github.com/JosephWoodward/VSCodeILViewer/issues/12), thanks for reporting it 👍
@JosephWoodward ok, understand now. Thanks for looking into this.
Not a problem @pawlos
I've installed the extension both on macOS and Windows but can't get the extension to produce IL. On macOS there's no output when selecting Inspect IL
on Windows it holds on "Inspecting IL, hold onto your seat belts! ..."
Is there any log I can check to see what's going on and why I can't get the IL code to appear?