Skip to content

Commit 32bf0b1

Browse files
authored
[msbuild] Show a warning if asked to load an app manifest that doesn't exist. (#18222)
This makes it easier to diagnose problems loading/finding app manifests. Specifying an app manifest that doesn't exist should probably be an error, but that's very likely to break existing projects, so just make this a warning for now.
1 parent 36af029 commit 32bf0b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifestTaskBase.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,17 @@ public override bool Execute ()
102102
PDictionary plist;
103103

104104
var appManifest = AppManifest?.ItemSpec;
105-
if (appManifest is not null && File.Exists (appManifest)) {
105+
if (appManifest is null || string.IsNullOrEmpty (appManifest)) {
106+
plist = new PDictionary ();
107+
} else if (File.Exists (appManifest)) {
106108
try {
107109
plist = PDictionary.FromFile (appManifest)!;
108110
} catch (Exception ex) {
109111
LogAppManifestError (MSBStrings.E0010, appManifest, ex.Message);
110112
return false;
111113
}
112114
} else {
115+
LogAppManifestWarning (MSBStrings.W7108 /* The file '{0}' does not exist. */, appManifest);
113116
plist = new PDictionary ();
114117
}
115118

0 commit comments

Comments
 (0)