FAQ's for Developers: Difference between revisions
(NUnit problem 64 bit) |
|||
(25 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
= | ==Source Code Repository== | ||
== | ===Q: Which source code repository system are you using?=== | ||
We use Git, and the main repository is hosted at https://github.com/openpetra/openpetra/. | |||
= NUnit = | ==Continuous Integration/Build Server== | ||
== Assembly Not Loaded: System.BadImageFormatException == | ===Q: Do you build regularly?=== | ||
Yes, we do. See [[Continuous Integration with LightBuildServer]] | |||
==Notifications of What is Happening== | |||
===Q: Do you have a Developer's Blog or Mailing Lists?=== | |||
We don't have a developer's blog and we don't have mailing lists either. We have '''Forums''' instead. The [https://forum.openpetra.org Forum] provides a better structure than a blog for the purposes of communication between developers/potential developers because the Forum provides a threaded format rather than just a long list of entries that is ordered by date. | |||
In addition to that we have '''hourly notification emails''' for Forum changes and wiki changes that our developers all are subscribed to (such emails are sent only if changes happen, of course). These email notifications can't be subscribed to directly. Instead, an administrator needs to set those up for each developer as they are a done with a custom solution. | |||
Note: We have a [https://www.openpetra.org/news Project Blog] which is accessible from the 'News' section of the web site. | |||
===Q: Do you have notifications for source code commits?=== | |||
You can subscribe to https://github.com/openpetra/openpetra/ by clicking Watch at the top. | |||
==Unit Testing== | |||
=== NUnit === | |||
==== Q: I get 'Assembly Not Loaded: System.BadImageFormatException' Exception==== | |||
When starting NUnit on 64-bit Windows, you might get this error: | When starting NUnit on 64-bit Windows, you might get this error: | ||
Assembly Not Loaded | Assembly Not Loaded | ||
Line 21: | Line 28: | ||
You may be attempting to load an assembly built with a later version of the CLR than the version | You may be attempting to load an assembly built with a later version of the CLR than the version | ||
under which NUnit is currently running (2.0.50727) or trying to load a 64-bit assembly into a 32-bit process. | under which NUnit is currently running (2.0.50727) or trying to load a 64-bit assembly into a 32-bit process. | ||
Solution: run the nunit-x86.exe instead of the nunit.exe from your directory C:\Program Files (x86)\NUnit 2.5.8\bin\net-2.0 or similar. | |||
'''Solution''': run the nunit-x86.exe instead of the nunit.exe from your directory C:\Program Files (x86)\NUnit 2.5.8\bin\net-2.0 or similar. | |||
== Unsorted questions == | |||
===Q: I cannot find a string which is shown in a dialog, why?=== | |||
Refering to [https://sourceforge.net/apps/mediawiki/openpetraorg/nfs/project/o/op/openpetraorg/d/db/Excample-screen.JPG this screen shoot] you may search for a string like "ImportGL Transactions From Bank Statement" in order to find the piece of code responsible for that entry. The string you should look for is ImportGLTransactionsFromBankStatement, and this leads you directly to the file UINavigation.yml. | |||
===Q: I came across C# code like '... <code>= @TServerLookup.TMCommon.GetData;</code>' - what does it do, what is it for?=== | |||
In the C# programming language the '@MethodName' notation is used for referencing the callee of a Delegate. The @ operator is ''optional'', but it helps when 'scanning program code by eye' to identify such callees (and to find those quickly when using the find functionality of a code editor). | |||
An example code line for that can be found in <code>\csharp\ICT\Petra\Client\app\MainWindow\PetraClientMain.cs</code>, Method <code>'InitialiseClasses'</code>: | |||
TSharedValidationHelper.SharedGetDataDelegate = TServerLookup.TMCommon.GetData; | |||
The code line means in English: ‘Set up the Delegate of Type <code>TSharedGetData</code> which is held in the static Field <code>FDelegateSharedGetData</code> in Class <code>TSharedValidationHelper</code> through its static Property <code>SharedGetDataDelegate</code> to point to the static Method <code>TServerLookup.TMCommon.GetData</code>’. | |||
The purpose of setting this up is that the Method <code>GetData</code> in Ict.Petra.''Shared''.MCommon.Validation.TSharedValidationHelper (which is in a Project that can’t have a reference to any ''client-side'' projects as it is ''shared'' code that can be executed by both client and server) ''can still'' execute a client-side (or a server-side) method - although it is lacking Project References to those DLLs! 'What exactly' ''is'' getting executed at run time in Method <code>GetData</code> depends on whether the client or the server is setting up the <code>SharedGetDataDelegate</code> Delegate, and to which Method on ‘his side’ that points. | |||
Note: The server-side set-up of the Delegate can be found in \csharp\ICT\Petra\Server\lib\CallForwarding\CallForwarding.cs, in the static Constructor of 'TCallForwarding'. | |||
TSharedValidationHelper.SharedGetDataDelegate = @TCommonDataReader.GetData; | |||
===Q: What is the 'SiteKey' and how do I retrieve it?=== | |||
Have a look here: [[Retrieving the 'SiteKey' of an OpenPetra installation]]. | |||
==More questions?== | |||
Just ask a question in this [https://forum.openpetra.org Forum]. |
Latest revision as of 03:49, 22 Haziran 2023
Source Code Repository
Q: Which source code repository system are you using?
We use Git, and the main repository is hosted at https://github.com/openpetra/openpetra/.
Continuous Integration/Build Server
Q: Do you build regularly?
Yes, we do. See Continuous Integration with LightBuildServer
Notifications of What is Happening
Q: Do you have a Developer's Blog or Mailing Lists?
We don't have a developer's blog and we don't have mailing lists either. We have Forums instead. The Forum provides a better structure than a blog for the purposes of communication between developers/potential developers because the Forum provides a threaded format rather than just a long list of entries that is ordered by date.
In addition to that we have hourly notification emails for Forum changes and wiki changes that our developers all are subscribed to (such emails are sent only if changes happen, of course). These email notifications can't be subscribed to directly. Instead, an administrator needs to set those up for each developer as they are a done with a custom solution.
Note: We have a Project Blog which is accessible from the 'News' section of the web site.
Q: Do you have notifications for source code commits?
You can subscribe to https://github.com/openpetra/openpetra/ by clicking Watch at the top.
Unit Testing
NUnit
Q: I get 'Assembly Not Loaded: System.BadImageFormatException' Exception
When starting NUnit on 64-bit Windows, you might get this error:
Assembly Not Loaded System.BadImageFormatException : Could not load file or assembly 'Tests.Common, Version=0.0.9.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. You may be attempting to load an assembly built with a later version of the CLR than the version under which NUnit is currently running (2.0.50727) or trying to load a 64-bit assembly into a 32-bit process.
Solution: run the nunit-x86.exe instead of the nunit.exe from your directory C:\Program Files (x86)\NUnit 2.5.8\bin\net-2.0 or similar.
Unsorted questions
Q: I cannot find a string which is shown in a dialog, why?
Refering to this screen shoot you may search for a string like "ImportGL Transactions From Bank Statement" in order to find the piece of code responsible for that entry. The string you should look for is ImportGLTransactionsFromBankStatement, and this leads you directly to the file UINavigation.yml.
Q: I came across C# code like '... = @TServerLookup.TMCommon.GetData;
' - what does it do, what is it for?
In the C# programming language the '@MethodName' notation is used for referencing the callee of a Delegate. The @ operator is optional, but it helps when 'scanning program code by eye' to identify such callees (and to find those quickly when using the find functionality of a code editor).
An example code line for that can be found in \csharp\ICT\Petra\Client\app\MainWindow\PetraClientMain.cs
, Method 'InitialiseClasses'
:
TSharedValidationHelper.SharedGetDataDelegate = TServerLookup.TMCommon.GetData;
The code line means in English: ‘Set up the Delegate of Type TSharedGetData
which is held in the static Field FDelegateSharedGetData
in Class TSharedValidationHelper
through its static Property SharedGetDataDelegate
to point to the static Method TServerLookup.TMCommon.GetData
’.
The purpose of setting this up is that the Method GetData
in Ict.Petra.Shared.MCommon.Validation.TSharedValidationHelper (which is in a Project that can’t have a reference to any client-side projects as it is shared code that can be executed by both client and server) can still execute a client-side (or a server-side) method - although it is lacking Project References to those DLLs! 'What exactly' is getting executed at run time in Method GetData
depends on whether the client or the server is setting up the SharedGetDataDelegate
Delegate, and to which Method on ‘his side’ that points.
Note: The server-side set-up of the Delegate can be found in \csharp\ICT\Petra\Server\lib\CallForwarding\CallForwarding.cs, in the static Constructor of 'TCallForwarding'.
TSharedValidationHelper.SharedGetDataDelegate = @TCommonDataReader.GetData;
Q: What is the 'SiteKey' and how do I retrieve it?
Have a look here: Retrieving the 'SiteKey' of an OpenPetra installation.
More questions?
Just ask a question in this Forum.