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.

Failed to convert with InvalidProjectFileException

See original GitHub issue

> try-convert.exe -w . -tfm netcoreapp3.1 --no-backup

Microsoft.Build.Exceptions.InvalidProjectFileException: Der SDK-Resolvertyp “WorkloadSdkResolver” konnte nicht geladen werden. Could not load file or assembly ‘System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. Das System kann die angegebene Datei nicht finden. ***.csproj —> System.IO.FileNotFoundException: Could not load file or assembly ‘System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. Das System kann die angegebene Datei nicht finden. File name: ‘System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver…ctor()

Just installed dotnetcore 5.0 release. Is try-convert compatible with this fresh release?

The project file is netframework4.5.1 looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{7288418D-1BB6-46F1-80DC-28AAD6799899}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>***</RootNamespace>
    <AssemblyName>***</AssemblyName>
    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <TargetFrameworkProfile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup>
    <SignAssembly>false</SignAssembly>
  </PropertyGroup>
  <PropertyGroup>
    <AssemblyOriginatorKeyFile>***.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\packages\EntityFramework.6.1.2\lib\net45\EntityFramework.dll</HintPath>
    </Reference>
    <Reference Include="EntityFramework.SqlServer">
      <HintPath>..\..\packages\EntityFramework.6.1.2\lib\net45\EntityFramework.SqlServer.dll</HintPath>
    </Reference>
    <Reference Include="PresentationFramework" />
    <Reference Include="System" />
    <Reference Include="System.ComponentModel.DataAnnotations" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xaml" />
    <Reference Include="WindowsBase" />
  </ItemGroup>
  <ItemGroup>
    <Compile [***] />
  </ItemGroup>
  <ItemGroup>
    <None Include="packages.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cartermpcommented, Nov 11, 2020

It’s more subtle than that, this is the MSBuild being used failing to resolve something (WorkloadSdkResolver) that’s failing now (and did work in the .NET 5 RC). Will need to investigate

0reactions
cartermpcommented, Nov 16, 2020

Fixed by #318, thanks @trivalik

Read more comments on GitHub >

github_iconTop Results From Across the Web

try-convert fails with Microsoft.Build.Exceptions. ...
With version 0.7.157502, running try-convert -w mysolution.sln --force-web-conversion --no-backup gave me this error: Microsoft.Build.
Read more >
upgrade-assistant upgrade sloution - Microsoft Q&A
[Failed] Convert project file to SDK style .NET Runtime .NET Runtime ... InvalidProjectFileException: The imported project "C:\Program ...
Read more >
InvalidProjectFileException: "The SDK 'Microsoft.NET. ...
We have a tool that loads a csproj file with Microsoft.Build.Evaluation.Project . It's been working fine for about a year, until we tried ......
Read more >
Cannot convert EnvDTE.ProjectItem.Object to Microsoft. ...
The exception is: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.
Read more >
GridNode Net 6 - target "Build" does not exist
If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. ... GridNode won't...
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