try-convert
try-convert copied to clipboard
try-convert error - No OutputType found in the project file
Console output:-
No OutputType found in the project file '{proj-path}.csproj'. Are you sure your project builds today? {proj-path}.csproj does not have a supported OutputType.
No projects converted.
Please let me know if you want the csproj content. I can share privately
@rmaloo This seems to be a missing OutputType node in the project file's main PropertyGroup; I have this on an older project where it was upgraded e.g.
<PropertyGroup>
<AssemblyName>MyProject</AssemblyName>
<RootNamespace>MyProject</RootNamespace>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
<OutputType>Library</OutputType>
</PropertyGroup>
VS is detect the type automatically some how if it's missing, but will insert it automatically if you toggle between the current type and another value forcing, or you can manually add it to the project file.
In terms of this tool, ProjectRootElementExtensions.GetOutputType
function would need to be enhanced to perform the same magic that VS/MsBuild do to detect the project type if the value is not present.