-
Notifications
You must be signed in to change notification settings - Fork 263
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
Microsoft.Data.SqlClient.SNI not deployed to _PublishedWebsites for an ASP.NET Web Application #936
Comments
Hi @mbakalov Thanks for the repro. We'll investigate and get back to you soon! |
@cheenamalhotra - thank you for a quick response! I'd worked around this for now by adding the below target to my webapp.csproj: <Target Name="_CopySNIFilesToWebProjectOutputDir"
AfterTargets="CopySNIFiles"
Condition="'$(WebProjectOutputDir)' != ''">
<Copy SourceFiles="@(SNIFiles)"
DestinationFiles="@(SNIFiles -> '$(WebProjectOutputDir)\bin\%(RecursiveDir)%(Filename)%(Extension)')"/>
</Target> It works well enough for my scenario, but looking into the Thanks again! |
I can confirm. I have the exact same issue. |
WOW, I experience the same issue and tried the work around mentioned above and it didnt work. Any tips? |
This workaround works for me. |
For some reason, this is really biting me now. A number of production pushes now have resulted in failures due to this. |
The problem occurs when using VS2022 (msbuild 17) to publish Web Applications using any version of Microsoft.Data.SqlClient, the files are not copied to OBJ folder and then not copied to final target folder. If using VS2019 it works fine, in VS2019 build log we can see:
Lines above doesn't exist in VS2022 build logs. Any updates @cheenamalhotra ? Thanks |
I did find this, and it's at least helped with the situation where IIS express can't deploy because of locked files. |
Any update on this? @poychang 's workaround is not working. The only way I can get it to work is on each device after install, to manually copy and paste the x64 and x86 folders with SNI inside it from the debug in the project files to the application folder for each machine. I need to install this program often enough for this to be a hassle. |
The experience is better in newer versions of Microsoft.Data.SqlClient. Try something newer than 1.x. |
I updated to Microsoft.Data.SqlClient 5.0.0 and Microsoft.Data.SqlClient.SNI 5.0.0 and still the same issue |
I just ran the sample repro project from the original author of this post https://github.com/mbakalov/SqlClientSniRepro1 and upgrade the project from .NET Framework |
@Scott-VentsUS are you able to provide a different repro sample as the one provided from the original author works fine. |
Just came across this issue and I can still reproduce it using the reproduction repo and the VS2022 build toolchain. |
@cheenamalhotra any progress on this issue? Are you waiting for anything? |
Since v2, such files are not copied to folders x64/x86 anymore but directly into bin instead. So if you are upgrading v1, try the app instead of just checking if such folders were created. I have successfully upgraded to v5. It worth checking breaking changes in that link. If sticking to v1, this workaround should get files copied:
|
Background
For ASP.NET Web Applications it is common to build them providing
/p:OutDir=someDir
(or/p:OutputPath=someDir
) parameter and then taking the_PublishedWebsites\WebApp
contents and xcopy-ing them.The custom SNI-deploying targets do support
OutDir
but not for a web app scenario - the SNI .dlls don't get copied to_PublishedWebsites\WebApp\bin
.Steps to reproduce
A repo with a blank ASP.NET Web App and steps to reproduce: https://github.com/mbakalov/SqlClientSniRepro1
To reproduce, in VS command prompt do:
msbuild /t:Build /p:Configuration=Release /p:Platform="Any CPU" Example.sln /p:OutDir=C:\temp\output
The SNI .dlls get copied to
C:\temp\output
, but not toC:\Temp\output\_PublishedWebsites\WebApp\bin
Expected behavior
Expected the SNI .dlls to be copied to the "bin" folder of the published website.
Further technical details
Microsoft.Data.SqlClient version: 2.1.1
.NET target: net461
Related issue: #441
The text was updated successfully, but these errors were encountered: