-
Notifications
You must be signed in to change notification settings - Fork 48
Code Generation Settings
The code generation for OpenRiaServives is based on some additional msbuild steps which are added to a client project by adding a single nuget package.If you have a client library for the code generation only that project will need a reference to the code generation package.
In order to enable code generation for a client project the project need to add a reference to any of the following nuget packages.
-
OpenRiaServices.Client.CodeGen
- Non silverlight projects using unsiged versions OpenRiaServices.Client packages
-
OpenRiaServices.Signed.Client.CodeGen
- Non silverlight projects using signed versions of OpenRiaServices.Client packages
- Requires signed versions of server packages
- OpenRiaServices.Silverlight.CodeGen
- OpenRiaServices.Signed.Silverlight.CodeGen
Below is a list of properties which can be set in a project in order to influence the code generation.
Path (Relative or absolute) to the web project where the DomainServices and other server side logic resides.
Required This is a required property if code generation should occur at all.
Determines if a WebContext class should be generated. The WebContext class is a singleton so only a single instance should be created.
Default: True for Silverlight Applications and when building exe files (when when $(OutputType) == exe)
Boolean where "true" means fully qualified type names should be generated.
Default: Not Set (false)
You can specify the full AssemblyQualifiedName of a CodeGenerator to use in case you want to use another code generatior than the default. Useful if your server project references the OpenRiaServices.T4 nuget package nad implements your own custom code generation logic.
Default: Not Set (no custom code generation)
Introduced in 5.0 https://github.com/OpenRIAServices/OpenRiaServices/pull/229
Can be set to Link
new behavior or Copy
.
Copy is the old approach used prior to version 5.0 and means that any shared file (file name ".shared.xx" in server project) is copied to the Generated_Code folder, marked as read-only and then referenced instead of compiling directly against the server copy.
Default: Link
Msbuild Item Path to search for client assemblies.
Default: Includes
Below is a list of extensions points which can be set in a project in order to influence the code generation.
Redefine this target in your project in order to run tasks before RIA Services client proxy code generation occurs
Example
<Target Name="BeforeOpenRiaClientCodeGen">
<Message Text="Before OpenRiaServices code generation">
</Target>
Redefine this target in your project in order to run tasks after RIA Services client proxy code generation has been done
<Target Name="AfterOpenRiaClientCodeGen">
<Message Text="After OpenRiaServices code generation">
</Target>
Target to invoke the CreateOpenRiaClientFilesTask after gathering information from
Task that deletes the RIA client files created by CreateOpenRiaClientFiles