try-convert icon indicating copy to clipboard operation
try-convert copied to clipboard

try-convert error - No OutputType found in the project file

Open rmaloo opened this issue 4 years ago • 1 comments

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 avatar Feb 23 '21 21:02 rmaloo

@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.

phatcher avatar Oct 16 '21 09:10 phatcher