Developer Forum »
New Ontology Module - Problems with Code Generation Script
7 posts

Hey, I'am having problems with a brand new installation of a MVC Site. I followed the update instructions and updated the site to latest webnodes build(b1610) and then updated to the new Ontology module build(b1615) by using the zip folder. 

The problem is that whenever I try to run the Code Generation Script I get a Script runtime error. It says that there is no module named string. 

I tried to create my own embedded script that writes to a file, the script compiles but gives me an error that says it does not have access to the path "c:/Windows/System32/". 

I'm thinking it can be something wrong with my developer enviroment, Visual Studio settings maybe or some python related problem? 

Any suggestions?

 

Sten Marius

 

 

181 posts

Hi!

Just so I understand the problem: did it work until you added the custom script?

 

Vidar

7 posts

No, It didn't. 

181 posts

Hi!

I just made a test to try to recreate the problem. It worked fine for me. I did the following:

  • Install Framework MVC site
  • Update to build 610
  • Upgrade to build 615 (plugin branch)
  • Run the website, this is an important step. 
  • Use the plugin
  •  

    Did you do step 4, or did you start to use the plugin after installing the 615 update?

    7 posts

    Yes, I'm pretty sure I did step 4 before i used the plugin.

    But okey, so I tested on a different computer and it works fine. But when I copy the project into the other computer (where the problem occurs) I get the same script errors.

    Thats why i think there is something with my settings etc. that might be wrong. But I can't figure out exactly what's wrong.

     

    181 posts

    Strange..

    Do you have the same version of Visual Studio 2013 on both? Update 4? What OS are you using on the machine that fails?

    The "No module named string" is a common python error, so hard to say exactly what is wrong.

    7 posts

    Computer that's working:

    - Windows 7

    - Visual Studio 2013 

     

    Computer that's failing:

    - Windows 8.0

    - Visual Studio 2013 update 4

     -----------------------------------------------------

    I'ts weird that the custom script throws a error that it can't access the folder "c:/Windows/System32".

    Custom Script code: 

    fw = open("test.txt", "w")

    fw.write("test")

     

    When i run the same script on the computer that works I get the test.txt file with the word "test" written. 

    Can it be something wrong with the python search paths or some thing along those lines?

    BTW: it should work without having to install python manually right?

    181 posts

    I've investigated a bit further, and it might be that the python files used by IronPython is missing. The plugin installation is supposed to install the needed python files. You can check if the python files exist. The plugin is installed in the following folder:

    C:\Users\Vidar\AppData\Local\Microsoft\VisualStudio\12.0\Extensions

    Inside the plugin folder, there is a Lib folder that contains many python files. The "no module named string" error is probably caused by string.py not being present. 

    If all the python files are present, I try to check out what's happening by using Process Monitor from Sysinternals: http://technet.microsoft.com/pl-pl/sysinternals/bb896645.aspx

     

     

    7 posts

    Okey, so I think i found the problem. I used the Process Monitor program that you linked to check what was going on. 

    It couldn't find the path because of whitespaces in the name of my Windows User Account.

    For some reason it converted the path from this: 

    "C:\Users\User Account Name\AppData\Local\Microsoft\VisualStudio\12.0\Extensions"

    to:

    "C:\Users\User%20Account%20Name\AppData\Local\Microsoft\VisualStudio\12.0\Extensions"

    Paths without the "%20" whitespace conversion was Okey.

     

    I've created a new Windows User Account without any whitespaces and it worked fine!

    Do you think it is something that you can fix?

    181 posts

    Thanks for finding this bug! 

    We'll include a fix in the next build of the plugin.

     

     

    1