Developer FAQ

In my websites /bin folder a file called “Composite.Generated.dll” exists and I can see it gets updated now and then. What is the role of this file and what is updating it?

Answer:

Composite C1 uses Composite.Generated.dll to cache dynamically compiled .NET classes and interfaces. This caching serves two purposes – making start-up times faster and exposing data interfaces to ASP.NET developers.

The dynamic compilations happen in the following situations:

  • Data interface compilation
    When a user add or edit a data type in the Data perspective in the C1 Console, a .NET type (an interface inheriting from IData) is automatically generated and used by C1 as a data schema.
  • Wrapper class compilation
    C1 Dynamic Data Providers like the XML provider and SQL provider build a bridge between data interfaces and LINQ for SQL and LINQ for XML through code generation and compilation.
  • Empty data class compilation
    In order to support DataConnection.New() for all data interfaces classes implementing those interfaces are also generated and compiled dynamically.

Dynamic code generation and compilation typically happen incrementally, when types are first created or referenced, but all core Composite C1 data interfaces and related wrappers and empty classes will be generated when Composite C1 in initialized for the first time or when Composite.Generated.dll is deleted.

Composite.Generated.dll reside in the /bin folder which make all types in the assembly available to Composite C1 and ASP.NET code. Making changes to the /bin folder will prompt ASP.NET to restart the application, so Composite C1 will not immediately update Composite.Generated.dll, but it will wait until the ASP.NET application hosting Composite C1 restarts or shut down.

To force Composite C1 to update Composite.Generated.dll you should stop or restart the ASP.NET application. This can be done in one of the following ways:

  • Use the “Restart Server” command in the C1 Console Tools menu.
  • Use the IIS Manager to stop or restart the Application Pool hosting Composite C1
  • "Re-save" web.config or Global.asax or trigger other of the ASP.NET file system monitors (like making changes in /App_Code, deleting a folder or making changes in /bin).

Composite C1 will only re-regenerate Composite.Generated.dll if any new compilations have been executed since the last generation. If you are experiencing the the dll is not updated even though you have been making changes to Data Types via the C1 Consoles Data perspective, the shut down compilation job might be failing – in this case you should try deleting the /App_Data/Composite/Cache folder and retry the operation. You can attach the Composite C1 Log Viewer to your site to get detailed information on any compilation errors that may happen during shut down.