Skip to content

Commit 1042b68

Browse files
authored
Merge pull request #847 from nguerrera/remove-rid-requirement
Remove requirement for specifying a RID in desktop exe projects
2 parents 67783a8 + 19732f1 commit 1042b68

38 files changed

+425
-183
lines changed

TestAssets/TestProjects/AllResourcesInSatellite/AllResourcesInSatellite.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>netcoreapp1.0</TargetFrameworks>
5-
<RuntimeIdentifiers>win7-x86</RuntimeIdentifiers>
65
<OutputType>Exe</OutputType>
76
<AssemblyOriginatorKeyFile>test.snk</AssemblyOriginatorKeyFile>
87
<SignAssembly>true</SignAssembly>
@@ -19,7 +18,6 @@
1918
</PropertyGroup>
2019

2120
<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
22-
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
2321
<PublicSign>false</PublicSign>
2422
</PropertyGroup>
2523

TestAssets/TestProjects/DesktopMinusRid/DesktopMinusRid.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net46</TargetFramework>
55
</PropertyGroup>
6+
<PropertyGroup Condition="'$(UseNativeCode)' == 'true'">
7+
<DefineConstants>$(DefineConstants);USE_NATIVE_CODE</DefineConstants>
8+
</PropertyGroup>
9+
<ItemGroup Condition="'$(UseNativeCode)' == 'true'">
10+
<PackageReference Include="Libuv" Version="1.9.1" />
11+
</ItemGroup>
612
</Project>

TestAssets/TestProjects/DesktopMinusRid/Program.cs

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,45 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System;
5-
using System.Diagnostics;
5+
using System.Reflection;
6+
using System.Runtime.InteropServices;
67

78
namespace TestApp
89
{
9-
public class Program
10+
class Program
1011
{
11-
public static void Main(string[] args)
12+
static void Main()
1213
{
14+
// Prevent libuv on path from interfering with test
15+
Environment.SetEnvironmentVariable("PATH", "");
16+
17+
#if USE_NATIVE_CODE
18+
try
19+
{
20+
uv_loop_size();
21+
Console.WriteLine($"Native code was used ({GetCurrentAssemblyProcessorArchitecture()})");
22+
}
23+
catch (DllNotFoundException)
24+
{
25+
Console.WriteLine($"Native code failed ({GetCurrentAssemblyProcessorArchitecture()})");
26+
}
27+
#else
28+
Console.WriteLine($"Native code was not used ({GetCurrentAssemblyProcessorArchitecture()})");
29+
#endif
30+
}
31+
32+
#if USE_NATIVE_CODE
33+
[DllImport("libuv", CallingConvention = CallingConvention.Cdecl)]
34+
static extern int uv_loop_size();
35+
#endif
36+
37+
static ProcessorArchitecture GetCurrentAssemblyProcessorArchitecture()
38+
{
39+
#if NET46
40+
return AssemblyName.GetAssemblyName(typeof(Program).Assembly.Location).ProcessorArchitecture;
41+
#else
42+
throw new PlatformNotSupportedException();
43+
#endif
1344
}
1445
}
1546
}

src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.cs.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@
174174
<data name="UnexpectedDependencyWithNoVersionNumber" xml:space="preserve">
175175
<value>Nečekaná závislost {0} bez čísla verze.</value>
176176
</data>
177-
<data name="RuntimeIdentifierMustBeSetForNETFramework" xml:space="preserve">
178-
<value>Hodnota RuntimeIdentifier musí být nastavena pro spustitelné soubory .NET Frameworku. Můžete použít hodnotu RuntimeIdentifier=win7-x86 nebo RuntimeIdentifier=win7-x64.</value>
179-
</data>
180177
<data name="AssetPreprocessorMustBeConfigured" xml:space="preserve">
181178
<value>Před zpracováním prostředků je potřeba nakonfigurovat preprocesor prostředků.</value>
182179
</data>

