c# - 无法在archlinux上编译c#.net项目
问题描述
我正在尝试在 Archlinux 上编译和运行 C#.net 项目,该项目是从 Github 克隆的,
我已经安装了两者dotnet-runtime
,dotnet-sdk
正如官方 Arch Wiki 中提到的那样。
dotnet --version
两者的输出dotnet --list-sdks
是3.1.108
。
我已将设置的版本更改TargetFrameworkVersion
为 v3.1.108 以匹配我系统上安装的版本(最初设置为 v4.7.2)。
当我运行时,dotnet run
我收到以下错误:
/usr/share/dotnet/sdk/3.1.108/Microsoft.Common.CurrentVersion.targets(1175,5): error MSB3644: The reference assemblies for .NETFramework,Version=v3.1.108 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application.
我不明白我的设置有什么问题,我该如何修复它并编译项目?
PS:当我创建一个新的控制台项目时,它编译并成功运行(使用单声道);失败的项目是表格。
谢谢你。
编辑:添加 csproj 文件
这是我的 csproj 文件的内容:
<?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>{8002D96E-7055-4D1D-8FA2-5687CA8A217F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>GestionVisite</RootNamespace>
<AssemblyName>GestionVisite</AssemblyName>
<TargetFrameworkVersion>v3.1.108</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="model\Personne.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="model\DB.cs" />
<Compile Include="model\Geometry.cs" />
<Compile Include="model\Helper.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
解决方案
推荐阅读
- android - 如何在自定义视图上使用视图绑定
- azure - 为运行 Docker Compose 的 Linux Vm 添加 Https 支持
- android - 使用 SharedPreferences 而不是 onActivityResult 将对象从一个活动获取到另一个活动是不好的做法吗?
- angular - 如何使用 @asymmetrik/ngx-leaflet 默认选择 baseLayers 和覆盖
- python - 将符号方程解析为 Sympy 函数
- android - 如何将供应商共享库添加到 android ndk 应用程序
- javascript - React 搜索(过滤)功能,给搜索添加参数
- c++ - 如何获取部分 char* 字符串
- controller - 尽管成功运行后事务控制器中的控制器也不会显示
- swift - 过滤项目到部分