Skip to content

Could not find a part of the path TESTSQLPROJ.dll #621

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

Closed
justintoth opened this issue Apr 25, 2025 · 2 comments
Closed

Could not find a part of the path TESTSQLPROJ.dll #621

justintoth opened this issue Apr 25, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@justintoth
Copy link

  • SqlPackage or DacFx Version: 1.0.0
  • .NET Framework (Windows-only) or .NET Core: .NET 8.0.201
  • Environment (local platform and source/target platforms): Windows 11 for ARM in Parallels w/Macbook Pro host

Steps to Reproduce:

  1. Create a new SQL project by running: dotnet new -i Microsoft.Build.Sql.Templates and then dotnet new sqlproj -n TestSqlProj
  2. Open the SQL project in Visual Studio 2022 or 2022 Preview.
  3. Rebuild the project.
  4. Notice the build error:

Rebuild started at 3:13 PM...
------ Rebuild All started: Project: TestSqlProj, Configuration: Debug Any CPU ------
C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /nowarn:NU1701,NU5128,1701,1702,2008 /fullpaths /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\mscorlib.dll" /debug+ /debug:full /optimize- /out:obj\Debug\TestSqlProj.dll /subsystemversion:6.00 /target:library /warnaserror- /utf8output /langversion:7.3 "C:\Users\justintoth\AppData\Local\Temp.NETFramework,Version=v4.7.2.SqlClrAttributes.cs"
Loading project references...
C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Microsoft\VisualStudio\v17.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(544,5): Error: MSB4018: The "SqlBuildTask" task failed unexpectedly.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\MAC\HOME\DOWNLOADS\TEST\TESTSQLPROJ\OBJ\DEBUG\TESTSQLPROJ.DLL'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.Data.Tools.Schema.Sql.SqlClr.AssemblyParser.Process(String filename, IDictionary2 clrToSqlTypes) at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlModelBuilder.AddAssemblyReference(CustomSchemaData customData) at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlModelBuilder.Add(CustomSchemaData customSchemaData) at Microsoft.Data.Tools.Schema.SchemaModel.ModelBuilder.AddOrUpdate(CustomSchemaData customSchemaData) at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.AddOrUpdate(CustomSchemaData customSchemaData) at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.ProcessReferences(TaskLoggingHelper providedLogger, SqlTaskHost host, ErrorManager errors) at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.LoadImpl(ITaskHost providedHost, TaskLoggingHelper providedLogger) at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.Load(ITaskHost providedHost, TaskLoggingHelper providedLogger) at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteLoadTaskHostStep() at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteStep(Func1 step)
at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteTask()
at Microsoft.Data.Tools.Schema.Tasks.Sql.DataTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
Done building project "TestSqlProj.sqlproj" -- FAILED.

Because it's complaining about an obj directory, I tried cleaning in VS as well as manually deleting the bin and obj folders, but the build error persists.

sqlproj file:

<Project DefaultTargets="Build">
  <Sdk Name="Microsoft.Build.Sql" Version="1.0.0" />
  <PropertyGroup>
    <Name>TestSqlProj</Name>
    <DSP>Microsoft.Data.Tools.Schema.Sql.Sql150DatabaseSchemaProvider</DSP>
    <ModelCollation>1033, CI</ModelCollation>
    <TargetDatabaseSet>True</TargetDatabaseSet>
    <ProjectGuid>{c38b164b-e4df-4154-9dcc-70a72f13eb93}</ProjectGuid>
  </PropertyGroup>
</Project>
Image
@justintoth justintoth added the bug Something isn't working label Apr 25, 2025
@zijchen
Copy link
Member

zijchen commented Apr 25, 2025

When the build fails, can you check to see if this file exists, ignoring the upper case? C:\MAC\HOME\DOWNLOADS\TEST\TESTSQLPROJ\OBJ\DEBUG\TESTSQLPROJ.DLL

Can you try with SDK version 2.0.0-preview.1 which no longer creates/requires the DLL assembly?

This may be because of case-sensitive UNIX path despite being run on Windows while technically still on a Mac.

@justintoth
Copy link
Author

I can confirm that version 2.0.0-preview.1 resolves the issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants