View generated code

View generated code

  
At the moment I am learning about the OutSystems Platform by working through the training videos and publishing to my personal Outsystems cloud environment. I would like to get a look at the code that is being generated. 

I've tried searching on the forums for advice on how to do this and it appears that much of the information on how to do this is old. I have read about detaching code and have done the tutorial on this, but this is not useful as I am not currently looking to end my subscription. What is the easiest way therefore for me to accomplish this?
Hi Louise,

The detach source code is a feature we provide when a customer wants to part ways with OutSystems. As such, the feature is, in your case, only available in form of a tutorial, so as to inform customers that we have such feature.

Should you want to test different patterns, you can change the application provided in the tutorial and check the results by downloading its source code.

In case you are interested in a more profound evalution, you can always give us a call here.

Kind regards,
Ricardo Alves
If you have a local installation of OutSystems (so not in the cloud), and have access to the file system IIS is running on (or the equivalent of the Java stack), you have access to the C# files.
@Louise Keegan, If you look at the IIS virtual direcotory for the app, you should be able to access binary(DLL) file in the bin directory. You can then use some decompiler (like ilspy) to access the code behind, this will at least give you some basic idea about the code generated.

and as Ricardo Alves mentioned, for more extensive evaluation, you need to contact outsystems support. 
@Kilian Hekhuis, you don't have access to the C# source code, you just have access to the aspx files and the .NET dll's (and some more files like CSS, javacsript, images, user controls, ...), since the projects are compiled.

You can however try to decompile them, but that's another story.
Carlos: no, we actually have the C# code, in the \Program Files\OutSystems\Platform Server\share\eSpaceName\full directory. I don't known whether that's the case with everyone, but at least we have it.
You mentioned IIS so I thought you were talking about the ..\Platform Server\running\ folder.
Hi again,

Kilian, you are not wrong, but you are not quite right either. The code you see in the share folder is not commented, and is instrumented with extra code for debugging purposes. Furthermore, there are also some additional libraries whose source code is not there.

Bottom line is, you can have a look at the share folder. It will give you a glimpse of the generated code. However, the code you get from the detach source code feature is substantially different.

For more information, have a look at the detach source code tech note.

I hope this clarifies the issues presented here.

Regards,
Ricardo Alves
"However, the code you get from the detach source code feature is substantially different."

I hope so because code in the share folder is not very maintainable :).

@Ricardo, Would you happen to have some sample application with detach source code that you can share ?

Regards
Hi kota,

You can take a look into the Standard Architecture with No Lock-in technote, where you'll see the steps to run a tutorial that will show you that.

Cheers,
Tiago Simões
Ricardo Alves wrote:
Kilian, you are not wrong, but you are not quite right either. The code you see in the share folder is not commented, and is instrumented with extra code for debugging purposes. Furthermore, there are also some additional libraries whose source code is not there.
Well, I wasn't implying one could use the source code from the share folder as a replacement for the detach source code stuff. The OP asked "I would like to get a look at the code that is being generated. (...) What is the easiest way therefore for me to accomplish this?", so my reply was targeted at that question.
Hi Kilian,

You are absolutely right, and I thank for answering so promptly. I just wanted to clarify the difference between the detach source code feature and the generated code you can find under the share folder. But, in terms of the easiest way to look at the generated code, the way to do it is the way you said.

I hope this clarified the main question. Nevertheless, should you have any more question regarding this subject, feel free to ask.

Regards,
Ricardo Alves


Hi Ricardo,

The source code available on the share folder, can I use it for doing a comparison, meaning can i compare 2 instances of the source code and get the differences [just to show if someone ask me what has been changed from last release vs new release].

Also can I copy the share folder source code directly into another environment IIS [i.e. development source code to QC server], will it work?

Thanks 

Shashank

Shashannk,

The source code is just normal .cs files, so you can use any text file comparison tool you want to check for differences. However, I'm not sure how useful it would be to see differences in the generated code, as though it's fairly legible, it doesn't really tell you what has been changed functionally in an application. There's no comments etc. in the generated code!

As for your last question, we're talking about source code. So of course copying source code doesn't work, source code doesn't automagically compile itself. Also, the Platform always uses the eSpaces as base for compiling, so any publish or change to eSpaces will overwrite the copied source code. I have succesfully made changes to source code and compiled it when I was tracking Platform bugs, but those changes are always very temporary.

Thanks for the reply Kilian,

I thought the same. The problem is when someone ask a comparison of what has been changed from last release and people are used to know the file names.

By source code copy I meant that from one IIS server to another, but i realized that OuySystems also keep metadata in the database, so it can't be done.

Shashank