Hi there,
I have a custom control that I have been making changes to and it is working as expected on the server I have developed it on.
When I go to deploy the newer version to a different K2 server (the older version was deployed and working as expected on the 3 other servers) I am getting the following when the Forms engine is trying to read the .js file associated with the control (this happens for both the designer and runtime sites):
Refused to execute script from 'https://my_k2_server/Designer/Bundles/Js/DT.K2.Forms.Custom.My_Custom_Control?_v=5.1012.21313.1' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
If I load through chrome developer tools on the server that I developed the control on the above equivalent Url, the server returns the JavaScript file contents as expected to the browser.
There were a number of xml property changes so I had to re-run the controlutil.exe to update it (this normally isn’t a problem but am mentioning it just in case).
The .js file in the Visual Studio project has as far as I can tell not changed project-wise (it is still an embedded resource) and is referred to correctly in the code behind file and I can’t see anywhere that I could have specifically modified the file to be of type text/html.
The .js file is parsing as valid JavaScript, as is the XML definition file.
Things I have tried:
- Clearing the control cache on working and destination servers (https://my_k2_server/designer/Caching/CacheControl.ashx?m=CLEAR)
- Restarting IIS on the destination server
- Rebooting the destination server
- Deregistering the control and reinstalling it fresh on the destination server
If I redeploy the previous version of the DLL to the destination server then that version works as expected.
Does anyone have any ideas as to why I am getting this problem and how to solve it?
Full disclosure - the development server is 5.6 and the target servers are 5.4 (but this hasn’t been an issue when developing custom controls in the past on the exact same set-up)
Cheers