-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
MSBuildWorkspace does not cleanly load VB project on Linux or MacOS #72014
Comments
@JoeRobich I believe that is part of the WinForms VB Runtime not .Net Core, there have been some requests to move it and other parts of the VB Runtime down to Core since it would enable easier access from C# and allow VB code on Linux and Mac, but I have not seen any movement. There is very little in ApplicationBase (120 lines) but ApplicationBase.Info uses reflection on Windows to access Assembly and if you need that more work would be required. |
Joey - please move this to the runtime repo when ready. |
After doing a little more investigation, this isn't an issue for the Runtime or WinForms teams.
So why are we not getting the proper
Options:
cc: @jasonmalinowski & @rainersigwald for thoughts |
Is that TaskItem constructor being called here?
Because if so, it looks like there's another constructor that doesn't do escaping: Can we call that one instead? |
Unfortunately it does call the other constructor which does the escaping. https://github.com/dotnet/msbuild/blob/4c6a5a963ceb38f77af4e57d28669872b616a8dc/src/Utilities/TaskItem.cs#L100 We could create out own ITaskItem implementation to wrap the args and pass it to this constructor. https://github.com/dotnet/msbuild/blob/4c6a5a963ceb38f77af4e57d28669872b616a8dc/src/Utilities/TaskItem.cs#L120-L123 Also, thank you for linking me to where this TaskItem was being created on our end. |
@rainersigwald Any thoughts here? Invoking that copy constructor seems like a possible workaround. |
. . . how on Earth is this the first time that unconditional correction has come up? We should definitely have an API to avoid it. (edit: dotnet/msbuild#11083) I think you're right that the best workaround is a custom ITaskItem--I don't think you'll need to create a |
The TaskItem implementation from MSBuild treats the ItemSpec as file path and tries to normalize the path separators. When running on non-windows machines this means changing '\' to '/'. However this breaks how double quotes are escaped in the compiler args. By using our own implemetation of TaskItem we can use the compiler args as the ItemSpec without any modification. Resolves #72014
Version Used: 4.10 Preview 1
Reported in #69225
Steps to Reproduce:
Expected Behavior:
Project loads without any workspace diagnostics and compilation reports no compiler diagnostics.
Actual Behavior:
Compilation reports "BC30002": Type 'Global.Microsoft.VisualBasic.ApplicationServices.ApplicationBase' is not defined.
The text was updated successfully, but these errors were encountered: