i config nlog in a c# class library named "common",added target to sqlite3 database, and add a other windows form application named "NLogtest", i was planned add "common" as a refrence in NLogtest. call loghelper class in common to write log, when write to log file it works fine, but when write to database it doesn't work.
so my question is can or can not config nlog in a class lib?
thanks to Rolf, the dbProvider it is a critical point. and after teat i have found that NLog.Database.dll and System.Data.SQLite.dll have to exist in the base directory where the exe at. you can copy these two dll from somewhere else or import from Nuget manager. then it would be work just fine.
enter image description here
Related
I am trying to create a blueprint for entity-client sub-generator by following the official guide. Tried several times. But when I try to use the generated blueprint, while importing jdl, it always says
Trying to use blueprint generator-jhipster-helloworld
WARNING! No blueprint found for entity-client falling back to default generator
then it generates the entity clients in the default way.
I can see the blueprint is linked into the node-modules folder of the generated app.
If anybody has created a simple working "entity-client sub-generator" blueprint, Please share the code with me. For example, "that adds <h1>lorem ipsum<h1> on the top of component.html file for the generated client of entity (on importing a simple jdl with just one entity)" would be sufficient.
Sample JDL
entity Item{
code String required,
description String required,
quantity Integer required
}
Best Regards.
I'm developing a web application with ActiveWeb. I wanted to change the package from app.controller to be.coudron.graphplanner.controller
I created a file activewebproperties and placed it in src/main/resources
the contents of the file are:
freeMarkerConfig=be.coudron.graphplanner.config.FreeMarkerConfig
bootstrap=be.coudron.graphplanner.config.AppBootstrap
dbconfig=be.coudron.graphplanner.config.DbConfig
route_config=be.coudron.graphplanner.config.RouteConfig
controllerConfig=be.coudron.graphplanner.config.AppControllerConfig
rootPackage=be.coudron.graphplanner
When I start the app with mvn jetty:run
I get the error:
org.javalite.activeweb.ControllerException: controller must be
in the 'app.controllers' package
What am i doing wrong?
There are no typos in the code nor the package names.
the exception message is self-explanatory: "controller must be in the 'app.controllers' package"
The file activeweb.properties is part of the framework and not editable. With time, you will appreciate simplicity and consistency of the framework. It requires that controllers are placed into app.controllers package. Please, refer to http://javalite.io/structure_of_activeweb_project#location-of-controllers
I need my inno setup application to save its location to the registry so my application can find it. I need to be able to find the setup file and load it into my application's database so it can be extracted and used by other computers that connect to the database. If a user downloads the setup file from the website instead of going through the normal update process then I won't know where he saved it to and opened it from - or at least that's what I'm trying to determine. Saving to the registry is no problem - getting the setup files location is what I'm missing. Thanks.
Use ExpandConstant('{srcexe}'), as explained in the documentation
Prototype:
function ExpandConstant(const S: String): String;
Description:
Changes all constants in S to their values. For example, ExpandConstant('{srcexe}') is changed to the filename of Setup.
An exception will be raised if there was an error expanding the constants.
According to
http://www.jrsoftware.org/ishelp/index.php?topic=consts
{srcexe} is what you are looking for.
How would I correctly use configuration file in Snap?
At the moment, I hard code DB host and DB name. If I wanted to put it in a file within projectroot/config directory, how would I make it available within a handler or within app init function?
It is mentioned briefly in snaplets tutorial that configurator library can be used but there was no explanation of how to actually use it.
Thanks.
Just call getSnapletUserConfig which returns a Config. Then use functions from configurator to get the information you need. Look at snaplet-postgresql-simple's use of config files for a working example.
The config file defaults to devel.cfg in the current snaplet file path. So if you are using getSnapletUserConfig in your top-level application, then the config file will be in your project root. Otherwise it will be in snaplets/foo where "foo" is the name of whatever snaplet you are in.
I was wondering if it's possible to open doc, xls, pdf, etc files using the "Documents To Go" app from a third party blackberry app.
If you want to open a specific document, since Docs ToGo registers to handle these extensions, you can use the Registry invocation and it will be handled for you. Take a look at the Registry and Invocation classes, the following code will open the document in the given path, Docs ToGo will take over through the Registry:
Invocation invocation = new Invocation(path);
Ragistry reg = = Registry.getRegistry("<your app namespace.class>");
reg.invoke(invocation);
If there is no registered handler for the file content type a ContentHandlerException will be thrown with error code ContentHandlerException.NO_REGISTERED_HANDLER.
Note: there's a small bug in Docs ToGo - closing the document or clicking the back button might not lead the user back to your application.
EDIT: The getRegistry function takes a class fully qualified name e.g. com.softartisans.SilverDust, where SilverDust is the class mane. You can find more info about the use of the Registry in this online book starting page 291 - Client use of Registry. I originally linked to the javax Registry, but it is more useful to look at the BlackBerry Registry docs.
You can use the ApplicationManager class to launch other applications, for example by looking up its descriptor and using runApplication(). You can also pass arguments in the descriptor and if the application looks at arguments passed into it, it may actually open the specified file.