Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

C# .Net How to retarget application to the .Net Framework one has installed (from console, without Visual Studio)

$
0
0

Someone has sent me a solution with some C# project files in it. I use only the command line interface of dotnet and I haven't got Visual Studio installed because of lack of memory on my computer. When trying to build the solution or just an individidual project file with the command

dotnet build 

I get the following error:

MSBuild version 17.4.1+9a89d02ff for .NET  Determining projects to restore...  Nothing to do. None of the projects specified contain packages to restore.C:\Program Files\dotnet\sdk\7.0.102\Microsoft.Common.CurrentVersion.targets(1229,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.7.2 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [D:\Informatik\NachhilfeInfoUni\C#MohammadTyp\ClientApp034 (2)\ClientApp034\Business.Model\Business.Model.csproj]Build FAILED.C:\Program Files\dotnet\sdk\7.0.102\Microsoft.Common.CurrentVersion.targets(1229,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.7.2 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [D:\Informatik\NachhilfeInfoUni\C#MohammadTyp\ClientApp034 (2)\ClientApp034\Business.Model\Business.Model.csproj]    0 Warning(s)    1 Error(s)Time Elapsed 00:00:00.50

If, possible, I just want to retarget my application and not install anything new. But I would also be happy to be able to download the correct .Net framework preferably with the Command Line (e.g. a command like dotnet upgrade ) Below is the project file. I have already tried just remove the line with the TargetFrameworkVersion. I have also failed figuring out my installed .Net-Framework following this tutorial:Tutorial

Any help is appreciated

<?xml version="1.0" encoding="utf-8"?><Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /><PropertyGroup><Configuration Condition=" '$(Configuration)' == ''">Debug</Configuration><Platform Condition=" '$(Platform)' == ''">AnyCPU</Platform><ProjectGuid>{1F1F9B49-8ED7-4F08-9E82-7E0048581B7A}</ProjectGuid><OutputType>Library</OutputType><AppDesignerFolder>Properties</AppDesignerFolder><RootNamespace>LernCard.Business.Model</RootNamespace><AssemblyName>Business.Model</AssemblyName><TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion><FileAlignment>512</FileAlignment><Deterministic>true</Deterministic></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></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></PropertyGroup><ItemGroup><Reference Include="System" /><Reference Include="System.Core" /><Reference Include="System.Xml.Linq" /><Reference Include="System.Data.DataSetExtensions" /><Reference Include="Microsoft.CSharp" /><Reference Include="System.Data" /><Reference Include="System.Net.Http" /><Reference Include="System.Xml" /></ItemGroup><ItemGroup><Compile Include="BusinessObjects\Card.cs" /><Compile Include="BusinessObjects\CardCollection.cs" /><Compile Include="Properties\AssemblyInfo.cs" /></ItemGroup><ItemGroup /><Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /></Project>

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>