Open futuremotiondev opened 1 year ago
@visusys - As a workaround, you can try adding mscorlib as a reference per below. This removes the warning immediately.
Can you advise if this helps? There's a lot of good questions in this post which I will help to research the answers for 👍
Describe the bug
When I create a new PowerShell Windows Forms project (Using the Powershell Pro Tools Template) and then load it later, I am getting the following error message:
The additional columns in the error:
After reading a bunch of other posts on StackOverflow about this error (although none I've seen have a reference to the x86 version of mscorlib.dll) it seems that my project isn't technically "AnyCPU" because there is an x86 dependency, which again happens to be mscorlib.dll.
But this doesn't make sense to me - why does this even matter since I'm not actually "compiling" or "building" a project (since it's PowerShell)?
I really want to get to the bottom of this. I also posted a question about this exact problem on StackOverflow to get some more visibility. Here it is.
To Reproduce Steps to reproduce the behavior:
Save the solution/project somewhere, and then close the solution and exit Visual Studio 2022.
Reopen Visual Studio 2022 and then open your solution.
You should now see the error I outlined in the Error List panel on the bottom of the screen:
Expected behavior There should be no error about mscorlib.dll.
Version
Microsoft Visual Studio Community 2022 (64-bit) Version 17.5.0 Powershell Pro Tools Extension: Version 2023.2.0 Operating System: Windows 10 Pro, Version 22H2 Build 19045.2604
Additional context Nothing to add.
Logs
On my computer that directory doesn't exist. But I found a bunch of logs at
C:\Users\[username]\AppData\Roaming\PowerShell Tools for Visual Studio
Here are the last five logs:
Logs.zip
Here is a zip containing the testing solution I created. If you open this in VS2022, you should see the error.
DebugTesting.zip
Any help at all would be great. I hope your team can manage to find and fix this!
Jay