Open AlexDialga opened 1 year ago
Hi @AlexDialga. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
I tried to reproduce this (https://github.com/drasticactions/MauiRepros/tree/main/TestApp) but it compiles and deploys fine for me. Could you create a repro project that can show this error? Maybe my setup is different than what you tried.
I tried to reproduce this (https://github.com/drasticactions/MauiRepros/tree/main/TestApp) but it compiles and deploys fine for me. Could you create a repro project that can show this error? Maybe my setup is different than what you tried.
Here is a sample for testing the issue: https://github.com/AlexDialga/TestSpaceIssueForMAUI If you try to build "MAUI Common Classes" with "Common Classes", the issue will be appeared. Another problem is that any reference from solution will not appear in "References":
@marcpopMSFT and @ManishJayaswal thoughts on where this issue should be transferred too? It seems like tooling
Is it only failing when referenced from a MAUI Class Library? Given it's a CS error, I'd probably start with dotnet/roslyn. CC @jaredpar who has opinions.
@jasonmalinowski ptal and redirect as appropriate.
I don't imagine this is Roslyn's fault; I'm unable to build the test project though so it's hard to know what's up. I'm getting errors like:
Assets file 'C:\Users\WDAGUtilityAccount\Downloads\TestSpaceIssueForMAUI-master\TestSpaceIssueForMAUI-master\Common Classes\obj\project.assets.json' doesn't have a target for 'net8.0-windows10.0.19041'. Ensure that restore has run and that you have included 'net8.0-windows10.0.19041' in the TargetFrameworks for your project.
That is of course what's in the project file, and if I look in the project.assets.json I see that file too. So seems like something more fundamental is busted. @marcpopMSFT any idea?
@jasonmalinowski if you see errors about the assets file, it typically means that the restore config was different than the build config (ie different TFM or different RID). I didn't look closely at the test project the first time around but I guess I'd assume it's because the Maui common classes csproj has the windows TFM but the other two do not. Not sure how the customer doesn't hit this but you do. @nkolev92 @dsplaisted.
@marcpopMSFT Ah, you pointed out something I misread -- the project.assets.json in this case was the library app, not the MAUI app.
Description
Issue Description:
I encountered an issue in .NET MAUI related to project references when creating a new class library with spaces in its name. The issue seems to cause a build failure with the CS0006 error, indicating that the metadata file could not be found.
Steps to Reproduce:
Expected Behavior:
The .NET MAUI project should be able to reference and build successfully, even if the class library project has spaces in its name.
Actual Behavior:
The build fails with a CS0006 error, stating that the metadata file could not be found.
Environment:
Class Library with space will trigger some errors.
Class Library without space.
Most of the content in this Report was generated by AI
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
8.0.3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response