In some cases the default properties
(nvelocity.properties and directive.properties)
couldn't be loaded because an exeception is thrown by
the .NET framework when the properties files
(resources) are searched in the referenced assemblies
which is implemented in the constructor of the
ResourceLocator class.
In my case an assembly which was an "in memory module"
threw an exception when the method
GetManifestResourceNames()has been called. The
resources won't be in such a module, so this exception
can be caught and ignored.
Beside this small bug velocity and NVelocity are
excellent and very useful!!
Cheers
Christian (c.ru@iph.ch)
Fixed source file for the ResourceLocator class
Hello!
Loading of NVelocity default properties is really fails.
And the proposed correction does not solve the problem.
You can reproduce the problem by following steps with examples, which accompany source code of NVelocity.
1) When examples has references to NVelocity.dll are directly (private installation). In this case all is OK. The embedded resources (.properties) are located and loaded normally.
2) Now we trying to use of NVelocity shared installation, trying add it (and related assemblies) to the GAC. gacutil /i NVelocity.dll etc. After adding the NVelocity.dll to the GAC we will try to run the same example. We see that the program ending with the error while initializing of NVelocity engine. ResourceLocator can`t load the default .properties files. We can try to initialize NVelocity manually. But we have some little trouble with initialization of NVelocity directives. We can`t add it manually.