-
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
Generated files in .csproj projects are not processed #1531
Comments
Does the error go away if you restart VS Code? We simply call MSBuild to return files from the .csproj file, so I would expect the file to be there. |
FWIW, this is working for me. I had to make some tweaks to your repro steps (such as adding the |
In fact, I didn't have to add the Actually, scratch that. That was just OmniSharp lighting the file up because I was editing it. The |
OK. I'm definitely seeing this working just fine. Is there anything missing from your repro steps? |
I'll try again today. I had tried using |
TestConsole.zip |
Would you mind providing your OmniSharp Log after opening the project? To retrieve it, select View->Output from the menu and then choose "OmniSharp Log" from the combo box at the top-right of the Output pane. |
PFA |
Thanks for your prompt response. I think I'm going to need a bit more detail. Could you try setting the |
OmniSharp_debug.zip |
OK. I've been unsuccessful in my attempts to reproduce this problem so far. Here are the steps I went through to try and reproduce the problem on something similar to your set up (which I gleaned from the Logs you provided -- thanks!):
Unfortunately, with these steps, I don't get a squiggle on the code above. In fact, I even tried deleting the Here's the project I used: TestConsole.zip Do you see anything that I might have missed in my repro steps? |
The test.cs file should not directly reside in obj\Debug\netcoreapp1.1, but it should be generated/copied there during the build process. Did you have a look in my test project 'TestConsole.zip' I posted earlier? There I have a file called test.xsd which is transformed to a .cs file in the .csproj. Following your repro steps above I don't get the squiggle either, but using my project I can always see it no matter if I restart VS Code. |
Sorry @tsomogyi. I was following the repro steps that you filed with this issue. I'll take a closer look at the project. |
OK. Sorry that I didn't look more closely at your project earlier. I expected that it would be similar to your repro steps, but it's clearly very different. (In the future, it'd be helpful if the repro steps you provide are a bit closer to what you're actually doing. 😄) The issue here is that OmniSharp uses MSBuild in-proc to build the ResolveAssemblyReferences target (code) with I quickly verified locally that this approach will work, but there are some details that will need to be worked out. |
Thanks for your efforts and sorry for the misleading description - I oversimplified the repro steps and ended up with something different (i.e. not realizing that the simpler scenario works after restarting VS Code). |
No worries! I'm just glad I understand the problem now. FWIW, the simpler scenario works without a restart, which is why I was confused. 😄 |
I'm having the same problem with .net core 2, antlr4 and Linux.
Edit: sorry, adding |
The line Is this bug of the extension fixed in beta versions? |
@asfernandes: Could you file a separate issue with full repro steps and details? My guess is that the same '*.cs' files are appearing twice in your project. Note that the default globs for a .NET Core project should already include *.cs files under |
@DustinCampbell it's redundant with dotnet cli really, but the problem is that without As I understand the problem is the same stated in this ticket. I tested the current beta version and the problem still exist. |
@asfernandes : I just verified the test project that was provided in this issue and the problem reported here does not repro. Could you please file a new issue with a full repro rather than commenting on a closed issue? At the moment, I really need more information to investigate the issue you're experiencing. Thanks! |
Done: #1822 |
Thanks! |
Environment data
dotnet --info
output:VS Code version: 1.12.2
C# Extension version: 1.10.0
Steps to reproduce
namespace TestNs { public class TestClass { } }
var t = new TestNs.TestClass();
<Compile Include="$(IntermediateOutputPath)test.cs" />
Expected behavior
C# IntelliSense should recognize the namespace TestNs.
Actual behavior
In the editor I can see TestNs is underlined with red saying "The type or namespace name 'TestNs' could not be found...".
Remarks
The project builds fine using 'dotnet build'.
The significance of this scenario is that I generate source files using xsd tool, and the generated files go to the intermediate folder.
So the C# tool should either parse the intermediate folder or the extra files added for compilation in the project file - whichever is easier to implement.
The text was updated successfully, but these errors were encountered: