Repository: godotengine/godot
File: platform/uwp/export/export.cpp (C++)

Code before:
			if (!dvalid) {
				err += TTR("Custom debug template not found.") + "\n";
			}
		}
		if (p_preset->get("custom_template/release") != "") {
			rvalid = FileAccess::exists(p_preset->get("custom_template/release"));
			if (!rvalid) {
				err += TTR("Custom release template not found.") + "\n";
			}
		}

		valid = dvalid || rvalid;
		r_missing_templates = !valid;

		if (!err.empty()) {
			r_error = err;
		}

		return valid;
	}

	virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
		String err;
		bool valid = true;

		// Validate the rest of the configuration.

		if (!_valid_resource_name(p_preset->get("package/short_name"))) {
			valid = false;
			err += TTR("Invalid package short name.") + "\n";
		}

		if (!_valid_resource_name(p_preset->get("package/unique_name"))) {
			valid = false;
			err += TTR("Invalid package unique name.") + "\n";
		}

		if (!_valid_resource_name(p_preset->get("package/publisher_display_name"))) {
			valid = false;
			err += TTR("Invalid package publisher display name.") + "\n";
		}

		if (!_valid_guid(p_preset->get("identity/product_guid"))) {
			valid = false;
			err += TTR("Invalid product GUID.") + "\n";
		}

		if (!_valid_guid(p_preset->get("identity/publisher_guid"))) {
			valid = false;
			err += TTR("Invalid publisher GUID.") + "\n";
		}

Review comment (suggestion):
Probably `valid` should forced to `false` here, in case some template files were placed into the mono template folder manually.

Code after:
		}

		bool dvalid = exists_export_template("uwp_" + platform_infix + "_debug.zip", &err);
		bool rvalid = exists_export_template("uwp_" + platform_infix + "_release.zip", &err);

		if (p_preset->get("custom_template/debug") != "") {
			dvalid = FileAccess::exists(p_preset->get("custom_template/debug"));
			if (!dvalid) {
				err += TTR("Custom debug template not found.") + "\n";
			}
		}
		if (p_preset->get("custom_template/release") != "") {
			rvalid = FileAccess::exists(p_preset->get("custom_template/release"));
			if (!rvalid) {
				err += TTR("Custom release template not found.") + "\n";
			}
		}

		valid = dvalid || rvalid;

#ifdef MODULE_MONO_ENABLED
		// If this is a Mono build, provide a custom error so that users are not confused.
		// We don't bypass the whole logic to check templates because third-parties might have
		// Mono-enabled UWP builds using this path.
		r_missing_templates = false; // Don't warn about those.
		r_error = TTR("Godot's Mono version does not support the UWP platform. Use the standard build (no C# support) if you wish to target UWP.");
#else
		r_missing_templates = !valid;

		if (!err.empty()) {
			r_error = err;
		}
#endif // MODULE_MONO_ENABLED

		return valid;
	}

	virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
		String err;
		bool valid = true;

#ifdef MODULE_MONO_ENABLED
		// Don't warn about project configuration issue if this is a Mono build
		// without custom-provided Mono-enabled UWP templates.
		// We check if we have valid templates to decide if we should actually
		// validate the config.
		bool tmp;
		if (!has_valid_export_configuration(p_preset, err, tmp)) {
			return false;
		}
#endif // MODULE_MONO_ENABLED