You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project which I analyze on both Windows and Linux, and it seems like some files are being excluded/ignored from the source files collection when running the analyses on Linux. It works fine with the same inputs on Windows.
Specifically, it seems like any files that have been included in the Compile item group with an absolute path are ignored on Linux.
There are two cases where I need to include files like this: a custom file outside the project directory, used with many projects, and shared projects.
VS adds all items in shared projects in that style. Apart from that, shared projects seem to work fine.
I believe this is happening because the Csc command line parser treats filepaths of the form "/path/to/item.cs" as an argument instead of a file path, but I'm really not sure.
AnalyzerManagermanager=new AnalyzerManager();ProjectAnalyzeranalyzer= manager.GetProject(@"/path/to/project.csproj");AnalyzerResultsresults= analyzer.Build();string[]sourceFiles= results.First().SourceFiles;// test.cs not included on Linux, but is on Windows
I have a project which I analyze on both Windows and Linux, and it seems like some files are being excluded/ignored from the source files collection when running the analyses on Linux. It works fine with the same inputs on Windows.
Specifically, it seems like any files that have been included in the
Compile
item group with an absolute path are ignored on Linux.Example:
<Compile Include="$(MSBuildThisFileDirectory)Item.cs" />
There are two cases where I need to include files like this: a custom file outside the project directory, used with many projects, and shared projects.
VS adds all items in shared projects in that style. Apart from that, shared projects seem to work fine.
I believe this is happening because the Csc command line parser treats filepaths of the form "/path/to/item.cs" as an argument instead of a file path, but I'm really not sure.
Project:
This file path resolves to
/path/to/test.cs
Code used to analyze:
FullExampleProject.zip
Thanks!
The text was updated successfully, but these errors were encountered: