1

I think I have various beads on why this may be happening, but I can't quite put all the clues together.

We were building an ASP.NET app in VS 2019 with a nuget dependency (Microsoft.Data.SqlClient.SNI.1.0.19235.1 if it matters). I've used msbuild -t:package and in VS 2019, it would spit out bin\x86 and bin\x64 folders with the DLL from that nuget package. That package step would spit out a zip file and opening that up you can see the x86/x64 folders in there.

We upgraded to VS 2022 and the CPU arch folders are no longer there. I can see them get created in the working directory, but not in the package output.

Nothing in the project has changed. It's set to target "AnyCPU" and Framework 4.6.2. The command we're using to build hasn't changed either. As far as I can tell, it's just the upgrade to VS 2022.

I know VS 2022 is now 64-bit native, so I have a suspicion that's in play here. Any ideas on why those CPU-architecture folders are no longer included in the zip package? And how to get them back in there?

Thanks!

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Chris
  • 443
  • 1
  • 3
  • 14
  • I'm not positive, but this sounds relevant: https://devblogs.microsoft.com/dotnet/msbuild-and-64-bit-visual-studio-2022/#guidance-for-task-nuget-package-owners – Timothy G. Jul 05 '22 at 14:57
  • I have the same issue with a project that uses the sqlite ado.net drivers. When I build the project from VS2022 targeting release, the build process spits the x86/x64 folders with the SQLite.Interop.dll dll inside each. When I do the build using msbuild, it doesn't happen, and I don't understand why. I target Any CPU. – boggy Feb 23 '23 at 17:33

2 Answers2

0

According to your description I make some test, hope it can help you:

  1. Check your Configuration Manager under Build in the menu and add new Platform you need. enter image description here
  2. Build the project in Batch Build under Build in the menu. enter image description here
  3. We can see that .dll files are created in the same path so it will be covered. enter image description here
  4. Open the project file.(Right click on the project and Unload Project then right click again an choose edit project file)
  5. You can see code like this: enter image description here
  6. Change the OutputPath to “bin\x64\Debug\”, ”bin\x64\Release\” and so on.
  7. Reload the project and rebuild the project in Batch Build. enter image description here
  8. About how to Pack multiple platforms into one package you can see this(Pack multiple platforms into one package, using dotnet pack ).
Jingmiao Xu-MSFT
  • 2,076
  • 1
  • 3
  • 10
  • Thanks, but the issue is not a build one. My x64 folders are already created. It's a package issue using the "package" target for MSBuild. I'll look at your link in #8, thanks! – Chris Jul 06 '22 at 15:19
0

If it helps anyone, since my problem was specifically with the SNI.dll not being emitted in the x64/x86 folders, my workaround solution was to upgrade the Microsoft.Data.* libraries to a newer version. The x64/x86 folders are still not emitted, but I now see Microsoft.Data.SqlClient.SNI.x64.dll and Microsoft.Data.SqlClient.SNI.x86.dll files in the root bin folder.

It doesn't answer the original question, but at least it got me moving.

Chris
  • 443
  • 1
  • 3
  • 14