Microsoft has recently started rolling out the Windows 10 Anniversary Update – which is great, however it does cause an issue with Smart Office and JScripts.
Smart Office will download the .js from the server, it will go through some of the compile phases, however it doesn’t produce the final .dll which Smart Office attempts to load and generates an exception similar to this:
MForms.Render.RenderEngine.PostRender Failed to run scripts
System.IO.FileNotFoundException: Could not load file or assembly <path to .dll>
and of-course the script doesn’t run. If you are using precompiled .dlls directly, then they work without issue.
Infor released Smart Office hotfix 17 for 10.2.1 last week which looks like it has resolved the issue. Once applied Smart Office will show a version of 10.2.1.0.169.
Hi, we are experiencing the same issue. (windows 10, smart office 10.0.5.4.28 We create the .js and then install in smart office. But how can we create, precompile this to get a .dlls ? Thank you
Smart Office retrieves the scripts for the M3 UI Adapter (assuming you don’t have the local script reg set). It them compiles them in to an assembly in the %temp% directory on the local machine. Once compiled Smart Office will load the Assembly, then execute the Init() method.
So, on a machine that is working –
1). clear the %temp% directory
2). load the panel with the script. You will see that there is a .dll that has a randomly generated name.
3). rename that randomly generated .dll to be the name of your script (eg. if the script was helloworld.js would be rename this .dll to helloworld.dll)
4). copy the .dll to the mne\JScripts directory
5). change the users personalisation to reference the .dll (eg. helloworld or helloworld.js will become helloworld.dll). It is important to have the .dll extension as Smart Office assumes that the scripts will be .js.
Though I didn’t actually try myself, you can probably load the script in to the Smart Office JScript Editor (mforms://jscript) and hit compile – I imagine that this will also generate the .dll in the temp directory.
If you’re really bored, you could explore using the .Net JScript compiler to automate the compilation – it’s included in the .Net framework.
Thanks a lot for your answer. We will try the steps you propose.
Issue is solved now, scripts work again in windows 10 version 1703. Thank you !
Hi, I don’t understand the point
5). change the users personalisation to reference the .dll (eg. helloworld or helloworld.js will become helloworld.dll). It is important to have the .dll extension as Smart Office assumes that the scripts will be .js.
This is in reference to where you attach the script to a users panel from within Smart Office (Tools -> Personalize -> Scripts).
Typically you’d attach a script by using the name of the script without the extension. For example, if you wanted to attach a script called helloworld.js you would key in the name helloworld
However, because we are attaching a .dll, we need to specify the .dll extension in the script name. So in the Tools -> Personalize -> Scripts you would type helloworld.dll