Open davkean opened 5 years ago
Set a breakpoint in https://github.com/dotnet/project-system/blob/master/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/References/DesignTimeAssemblyResolution.cs, this should be returning "mscorlib".
Confirmed that mscorlib
is not coming through from CPS (project.References.OfType<Reference3>()
) for VB projects, only C#.
Grab a binlog of the ResolveAssemblyReferences call that shows it missing, it might be an SDK bug.
Oh, thinking about this a little more - it might not be an SDK bug, it might be our bug. There's a built-in assumption that all references show up in list of references, but VB is probably a little different around this. Legacy doesn't walk references, but goes through the RAR task itself to resolve mscorlib.
Looking at the design time build, RAR doesn't include mscorlib.dll for VB projects. CPS does use the RAR output for references, though it doesn't block on them obviously.
I'm not sure what the fix is here. I can include mscorlib.dll as a reference in a VB design time build, but then we need to block the designer. I also can't see why C# has the reference there during evaluation, but I'm probably not looking in the right spot.
VB build is different, I think IRC it picks it up from the sdk path that is passed to it. We do not want behavior differences between design-time builds and regular builds for inputs into the compiler so adding it during design-time builds will result in that.
The designer is blocked on a design build anyway (that's what the results of the references are from), so that's not the problem.
This requires thought, feel free to throw it to me, I wrote the original one and it needs to be updated to handle this similar to legacy.
The designer is blocked on a design build anyway (that's what the results of the references are from), so that's not the problem.
On my local machine if I add <_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
to DesignTime.targets, then opening the designer works if I wait for the design time build to finish, but if I open it early I still get the error. Is that not because the designer isn't blocked on the design time build?
Yes that's what operation progress is solving.
I'm having the issue right now with Visual Studio 16.4, on a side project that is not an EXE but rather a controls and forms library.
@davidwengier workaround with _ExplicitReference
seems to do the trick, but I don't feel confident going forward with migrating about a hundred legacy VB projects to the new SDK with it.
Can anyone explain what's going on with VB.NET support in MS products right now? Because from the look of it - and I don't mean that as a rant -, it really does feel like it's being slowly put aside... knowing that it "officially" is would at least help me making some though decisions...
I'm with Visual Studio 2022 (17.2.1) and still having this problem (VB only). This is blocking us to move to SDK project in order to begin migration to .NET 6+.
Any news about this issue? Is still happening with 17.3.5.
Still not working with 17.5.1 (as is tagged for 7.6). I didn't get how exactly I should do with <_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
, can you explain better how to do with this workaroud?
workaround that works for me is to add the following in the vbproj
<Target Name="AddAdditionalReferences" BeforeTargets="ResolveAssemblyReferences">
<ItemGroup Condition=" '$(NoStdLib)' != 'true' ">
<_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
</ItemGroup>
</Target>
I had the same problem on net48, solved with the workaround provided by dpvreony. https://github.com/dotnet/project-system/issues/5351#issuecomment-1479499990
I've noticed that the problem does not occour on net481. I didn't understand why I had this problem on a particular project, while on many others WinForms project I didn't have this issue.
Please fix it. Thanks
Visual Studio Version: Version 16.3.0 Preview 3.0 [29221.207.master]
Summary: Cannot launch the designer for Windows Forms for VB projects. The equivalent project for C# works.
Steps to Reproduce:
Expected Behavior: Designer to open
Actual Behavior: