Skip to content

Auto-generated program.vb throws exception #1907

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

Closed
singhsarab opened this issue Jan 31, 2019 · 2 comments
Closed

Auto-generated program.vb throws exception #1907

singhsarab opened this issue Jan 31, 2019 · 2 comments
Assignees
Labels

Comments

@singhsarab
Copy link
Contributor

Description

The auto-generated program.vb causes compilation errors if the test code is inside a namespace that starts with Microsoft.

Steps to reproduce

Create a new MSTest Net core project for VB
Rename the Namespace in the UnitTest1.vb to Microsoft.* like:

Imports Microsoft.VisualStudio.TestTools.UnitTesting

Namespace Microsoft.FooBar
    <TestClass>
    Public Class UnitTest1
        <TestMethod>
        Sub TestSub()

        End Sub
    End Class
End Namespace

Expected behavior

The test project should compile without errors

Actual behavior

<ProjectName>.Program.vb(4,2): error BC30002: Type 'Microsoft.VisualStudio.TestPlatform.TestSDKAutoGeneratedCode' is not defined.

@mayankbansal018
Copy link
Contributor

As discussed with @nguerrera , @tmat going forward solution for test projects would be to use <HasRuntimeOutput>true</HasRuntimeOutput> property instead of setting output type to "exe, but , doesn't generate "runtimeconfig.dev.json", which the platform needs to find location of "testhost.dll".
The issue is currently blocked on dotnet/msbuild#1310

@mayankbansal018
Copy link
Contributor

Duplicate of #792

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants