Skip to content

Commit

Permalink
[msbuild] Show a warning if asked to load an app manifest that doesn'…
Browse files Browse the repository at this point in the history
…t exist. (xamarin#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.
  • Loading branch information
rolfbjarne authored and filipnavara committed May 9, 2023
1 parent c83bdbf commit d8aa629
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -102,14 +102,17 @@ public override bool Execute ()
PDictionary plist;

var appManifest = AppManifest?.ItemSpec;
if (appManifest is not null && File.Exists (appManifest)) {
if (appManifest is null || string.IsNullOrEmpty (appManifest)) {
plist = new PDictionary ();
} else if (File.Exists (appManifest)) {
try {
plist = PDictionary.FromFile (appManifest)!;
} catch (Exception ex) {
LogAppManifestError (MSBStrings.E0010, appManifest, ex.Message);
return false;
}
} else {
LogAppManifestWarning (MSBStrings.W7108 /* The file '{0}' does not exist. */, appManifest);
plist = new PDictionary ();
}

Expand Down

0 comments on commit d8aa629

Please sign in to comment.