src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.de.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@
174174
<data name="UnexpectedDependencyWithNoVersionNumber" xml:space="preserve">
175175
<value>Unerwartete Abhängigkeit "{0}" ohne Versionsnummer.</value>
176176
</data>
177-
<data name="RuntimeIdentifierMustBeSetForNETFramework" xml:space="preserve">
178-
<value>"RuntimeIdentifier" muss für ausführbare .NETFramework-Dateien festgelegt werden. Verwenden Sie ggf. "RuntimeIdentifier=win7-x86" oder "RuntimeIdentifier=win7-x64".</value>
179-
</data>
180177
<data name="AssetPreprocessorMustBeConfigured" xml:space="preserve">
181178
<value>Der Ressourcenpräprozessor muss konfiguriert werden, bevor Ressourcen verarbeitet werden.</value>
182179
</data>

src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.es.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@
174174
<data name="UnexpectedDependencyWithNoVersionNumber" xml:space="preserve">
175175
<value>Dependencia '{0}' sin número de versión no esperada.</value>
176176
</data>
177-
<data name="RuntimeIdentifierMustBeSetForNETFramework" xml:space="preserve">
178-
<value>RuntimeIdentifier debe establecerse para archivos ejecutables de .NET Framework. Considere usar RuntimeIdentifier=win7-x86 o RuntimeIdentifier=win7-x64.</value>
179-
</data>
180177
<data name="AssetPreprocessorMustBeConfigured" xml:space="preserve">
181178
<value>Debe configurarse el preprocesador de recursos antes de que se procesen los recursos.</value>
182179
</data>

src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.fr.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@
174174
<data name="UnexpectedDependencyWithNoVersionNumber" xml:space="preserve">
175175
<value>Dépendance '{0}' sans numéro de version inattendue.</value>
176176
</data>
177-
<data name="RuntimeIdentifierMustBeSetForNETFramework" xml:space="preserve">
178-
<value>RuntimeIdentifier doit être défini pour les exécutables .NET Framework. Considérez RuntimeIdentifier=win7-x86 ou RuntimeIdentifier=win7-x64.</value>
179-
</data>
180177
<data name="AssetPreprocessorMustBeConfigured" xml:space="preserve">
181178
<value>Le préprocesseur de composants doit être configuré avant que les composants ne soient traités.</value>
182179
</data>

src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.it.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@
174174
<data name="UnexpectedDependencyWithNoVersionNumber" xml:space="preserve">
175175
<value>La dipendenza '{0}' è imprevista e non ha numero di versione.</value>
176176
</data>
177-
<data name="RuntimeIdentifierMustBeSetForNETFramework" xml:space="preserve">
178-
<value>Per gli eseguibili di .NET Framework è necessario impostare RuntimeIdentifier. Provare a specificare RuntimeIdentifier=win7-x86 o RuntimeIdentifier=win7-x64.</value>
179-
</data>
180177
<data name="AssetPreprocessorMustBeConfigured" xml:space="preserve">
181178
<value>Prima di elaborare le risorse, è necessario configurare il preprocessore di risorse.</value>
182179
</data>

src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ja.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@
174174
<data name="UnexpectedDependencyWithNoVersionNumber" xml:space="preserve">
175175
<value>バージョン番号のない予期しない依存関係 '{0}' です。</value>
176176
</data>
177-
<data name="RuntimeIdentifierMustBeSetForNETFramework" xml:space="preserve">
178-
<value>.NETFramework 実行可能ファイルの RuntimeIdentifier を設定する必要があります。RuntimeIdentifier=win7-x86 または RuntimeIdentifier=win7-x64 を検討してください。</value>
179-
</data>
180177
<data name="AssetPreprocessorMustBeConfigured" xml:space="preserve">
181178
<value>資産を処理する前に、資産プリプロセッサを構成する必要があります。</value>
182179
</data>

src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ko.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@
174174
<data name="UnexpectedDependencyWithNoVersionNumber" xml:space="preserve">
175175
<value>버전 번호가 없는 예기치 않은 종속성 '{0}'입니다.</value>
176176
</data>
177-
<data name="RuntimeIdentifierMustBeSetForNETFramework" xml:space="preserve">
178-
<value>.NET Framework 실행 파일에는 RuntimeIdentifier를 설정해야 합니다. RuntimeIdentifier=win7-x86 또는 RuntimeIdentifier=win7-x64를 사용해 보세요.</value>
179-
</data>
180177
<data name="AssetPreprocessorMustBeConfigured" xml:space="preserve">
181178
<value>자산을 처리하려면 먼저 자산 전처리기를 구성해야 합니다.</value>
182179
</data>

0 commit comments

Comments
 (0)