Build/Test Issues

SDK-Style SQL Project Support Query

Started by mweller on 1,058 views

Good morning,

Please could you advise whether NCrunch supports building the SQL Project files when using the SDK-style project definitions (the tooling is currently in preview).

Our initial attempts seem to generate the following error:

Scripts\Script.PreDeployment.sql (0, 0): A fatal parser error occurred: Could not find a part of the path 'C:\Users\...\AppData\Local\NCrunch\16940\5\...\Scripts\Script.PreDeployment.sql'..

Looking at the folder, it appears that it doesn't contain any files that are discovered by the folder tree structure. Specifically, referenced files do seem to end up in the folder.

Visual Studio builds the project fine and generates the similar output as the MSBuild version of the SQL project.

Environment:
Visual Studio 2022 (Version 17.14.13)
NCrunch 5.17.0.3

Example project file:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build">
<Sdk Name="Microsoft.Build.Sql" Version="2.0.0-preview.4" />
<PropertyGroup>
<Name>DnaPayments.Authentication.Sql</Name>
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql160DatabaseSchemaProvider</DSP>
<ModelCollation>1033, CI</ModelCollation>
<RootNamespace>MyProject.Sql</RootNamespace>
<AssemblyName>MyProject.Sql</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PreDeploy Include="Scripts\Script.PreDeployment.sql" />
</ItemGroup>
<ItemGroup>
<PostDeploy Include="Scripts\Script.PostDeployment.sql" />
</ItemGroup>
<ItemGroup>
<RefactorLog Include="MyProject.Sql.refactorlog" />
</ItemGroup>
<ItemGroup>
<None Include="MyProject.Sql.publish.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="MyProject.Sql.refactorlog" />
</ItemGroup>
</Project>

Edited

Hi, thanks for posting.

Currently we have no specific support for this project type. However, it might still be possible to get it working.

The project type seems to have its own build item type 'PreDeploy'. NCrunch won't recognise this on its own, but you can probably work around the problem by adding these files to NCrunch's internal list by specifying them using the 'Additional files to include' configuration setting.
Remco wrote:Hi, thanks for posting.

Currently we have no specific support for this project type. However, it might still be possible to get it working.

The project type seems to have its own build item type 'PreDeploy'. NCrunch won't recognise this on its own, but you can probably work around the problem by adding these files to NCrunch's internal list by specifying them using the 'Additional files to include' configuration setting.


Thanks, so using the additional files approach does get it past that point. We end up with other build issues, but that is where it is trying to find the DLL output which doesn't seem to get generated by the build process compared to the MSBuild approach.

I think our best bet at the moment is to disable building that project for now until the Microsoft tooling becomes a bit more refined.

Thanks for the information and your guidance.

Post a reply

Log in to reply.