fix mono HelloWorld sample (#87778)
authorAleksey Kliger (λgeek) <alklig@microsoft.com>
Mon, 19 Jun 2023 23:51:49 +0000 (19:51 -0400)
committerGitHub <noreply@github.com>
Mon, 19 Jun 2023 23:51:49 +0000 (19:51 -0400)
* fix mono HelloWorld sample

Set SelfContained=true.  Otherwise we get this when trying to run the
app:

```
./artifacts/bin/H
elloWorld/arm64/Release/osx-arm64/publish/HelloWorld
You must install or update .NET to run this application.

App: /Users/alklig/work/dotnet-runtime/runtime-review/artifacts/bin/HelloWorld/arm64/Release/osx-arm64/publish/HelloWorld
```

* fix samples

src/mono/sample/HelloWorld/HelloWorld.csproj
src/mono/sample/mbr/console/ConsoleDelta.csproj

index bc6db37..ef6aa16 100644 (file)
@@ -2,6 +2,8 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
+    <!-- always set SelfContained when running to use Mono on desktop -->
+    <SelfContained>true</SelfContained>
   </PropertyGroup>
 
   <UsingTask TaskName="MonoAOTCompiler"
index 6741c2e..86fb68e 100644 (file)
@@ -3,6 +3,8 @@
     <OutputType>Exe</OutputType>
     <TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
     <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
+    <!-- always set SelfContained when running to use Mono on desktop -->
+    <SelfContained>true</SelfContained>
   </PropertyGroup>
 
   <PropertyGroup>