-
Notifications
You must be signed in to change notification settings - Fork 16
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
[BUG] C# Devkit CommonAssemblyInfo.cs crash #650
Comments
NOTE: The crash does not affect VSCode in the same way, on Windows VSCode still works properly(in terms of autocomplete and language features, on MacOS none of the features work at all) |
@tmeschter @jasonmalinowski it looks like we're being called to add a file twice (and throwing). Is this potentially an issue on the project system side where the same file is being added twice? |
@dibarbet I would assume this is an issue on the project system side since we try very hard not to send the same file twice. :-) My guess is that the evaluation and design-time builds for CommonAssemblyInfo.cs are giving us different paths (one relative, one full) and we're not able to reconcile them. @iongion Can you tell me more about CommonAssemblyInfo.cs? Is it a checked-in file, or generated by your build process, or both? |
Dropping @jasonmalinowski and "area-roslyn" on the assumption that this is strictly a project system issue. |
Thank you for your quick response, I actually tried with both, only one
generated and then linked with relative paths, or generated in each project
with even different names. In each case the issue remains.
I will attach a sample project with this soon, not at my computer right
now.
|
@tmeschter Yeah, I'd say this is on your side to investigate, at least until you've confirmed it not a simple double add issue. |
Here it is The error log is
Screenshot from VSCode |
The AswesomeApi.zip projects contain items like this: <ItemGroup>
<Compile Include=".\AwesomeApi.AssemblyInfo.cs" />
</ItemGroup> Note the leading ".\" which indicates "in the current directory" much like "..\" would indicate "in the parent directory". There are a couple of interesting things here:
What ends up happening is that at the MSBuild level we have two items with distinct
The Project System converts both items to their full paths, which end up being the same:
It makes the erroneous assumption that because the input items were unique (in that they had different (If the Language Service hadn't thrown the Project System would have caught the almost immediately after when updating its own internal state, where we have a sanity check for duplicates.) The fix here will be to eliminate the assumption that unique |
This was actually fixed for December 2023. |
It seems like this issue hasn't been fixed, and I encountered it in my latest version of VS Code. I searched through all the files in the solution, and it didn't appear that DB_ProductSkcExtend.cs was referenced twice; however, there is an issue where the solution indeed contains two such files, including a case-insensitive match DB_ProductSKCExtend.cs. Strangely, VS treats them as the same file, and double-clicking on either one opens the DB_ProductSKCExtend.cs file, which contains the class DB_ProductSkcExtend.
|
Describe the Issue
I have multiple projects in my solution, there is a single project that has a
CommonAssemblyInfo.cs
that I control through code genereation for CI/CD purposes and code-signing/version aligmented for all the other projects in the solution.In the other projects I reference the file using this kind of setup
Steps To Reproduce
CommonAssemblyInfo.cs
in a certain project (disableGenerateAssemblyInfo
)<Compile Include="..\MainProject\CommonAssemblyInfo.cs" />
Expected Behavior
Not to have the error just like Visual Studio (not VSCode) or the
dotnet build
Environment Information
It happens on every OS and any VSCode version
The text was updated successfully, but these errors were encountered: