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
Cannot build VB .NET Core 3 library project without ContextValue #30478
Comments
Am I correct that this means that Visual Studio 16.3.0 Preview 2.0 is broken for VB Core 3.0 Applications? I can't build working libraries anymore. If so it would have been nice to know BEFORE I installed the update. Is there any workaround? |
@paul1956, would the work arounds from the bug description help? That is, add |
Aaargghh! Sorry Paul. @nguerrera where are we at on this? Is the problem in tasks/targets or something we insert in VS? I'm wondering if @paul1956 could uninstall .NET Core 3.0 Preview 8 and reinstall .NET Core3.0 Preview 7, or install a nightly build when this is fixed. @paul1956 We did have to take changes that will result in a take back in .NET Core 3.0 Preview 9 which I expect will be in Visual Studio 16.3 Preview 3. We had to remove several types and the My system because they depend on WinForms and our previous approach of splitting types was shown to be heading for a very solid brick wall. You will still be able to do WinForms in the C# style, but not in the VB style until we get more work in. |
I would recommend the following workaround in .vbproj over trying to move backwards or take a bleeding edge nightly build: <PropertyGroup>
<MyType>Empty</MyType>
</PropertryGroup> |
That said, this should be fixed in Preview 9 daily build that you could get now from https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/3.0.1xx/dotnet-sdk-latest-win-x64.exe |
@cston, @nguerrera <MyType>Empty</MyType> got rid of the errors and allowed the build, MyType=Empty as a constant did not, thanks for the clearer instructions. I have not checked if anything broke in the application. Thanks. |
@paul1956 If you decide to try the nightly build, would you let us know whether this works without the Empty hack in Preview 9. We believe this will work fine, but it would be awesome to have confirmation. |
Closing this issue as we can now build libraries without this type and there are other issues tracking porting missing types for general feature parity. |
@KathleenDollard
Despite the warning(s) all my tests pass and UI application using libraries also runs |
Repro steps
mkdir repro
cd repro
dotnet new classlib --language VB --framework netcoreapp3.0
dotnet build
Expected result
Builds successfully
Actual result
I believe this is coming from https://github.com/dotnet/roslyn/blob/fab7134296816fc80019c60b0f5bef7400cf23ea/src/Compilers/VisualBasic/Portable/Symbols/EmbeddedSymbols/VbMyTemplateText.vb#L355
I suppose there are two fixes:
cc @danmosemsft @cston @KathleenDollard I believe this should be considered blocking for 3.0.
It is possible to work around this by setting VBRuntime=Embed or MyType=Empty in the vbproj, but that is effectively undoing other work that was done for VB in 3.0.
The text was updated successfully, but these errors were encountered: