question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slngen target for new style SDK does not work

See original GitHub issue

Running msbuild /t:SlnGen on a new style SDK csproj file does not work. Prompts with error:

Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework                                                                          
Copyright (C) Microsoft Corporation. All rights reserved.                                                                                    
                                                                                                                                             
Build started 29/05/2018 2:33:03 PM.                                                                                                         
Project "C:\Dev\Fx\Main_git\Product\Source\Containers\Container\Container.csproj" on node 1 (SlnGen target(s)).                              
C:\Dev\Fx\Main_git\Product\Source\Containers\Container\Container.csproj : error MSB4057: The target "SlnGen" does not exist in the project.  
Done Building Project "C:\Dev\Fx\Main_git\Product\Source\Containers\Container\Container.csproj" (SlnGen target(s)) -- FAILED.                
                                                                                                                                             
                                                                                                                                             
Build FAILED.                                                                                                                                
                                                                                                                                             
"C:\Dev\Fx\Main_git\Product\Source\Containers\Container\Container.csproj" (SlnGen target) (1) ->                                             
  C:\Dev\Fx\Main_git\Product\Source\Containers\Container\Container.csproj : error MSB4057: The target "SlnGen" does not exist in the project.
                                                                                                                                             
    0 Warning(s)                                                                                                                             
    1 Error(s)                                                                                                                               

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
jeffklcommented, May 30, 2018

The SlnGen target comes from a NuGet package. Did you restore packages first?

msbuild.exe /restore /t:SlnGen

If so, is your code base entirely using PackageReference and did you add <PackageReference Include="SlnGen" /> a common import like Directory.Build.props?

0reactions
jeffklcommented, Aug 20, 2018

Closing this for now, please re-open if you’re still blocked

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions | slngen - Microsoft Open Source
Why is Visual Studio not working with my generated solution files? SlnGen does ... Newer SDK-style projects use the Configurations and Platforms properties:....
Read more >
How to use msbuild to generate a VS .sln file where ...
sln file for the project by running msbuild /t:SlnGen /p:Platform=x64 at the command prompt, and then click build in VS (debug, x64), I...
Read more >
Multi-targeted csproj referencing a vcxproj causes freeze ...
Our multi-targeted SDK-style csproj referencing a vcxproj causes freeze on solution load (solution created w/ slngen). Visual Studiowindows 10.0visual ...
Read more >
Troubleshoot .NET tool usage issues
Discover the common issues when running .NET tools and possible solutions.
Read more >
Setting up a .NET Project in 2021 - Ethan Shea
The project in this post will target .NET 5, C#9.0 and use the .NET 5 SDK. The repository is available on GitHub here....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found