Repository navigation
Open
Description
Describe the bug
It seems that when you
use the OutDir property, it doesn't copy the files to the correct location, but i ends up in the root folder instead
Target CopySNIFiles:
Building target "CopySNIFiles" completely.
Output file "..\binapp\Microsoft.Data.SqlClient.SNI.arm64.dll" does not exist.
Output file "..\binapp\Microsoft.Data.SqlClient.SNI.arm64.pdb" does not exist.
Output file "..\binapp\Microsoft.Data.SqlClient.SNI.x64.dll" does not exist.
Output file "..\binapp\Microsoft.Data.SqlClient.SNI.x64.pdb" does not exist.
Output file "..\binapp\Microsoft.Data.SqlClient.SNI.x86.dll" does not exist.
Output file "..\binapp\Microsoft.Data.SqlClient.SNI.x86.pdb" does not exist.
Task "Copy"
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.arm64.dll" to "C:\Projects\MSClientNuget\binapp\Microsoft.Data.SqlClient.SNI.arm64.dll".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.arm64.pdb" to "C:\Projects\MSClientNuget\binapp\Microsoft.Data.SqlClient.SNI.arm64.pdb".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.x64.dll" to "C:\Projects\MSClientNuget\binapp\Microsoft.Data.SqlClient.SNI.x64.dll".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.x86.dll" to "C:\Projects\MSClientNuget\binapp\Microsoft.Data.SqlClient.SNI.x86.dll".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.x64.pdb" to "C:\Projects\MSClientNuget\binapp\Microsoft.Data.SqlClient.SNI.x64.pdb".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.x86.pdb" to "C:\Projects\MSClientNuget\binapp\Microsoft.Data.SqlClient.SNI.x86.pdb".
Done executing task "Copy".
Target _CopySNIWebApplicationLegacy:
Task "Copy"
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.arm64.dll" to "C:\bin\Microsoft.Data.SqlClient.SNI.arm64.dll".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.x64.dll" to "C:\bin\Microsoft.Data.SqlClient.SNI.x64.dll".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.x86.dll" to "C:\bin\Microsoft.Data.SqlClient.SNI.x86.dll".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.x86.pdb" to "C:\bin\Microsoft.Data.SqlClient.SNI.x86.pdb".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.x64.pdb" to "C:\bin\Microsoft.Data.SqlClient.SNI.x64.pdb".
Copying file from "C:\Users\xxx\.nuget\packages\microsoft.data.sqlclient.sni\6.0.2\buildTransitive\net462\Microsoft.Data.SqlClient.SNI.arm64.pdb" to "C:\bin\Microsoft.Data.SqlClient.SNI.arm64.pdb".
Done executing task "Copy".
To reproduce
I have attached a solution, which can be used for reproducing the issue
MSClientNuget.zip
Expected behavior
I expect it to end up in the outdir instead of the root folder
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
cheenamalhotra commentedon Jul 30, 2025
@SaxoLigtorn
I cannot reproduce your issue, they all land in the correct folder:
If you continue to face issues, please gather a binlog using '/bl' flag on msbuild command and share with us.
SaxoLigtorn commentedon Jul 30, 2025
If you look at my detailed logs they show, that they are both in the root folder and outdir folder. Did you check your in your c:\ and would your account have permissions to write to that folder. I am running my VS as admin
cheenamalhotra commentedon Jul 31, 2025
Oh, I see now what you mean. I see a 'C:\bin' folder yes. Let me find out what's happening.
SaxoLigtorn commentedon Jul 31, 2025
msbuild.zip in case you need it
tbolon commentedon Jan 30, 2026
We are also impacted by this problem:
It also seems the dll are copied every time, even when the libraries are identical, our build logs are flooded by these messages for each library depending on Microsoft.Data.SqlClient (even transitive). The libraries are also copied to the standard output, even for libraries where the file are not necessary.
tbolon commentedon Jan 30, 2026
To add a hint, there is perhaps simply a condition missing in Microsoft.Data.SqlClient.SNI.targets in Microsoft.Data.SqlClient.SNI package.
See this, line 83 of the latest SNI package:
Condition is missing a test to check if $(WebProjectOutputDir) is set, just like that:
And '$(WebProjectOutputDir)' != ''.It will prevent this target from running for all libraries.
Also the fact that the CopySNIFiles is run each time is a hint that the Inputs/Outputs attributes are not correctly set on the Target:Edit: I can't reproduce this problem locally, so it's possible that something in our build pipeline causes this.
For me the "CopySNIFiles" should results in "Skipping target "CopySNIFiles" because all output files are up-to-date with respect to the input files." in most cases, since the files are identical.
It seems the Incremental Build specification is not applied here, but I don't get why...
priyankatiwari08 commentedon Sep 17, 2026
/triage
github-actions commentedon Sep 17, 2026
🔍 Triage Summary (on-demand re-triage)
), OS Windows (binlog/msbuild logs), and detailed repro attachments (MSClientNuget.zip,msbuild.zip`) are present; SQL Server version is not applicable since this is a build/packaging issue, not a runtime data-access issueArea\Native SNI_PublishedWebsitesfor an ASP.NET Web Application) — sameMicrosoft.Data.SqlClient.SNI.targetscopy-target areaMicrosoft.Data.SqlClient.SNI.targetslogic (specifically theCopySNIFiles/_CopySNIWebApplicationLegacytargets) rather than a version regressionAnalysis
The
Microsoft.Data.SqlClient.SNINuGet package's MSBuild targets copy native SNI binaries both to the project'sOutDir/WebProjectOutputDirand unconditionally toC:in(root), because the_CopySNIWebApplicationLegacytarget inMicrosoft.Data.SqlClient.SNI.targetsappears to be missing a guard for'$(WebProjectOutputDir)' != ''. A follow-up commenter also reports theCopySNIFilestarget re-running (and re-copying/re-logging) on every build even when outputs are already up to date, suggesting the target's Inputs/Outputs are not configured for MSBuild incremental build detection. This is a build/packaging (native SNI targets) issue, not a data-access defect. Severity: P2 — annoying/log-noise and unwanted files in unexpected build output locations, with a workaround (ignore/clean up extra files), but affects multiple users on Windows/.NET Framework builds using the native SNI package.Next Steps
Microsoft.Data.SqlClient.SNI.targetsin theMicrosoft.Data.SqlClient.SNIpackage (native SNI package sources), specifically the_CopySNIWebApplicationLegacytarget's condition — add the missing'$(WebProjectOutputDir)' != ''guard so copying to the legacy web output path is skipped when not applicable.CopySNIFilesre-executes and re-copies identical files on every build instead of being skipped via MSBuild incremental build (Inputs/Outputs attributes may need correction) as suggested by@tbolon's analysis._PublishedWebsites/web application deployment behavior for the same SNI copy targets.MSClientNuget.zip) and the sharedmsbuild.zipbinlog.