question

rainbowguy-3883 avatar image
0 Votes"
rainbowguy-3883 asked rainbowguy-3883 edited

Visual Studio 2019 custom database unit test not working SSDT



Hi I am using VS 2019 to try create custom unit tests as in below article:
walkthrough-use-custom-test-condition-to-verify-stored-procedure-results

When I go to my own project however, my custom test is not showing up in the test designer drop down. The code compiles but I have 2 warnings as saying target framework may not be fully compatible for Microsoft.Data.Tools.MSBuild and Microsoft.Data.Tools.UnitTest that i installed from NuGet.

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net5.0</TargetFramework> <SignAssembly>true</SignAssembly> <AssemblyOriginatorKeyFile>SampleKey.pfx</AssemblyOriginatorKeyFile> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.Data.Tools.Msbuild" Version="16.0.62004.28040" /> <PackageReference Include="Microsoft.Data.Tools.UnitTest" Version="16.0.62004.28040" /> < PackageReference Include="System.ComponentModel.Composition" Version="5.0.0" /> </ItemGroup> <ItemGroup> <Reference Include="Microsoft.Data.Tools.Schema.Sql"> <HintPath>..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\Microsoft.Data.Tools.Schema.Sql.dll</HintPath> </Reference> </ItemGroup> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\SSDT\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets" Condition="'$(VisualStudioVersion)' == ''" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets" Condition="'$(VisualStudioVersion)' != ''" /> </Project> >

Any suggestions what I might be missing out please? Thx




sql-server-generalsql-server-transact-sql
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CarrinWu-MSFT avatar image
0 Votes"
CarrinWu-MSFT answered

Hi @rainbowguy-3883,

Your issue is related to Visual Studio, suggest you post your question in Visual Studio Forum. SQL server general tag means the issues are related to SQL server. You can find all products that supported on Q&A forum from this link.


Best regards,
Carrin


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

rainbowguy-3883 avatar image
0 Votes"
rainbowguy-3883 answered rainbowguy-3883 edited

Bit complicated with finding the right forum and tags though.
Ok thanks. Done!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.