You are not logged in.

#1 2021-11-15 20:57:42

N3k0-san
Member
From: Elsweyr
Registered: 2021-08-14
Posts: 67

Dotnet Framework CLI Build Issue

I have the dotnet runtime and dotnet-sdk installed via the community repo but, when I try to dotnet run a project it gives a .NET framework error:

/usr/share/dotnet/sdk/5.0.205/Microsoft.Common.CurrentVersion.targets(1216,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.

However, the project in question runs fine via mono with a Windows build of the same executable :/
(It was originally a Visual Studio project)

Last edited by N3k0-san (2021-11-19 08:25:17)

Offline

#2 2022-09-15 16:28:30

Phenix0
Member
Registered: 2022-09-15
Posts: 1

Re: Dotnet Framework CLI Build Issue

So I'd like to bring this up again, as I have nearly the exact same issue.

I have a C# .NET project opened in Rider, but when I try to build or run the project, Rider outputs this error:

Microsoft.Common.CurrentVersion.targets(1217, 5): [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

I think the solution could be related to installing .NET Framework 4.7.2 Developer Pack, but I have not found its Linux version. All Microsoft links, downloads and installs are designed for Windows.

FYI, dotnet-host, dotnet-runtime, dotnet-sdk and dotnet-targeting-pack are all installed via pacman.

Here's the "dotnet --info" output:

 > dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.109
 Commit:    58a93139d8

Runtime Environment:
 OS Name:     arch
 OS Version:
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.109/

global.json file:
  Not found

Host:
  Version:      6.0.9
  Architecture: x64
  Commit:       163a63591c

.NET SDKs installed:
  6.0.109 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.NETCore.App 6.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

Would anyone please be so kind as to provide me and the poor soul above, @N3k0-san, with a link to the Linux version of .Net Framework 4.7.2 Developer Pack, or some kind of alternative to it? Unless you can think of a different solution, in which case I'm all ears.

Thank you very much. Please don't be harsh on me, this is my first post =)

@Phenix0
If you want to reply, but don't want to login or register, feel free to contact me at arch-1.4bfcl@8shield.net

Last edited by Phenix0 (2022-09-15 17:12:08)

Offline

#3 2022-09-16 16:02:46

megabytex
Member
Registered: 2022-08-15
Posts: 5

Re: Dotnet Framework CLI Build Issue

Hello, it looks to me that you are mixing up two .NET run-times: The .NET Core (multi-platform) and .NET Framework (Windows only). You installed .NET Core SDK/runtime, but you will need to use Mono in order build/develop that project. Your other option is to convert the project and use dotnet core, but sometimes it is not easy to do the conversion. Rider supports Mono IIRC.

Thanks.

Offline

#4 2023-04-15 18:20:09

pockybum522
Member
Registered: 2023-04-15
Posts: 1

Re: Dotnet Framework CLI Build Issue

I've got a solution for this, it appears to actually be a msbuild issue and not an arch issue.

If you add the following to your .esproj it will override whatever detection is failing in msbuild that is making it look for Framework 4.7.2 instead of .NET 7.0 or whatever version you're using.

This is my entire .esproj, but you should just need

    <FrameworkPathOverride>/snap/dotnet-sdk/current/shared/Microsoft.NETCore.App/7.0.5/mscorlib.dll</FrameworkPathOverride>

added to yours:


```
<Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/0.5.74-alpha">
 
  <PropertyGroup>

    <FrameworkPathOverride>/snap/dotnet-sdk/current/shared/Microsoft.NETCore.App/7.0.5/mscorlib.dll</FrameworkPathOverride> 
    <StartupCommand>set BROWSER=none&amp;&amp;npm start</StartupCommand>
    <JavaScriptTestRoot>src\</JavaScriptTestRoot>
    <JavaScriptTestFramework>Jest</JavaScriptTestFramework>
    <!-- Command to run on project build -->
    <!-- Command to create an optimized build of the project that's ready for publishing -->
    <ProductionBuildCommand>npm run build</ProductionBuildCommand>
    <!-- Folder where production build objects will be placed -->
    <BuildOutputFolder>$(MSBuildProjectDirectory)\build</BuildOutputFolder>
  </PropertyGroup>
</Project>
```

Offline

Board footer

Powered by FluxBB