Regarding your problem with Visual Studio crashing when not in "test" mode basically the call to IAP fails and takes out the runtime. I fixed this by altering my non-compressed c2runtime.js so that the calls to the windows IAP are wrapped in try catch statements. Not ideal, but got me through the problem!
Windows8Store.prototype.purchaseProduct = function (product_) {
if (product_ === "app") {
this.purchaseApp();
return;
}
var self = this;
try {
var productLicenses = this.currentApp["licenseInformation"]["productLicenses"];
this.currentApp["requestProductPurchaseAsync"](product_, false).then(
function () {
if (productLicenses["hasKey"](product_) && productLicenses["lookup"](product_)["isActive"]) {
console.log("[Construct 2] Product '" + product_ + "' purchased OK");
if (self.onpurchasesuccess)
self.onpurchasesuccess(product_);
}
else {
console.log("[Construct 2] Product '" + product_ + "' purchase failed (cancelled?)");
if (self.onpurchasefail)
self.onpurchasefail(product_, "failed");
}
},
function (msg) {
console.log("[Construct 2] Product '" + product_ + "' purchase failed: " + msg);
if (self.onpurchasefail)
self.onpurchasefail(product_, msg);
});
} catch (e) {
console.log("[Construct 2] Product '" + product_ + "' purchase failed - server not available");
if (self.onpurchasefail)
self.onpurchasefail(product_, "purchase failed - server not available");
}
};
Windows8Store.prototype.restorePurchases = function () {
};
Windows8Store.prototype.requestStoreListing = function () {
var self = this;
try {
this.currentApp["loadListingInformationAsync"]().then(
function (listing) {
console.log("[Construct 2] Listing information loaded");
self.appName = listing["name"];
self.appFormattedPrice = listing["formattedPrice"];
self.lastProductListings = listing["productListings"];
if (self.onstorelistingsuccess)
self.onstorelistingsuccess();
});
} catch (e) {
if (self.onstorelistingfail)
self.onstorelistingfail();
}
};