Skip to content Skip to sidebar Skip to footer

Why Does My JQuery GetJSON Call (within Office.js (Excel Js Add-in)) Return An Error?

This javascript within an Office js add-in always fails when making a get request: function update() { Excel.run(function (ctx) { return ctx.sync() .then(f

Solution 1:

It's all to do with CORS, I found the solution in rick-strahl's post:

https://weblog.west-wind.com/posts/2016/Sep/26/ASPNET-Core-and-CORS-Gotchas#ApplythePolicy

Specifically, "UseCors() has to be called before UseMvc() Make sure you declare the CORS functionality before MVC so the middleware fires before the MVC pipeline gets control and terminates the request."


Post a Comment for "Why Does My JQuery GetJSON Call (within Office.js (Excel Js Add-in)) Return An Error?"