When using the QtWebEngine, you can enable the chromium debug dev tools with setting the QTWEBENGINE_REMOTE_DEBUGGING environment variable. Normally Chromium creates a DevToolsActivePort file, which contains the information about the debug port. However when using the QtWebEngine, this file is not created. How can I make Qt/Chromium create this file?
Related
I have a net5.0 app that's self-contained. I do not need the deps.json file since all of my dependencies exist already in the output folder so I removed the file with <GenerateDependencyFile>false</GenerateDependencyFile>. However, whenever I run my application I get the following message:
Cannot use file stream for [myapp.deps.json]: No such file or directory
The program itself runs fine as I expected but is there a way for me to remove this message somehow?
Edit: Also wanted to mention that we have a little hack that prevents the use of deps.json and that's another reason why I need it removed.
I am trying to understand how the appsettings.json and appsettings.{Environment}.json and the environment variables play along in a dotnet core 2.1 application but I don't know how at runtime the appsettings (whatever the final transformation is) are accessed by the application.
I would expect to have the appsettings among the compiled dll (e.g: MyWebApiApp\bin\Debug\netcoreapp2.1), but I don't see it there.
Understanding this would help me find out the best approach for OpenShift configmaps vs appsettings, because I need to know whether I should rely on appsettings at runtime or whether appsettings is something useful for development but on production I should rely on environment variables rather.
Thanks!
Are you running the code from within Visual Studio? The default CreateDefaultBuilder uses the Directory.GetCurrentDirectory() to determine which folder to load the settings files from. When you are running from within Visual Studio the current directory is your project directory - so when you run/debug the program it finds the correct settings file.
One way to test this is to change to a command line and run your applications using dotnet myapp.dll. If you are loading settings from an appsettings file it will not find the file and the settings will be null.
If you change the properties on your appsettings file to copy if newer and rebuild your app, when you run it from the command line it will correctly find the settings file.
You can take a look at the how the webhost determines which settings to use by looking at the implementation file. But, in short, dotnetcore will use settings in the following order:
appsettings.json
environment variables
command line
The documentation for this is here
So, if there are settings that could change once the app is deployed then you can overwrite them via environment variables. You could redeploy the appsettings files if you want to configure that way but, from my experience, it is much easier to handle production settings via environment variables, possibly using a third party tool e.g. puppet.
Hope that helps.
I am trying to populate a QTableview with some data. When developing under Qt Creator, data is read from build directory. Running the program each time, the QTableview keeps getting repopulated with previous data.
If I manually change the build directory each time before run, doesn't happen. But how do I solve the problem without manually changing the build directory every time I want a fresh run?
In your project directory there is a file name ProjectName.pro.user.
This file creating when you configure your project. it's XML file.
you can find this line on *.user files:
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/probook/Documents/Qt/testProject/Build/Windows/Debug</value>
This line define build directory address for debug. there is a same line for Release and Profile in that file.
You can also use Qt creator to define(customize) relative directory build:
goto Qt creator, Tools, Options..., Build & Run, General, Default build directory.
More info:
Qt Creator stores user-specific project settings in a .pro.user file. You can share these settings between several projects as a .pro.shared file. It has the same XML structure as a .pro.user file, but only contains the settings to share.
Based on comment, issue seems to be data which gets saved to build directory. And solution would be to remove it before running the application.
You can add Custom Process Step, either under Projects - Build Settings -
Build Steps, or under Projects - Run Settings - Deployment, and just delete the desired data files. Exact command depends on operating system.
An alternative might be to add a command line switch, something like --development-erase-saved-data, to the application itself, and erase the files (or just not read them, or whatever). Then add that command line switch to Projects - Run Settings - Run Steps - Command Line Arguments for desired build configurations.
Adding support for this in the application itself is easier to maintain, and is almost automatically cross-platform. However, it might be a feature you don't want in the application, though in that case you might only enable it for Debug builds (with #ifdef).
As a side note, saving data to executable directory is not a good idea these days. You might want to save it for example to location returned by
QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)
(See here for more info.)
Using Visual Studio Express 2013 for Web
Set up bundling and caching as generally described here: http://www.asp.net/mvc/overview/performance/bundling-and-minification
In the VS Solution Explorer, individual file properties for .js and .css files are set to Build Action: Content. I don't know if this was specifically set or a default setting.
When deployed in Debug Mode, individual files are deployed to the destination server's directory structure as expected and the rendered code in the index.aspx head section has a long list of for each individual javascript and css file configured, again, as expected. When loaded, I can see that the files are being loaded individually. Everything works.
When deployed in Release Mode, however, individual files are still being deployed to the destination server's directory structure, non-bundled and non-minified. Index.aspx DOES reflect a rendered reference to each bundled "file" using . When loaded, I can see that things are being loaded via the bundle.
In Release Mode, the individual files deployed to the destination server's directory structure seem to be redundant, and certainly unwanted. However, if I remove them post-deploy I get reference errors. Similarly, if I change file properties for each file's Build Action: Content to Build Action: None, the aforementioned individual files aren't deployed in Release Mode OR Debug Mode and I get reference errors in both scenarios.
Question 1: Am I misunderstanding how bundling and minification works and these individual non-bundled, non-minified files are indeed required in Release Mode?
Question 2: If I understand correctly that these non-bundled, non-minified files are NOT necessary in Release Mode, how do I configure the deploy correctly such that they ARE deployed in Debug Mode and ARE NOT deployed in Release Mode AND I get no reference errors?
Answer 1: Bundling and minification are done at run-time, not at build, compile, or deploy time. The "bundle" that is downloaded is a virtual file, it doesn't actually exist anywhere on disk. Thus the original "source" files are needed.
Answer 2: Sorry but your understanding is not correct. The non-bundled/minified files are required in Release mode as they form the basis for creating the bundled/minified payload that is sent to the client.
When I try to run test with FlexUnit4 and IntelliJ, I get this error:
SecurityError: Error #2148: SWF file file:///C|/Users/LIC/Projects/ProgramJef/out/production/Flex%2DClient%2DTests/%5Fflexunit.swf cannot access local resource file:///C|/Users/LIC/Projects/ProgramJef/out/production/Flex%2DClient%2DTests/textLayout_1.1.0.604.swf. Only local-with-filesystem and trusted local SWF files may access local resources.
at flash.net::URLStream/load()
at flash.net::URLLoader/load()
at mx.core::CrossDomainRSLItem/load()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\CrossDomainRSLItem.as:240]
at mx.core::RSLListLoader/loadNext()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\RSLListLoader.as:184]
at mx.core::RSLListLoader/load()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\RSLListLoader.as:156]
at mx.preloaders::Preloader/initialize()[E:\dev\4.x\frameworks\projects\framework\src\mx\preloaders\Preloader.as:279]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:1925]
at mx.managers::SystemManager/initHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:2419]
I really wouldn't know what the problem is here, and I can't find anything on it online. Even on IntelliJ and FlexUnit4 there's not much to find...
You must allow the resulting SWF access to your file system. Set the Flashplayer trust settings in a file. On Linux this file must be in
~/.macromedia/Flash_Player/#Security/FlashPlayerTrust/
(for Windows there is a similar path somewhere) and create a file that lists the output path of your project, e.g.
/dev/myproject/target
/dev/anotherproject/target
In case 'target' is our output folder.
Did you set up your test sources folder right? In Project Settings under Modules, add Flex and click Flex and add Text Source Folders using the tree structure on the right hand side.
(IntelliJ 9.0.2)