microsoft / microsoft/vs-solutionpersistence

Custom project types support is broken in slnx

Open
#142 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
213
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Hi,

While I was playing with custom project types, I found this bug. I made a minimal repro: repro.zip.

P.S. You can ignore this rant.

Can Microsoft Business Central AL guys and MSBuild guys meet somehow? Please, it is getting ridiculous - AL side is reinvented the wheel and all multiple times already (ALOPS, NAVERTICAL, ALPACA, AL-GO, us, the list goes on) and we still don't have decent solution compilation like there is in dotnet - just a bunch of powershell scripts and still no package manager/repository after like 6+ years since the inception of AL.

This description was generated by AI.

.slnx vs .sln: Custom Project Type Build Behavior

Repro Steps
  1. Place these files in the same folder:

    • A.sln
    • A.slnx
    • A.alproj
    • AL.Build.targets
  2. Run the following commands from the folder:

    dotnet build A.sln
    dotnet build A.slnx
    

Output
dotnet build A.sln

Good. It actually runs the al.exe.

Restore succeeded with 2 warning(s) in 0,0s
    C:\Users\ernes\Desktop\bad publish repro\Product\repro\A.alproj : warning NU1503: Skipping restore for project 'C:\Users\ernes\Desktop\bad publish repro\Product\repro\A.alproj'. The project file may be invalid or missing targets required for restore. C:\Program Files\dotnet\sdk\10.0.102\NuGet.targets(196,5): warning Unable to find a project to restore!
A failed with 2 error(s) (0,1s)
    EXEC : error AL1001: Source file 'C:\Users\ernes\Desktop\bad publish repro\Product\repro\app.json' could not be found
    C:\Users\ernes\Desktop\bad publish repro\Product\repro\AL.Build.targets(5,5): error MSB3073: The command "al.exe compile /project:"C:\Users\ernes\Desktop\bad publish repro\Product\repro" /out:"C:\Users\ernes\Desktop\bad publish repro\Product\repro\.output\A.app" /packagecachepath:"C:\Users\ernes\Desktop\bad publish repro\Product\repro\..\.alpackages"" exited with code 1.
Build failed with 2 error(s) and 2 warning(s) in 0,3s
dotnet build A.slnx

Bad. It fails to recognize project type.

A.slnx(2,4): error MSB4025:
  The project file could not be loaded. Microsoft.VisualStudio.SolutionPersistence.Model.SolutionException: ProjectType '' not found. (Parameter 'projectTypeName')
  ...
Build failed with 1 error(s) in 0,0s

Summary
  • .sln builds and runs the custom AL project, but fails due to missing app.json (expected for repro).
  • .slnx fails with ProjectType '' not found, even with minimal or custom ProjectTypeDefinition attempts.
  • This demonstrates a gap in .slnx support for custom project types (like .alproj) in the .NET SDK.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Unpack repro.zip and inspect A.sln, A.slnx, A.alproj, and AL.Build.targets. Start by running dotnet build A.sln and dotnet build A.slnx, then trace the .slnx project-type handling that produces ProjectType '' not found. Done means the custom .alproj type is recognized by .slnx and reaches the same build behavior as the .sln repro.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.