Статус: Сотрудник
Группы: Участники
Зарегистрирован: 20.02.2017(UTC) Сообщений: 216
Сказал(а) «Спасибо»: 4 раз Поблагодарили: 62 раз в 58 постах
|
Автор: user8763945 Здравствуйте! При выполнении инструкций по сборке для Linux, не удается победить ряд ошибок на последнем шаге. Сборка corefx была выполнена успешно (в /opt/corefx). https://github.com/Crypt...lob/master/docs/Linux.mdПроверял пути до сборок System.Security.Cryptography.Pkcs.dll Пробовал переустановить ОС и в очередной раз выполнить инструкцию. Опять застрял на последнем шаге: dotnet build. Ошибки не меняются. Вывод dotnet --info: Цитата:.NET Core SDK (reflecting any global.json): Version: 3.1.300 Commit: b2475c1295
Runtime Environment: OS Name: astra OS Version: 2.12.43 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/3.1.300/
Host (useful for support): Version: 3.1.4 Commit: 0090613580
.NET Core SDKs installed: 3.1.300 [/usr/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App] файл DotnetSampleProject.csproj: Цитата:<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp3.1</TargetFramework> <RuntimeFrameworkVersion>3.1.3</RuntimeFrameworkVersion> <RuntimeIdentifier>linux-x64</RuntimeIdentifier> <SelfContained>False</SelfContained> <!--<RuntimeIdentifier>linux-x64</RuntimeIdentifier>--> <!-- make self-contained --> <PackageConflictPreferredPackages>Microsoft.Private.CoreFx.NETCoreApp;runtime.win-x64.Microsoft.Private.CoreFx.NETCoreApp;runtime.linux-x64.Microsoft.Private.CoreFx.NETCoreApp;$(PackageConflictPreferredPackages)</PackageConflictPreferredPackages> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.Private.CoreFx.NETCoreApp" Version="4.7.0-dev.20465.1" /> </ItemGroup> <ItemGroup> <Reference Include="System.Security.Cryptography.Pkcs"> <HintPath>/opt/corefx/artifacts/bin/runtime/netcoreapp-Linux-Debug-x64/System.Security.Cryptography.Pkcs.dll</HintPath> </Reference> <Reference Include="System.Security.Cryptography.Xml"> <HintPath>/opt/corefx/artifacts/bin/runtime/netcoreapp-Linux-Debug-x64/System.Security.Cryptography.Xml.dll</HintPath> </Reference> </ItemGroup> </Project> Если убрать из csproj <SelfContained>False</SelfContained>, то получаю одну ошибку: Цитата:/usr/share/dotnet/sdk/3.1.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(136,5): error NETSDK1067: Self-contained applications are required to use the application host. Either set SelfContained to false or set UseAppHost to true. [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] С приложенным выше csproj получаю вот такие такие ошибки dotnet build: Цитата:/opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(13,30): error CS0234: The type or namespace name 'AssemblyDefaultAliasAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(13,30): error CS0234: The type or namespace name 'AssemblyDefaultAliasAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(14,30): error CS0234: The type or namespace name 'AssemblyMetadataAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(14,30): error CS0234: The type or namespace name 'AssemblyMetadata' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(15,30): error CS0234: The type or namespace name 'AssemblyMetadataAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(15,30): error CS0234: The type or namespace name 'AssemblyMetadata' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(16,30): error CS0234: The type or namespace name 'AssemblyMetadataAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(16,30): error CS0234: The type or namespace name 'AssemblyMetadata' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(17,30): error CS0234: The type or namespace name 'AssemblyCompanyAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(17,30): error CS0234: The type or namespace name 'AssemblyCompanyAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(18,30): error CS0234: The type or namespace name 'AssemblyCopyrightAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(18,30): error CS0234: The type or namespace name 'AssemblyCopyrightAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(19,30): error CS0234: The type or namespace name 'AssemblyDescriptionAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(19,30): error CS0234: The type or namespace name 'AssemblyDescriptionAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(20,30): error CS0234: The type or namespace name 'AssemblyFileVersionAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(20,30): error CS0234: The type or namespace name 'AssemblyFileVersionAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(21,30): error CS0234: The type or namespace name 'AssemblyInformationalVersionAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(21,30): error CS0234: The type or namespace name 'AssemblyInformationalVersionAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(22,30): error CS0234: The type or namespace name 'AssemblyProductAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(22,30): error CS0234: The type or namespace name 'AssemblyProductAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(23,30): error CS0234: The type or namespace name 'AssemblyTitleAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(23,30): error CS0234: The type or namespace name 'AssemblyTitleAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(24,30): error CS0234: The type or namespace name 'AssemblyVersionAttributeAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(24,30): error CS0234: The type or namespace name 'AssemblyVersionAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?) [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(13,60): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(14,47): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(14,72): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(15,47): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(15,62): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(16,47): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(16,62): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(17,55): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(18,57): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(19,59): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(20,59): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(21,68): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(22,55): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(23,53): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] /opt/corefx/artifacts/obj/DotnetSampleProject/Debug/linux-x64/DotnetSampleProject.AssemblyInfo.cs(24,55): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(12,11): error CS0518: Predefined type 'System.Object' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(59,26): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(59,16): error CS0518: Predefined type 'System.Void' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(82,24): error CS0518: Predefined type 'System.Void' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(107,35): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(107,16): error CS0518: Predefined type 'System.Void' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(131,33): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(132,13): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(132,36): error CS0518: Predefined type 'System.Object' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(132,36): error CS1069: The type name 'AsymmetricAlgorithm' could not be found in the namespace 'System.Security.Cryptography'. This type has been forwarded to assembly 'System.Security.Cryptography.Primitives, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly. [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(133,13): error CS0518: Predefined type 'System.Object' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(133,13): error CS1069: The type name 'X509Certificate' could not be found in the namespace 'System.Security.Cryptography.X509Certificates'. This type has been forwarded to assembly 'System.Security.Cryptography.X509Certificates, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly. [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(131,16): error CS0518: Predefined type 'System.Void' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(220,37): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(220,16): error CS0518: Predefined type 'System.Void' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(266,47): error CS0518: Predefined type 'System.String' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(266,25): error CS0518: Predefined type 'System.Byte' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(14,34): error CS0518: Predefined type 'System.Byte' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Program.cs(52,33): error CS0518: Predefined type 'System.Byte' is not defined or imported [/opt/corefx/DotnetCoreSampleProject/DotnetSampleProject.csproj] Подскажите пожалуйста - <SelfContained>False</SelfContained> - однозначно нужно убирать из csproj. Если я правильно понля, ошибка возникает при dotnet publish. - убедитесь, что нигде явно не задаётся UseAppHost = false (например в publish profile) - попробуйте явно указать рантайм при публикации - dotnet publish -r linux-x64. - если предыдущее не помогло - попробовать явно задать <UseAppHost>true</UseAppHost> в csproj (по мотивам https://github.com/dotnet/sdk/issues/2505) |
1 пользователь поблагодарил Артём Макаров за этот пост.
|
|