Android application output verbosity with Xamarin Forms - xamarin.forms

Every time I deploy Xamarin Forms to Android I get approximately 1000 [mono-assembly] messages
In the Project / Build settings, I have set the requisite option to 'Quiet'
I have also implemented an environment.txt file with following
MONO_LOG_LEVEL=error
MONO_LOG_MASK=gc
In spite of this, I cannot get rid of these messages
[monodroid-assembly] ZIP: local header offset: 35499804; data offset: 35499912; file size: 1683384
[monodroid-assembly] /data/app/Mono.Android.DebugRuntime-kjbSvJffIh6KuLyEXW4fQQ==/base.apk entry: assemblies/netstandard.dll
[monodroid-assembly] ZIP: local header offset: 37183296; data offset: 37183408; file size: 90624
[monodroid-assembly] /data/app/Mono.Android.DebugRuntime-kjbSvJffIh6KuLyEXW4fQQ==/base.apk entry: typemap.jm
[monodroid-assembly] ZIP: local header offset: 37274032; data offset: 37274128; file size: 1304780
[monodroid-assembly] /data/app/Mono.Android.DebugRuntime-kjbSvJffIh6KuLyEXW4fQQ==/base.apk entry: typemap.mj
Please can advise what am doing wrong?

Related

Issue to open Web Browser and show web page from Web API

I am currently developing an Web API programs with ASP.Net Core.
If someone calls a method from outside the Web API, it opens a specific web page(internal website).
When I run it from visual studio it works without errors, which occurs an error after I create a web site from IIS.
The below is my code.
Process p = System.Diagnostics.Process.Start(new ProcessStartInfo
{
FileName = #"C:\Program Files\Google\Chrome\Application\Chrome.exe",
Arguments = "http://localhost:5005/Popup/myPopUp/Index?Id=" + rtnVal + " --kiosk",
UseShellExecute = true
});
the below is the error I am getting
Faulting application name: Chrome.exe, version: 98.0.4758.81, time stamp: 0x61f44457
Faulting module name: chrome_elf.dll, version: 98.0.4758.81, time stamp: 0x61f44457
Exception code: 0x80000003
Fault offset: 0x0000000000032160
Faulting process id: 0x98b0
Faulting application start time: 0x01d81a0c3774c3af
Faulting application path: C:\Program Files\Google\Chrome\Application\Chrome.exe
Faulting module path: C:\Program Files\Google\Chrome\Application\98.0.4758.81\chrome_elf.dll
Report Id: 8a41bdb3-7f86-4784-8af6-b7154bf5b7e7
Faulting package full name:
Faulting package-relative application ID:

Unable to run blazor assembly project with hot reload feature enabled (.net 6 preview 5)

After installation net6 preview 3 and setting up the project to use net6 I have changed the launchSettings.json and added "hotReloadProfile": "blazorwasm" configuration.
When I run dotnet watch projects starts but I an unable to open the application because of error on client side (dotnet.6.0.0-preview.5.21301.5.js):
System.AggregateException: One or more errors occurred. (Failed to fetch dynamically imported module: https://localhost:5555/_framework/blazor-hotreload.js
TypeError: Failed to fetch dynamically imported module: https://localhost:5555/_framework/blazor-hotreload.js)
---> Microsoft.JSInterop.JSException: Failed to fetch dynamically imported module: https://localhost:5555/_framework/blazor-hotreload.js
TypeError: Failed to fetch dynamically imported module: https://localhost:5555/_framework/blazor-hotreload.js
at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__15`1[[Microsoft.JSInterop.IJSObjectReference, Microsoft.JSInterop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.JSInterop.dll:token 0x600008f+0x154
at Microsoft.AspNetCore.Components.WebAssembly.HotReload.WebAssemblyHotReload.InitializeAsync() in Microsoft.AspNetCore.Components.WebAssembly.dll:token 0x6000098+0xc6
at Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHost.RunAsyncCore(CancellationToken cancellationToken, WebAssemblyCultureProvider cultureProvider) in Microsoft.AspNetCore.Components.WebAssembly.dll:token 0x60000bd+0x1be
What else should be changed to enable hot reload feature?

AWS Lambda, adding firebase module and its dependencies to function for use with Angular Universal

I have an Angular Universal project deploying to AWS Lambda with SSR but I haven't managed to get firebase to work as a dependency with it. All the errors in the console are related to the firebase dependency & its dependencies.
Method #1: Include firebase module
package:
exclude:
- '!node_modules/firebase/**'
This adds firebase and now the errors moves to being unable to find dependencies of firebase and so on.
Method #2: Just include all node modules
This is an Angular project and I have 600mb+ of dependencies that build the app,
Method #3: Installing firebase inside my Angular 'dist' folder.
This will throw a runtime error:
Error: Failed to load gRPC binary module because it was not installed for the current system\nExpected directory: node-v64-linux-x64-glibc\nFound: [node-v64-win32-x64-unknown]\nThis problem can often be fixed by running \"npm rebuild\" on the current system\nOriginal error: Cannot find module '/var/task/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node'",
Method #4: serverless-webpack
This will throw error during sls deploy saying it can't find webpack config, but it's right there in the root directory next to the serverlesss.yml and it's already used by angular universal, I can't overwrite it with different configs for serverless-webpack plugin.
Method #5: Manual Lambda Layer
I have tried making a layer with a package.json that has firebase as a dependency, ran npm install, made an archive of the nodejs folder that has the node_modules folder and uploaded it as a layer + manually added to my function.
Same error as #1, can't find the firebase module, this would also be overwritten by the serverless framework on my next deploy.
Method #6: Lambda layer via serverless
I've tried to piece these articles together to get something working Article 1, Article 2, Article 3 and used the example from this github but switched moment with firebase.
But none of them worked, the serverless config:
layers:
firebaseLayer:
path: ../layers/firebase-layer
compatibleRuntimes:
- nodejs8.10
- nodejs10.x
package:
include:
- node_modules/**
Would throw: No file matches include / exclude patterns
I also have const firebase = require('firebase'); inside my endpoint handler.
I've been trying to get this working for two whole days and it has been beyond frustrating. Any help is appreciated.
Two possible solutions:
Use serverless-webpack with the following configuration:
# serverless.yaml
service: serverless-webpack-firebase
provider:
name: aws
runtime: nodejs10.x
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'us-east-1'}
plugins:
- serverless-webpack
package:
individually: true
custom:
webpack:
webpackConfig: "webpack.config.js"
includeModules: true
packager: "yarn"
functions:
withWebpack:
handler: handler.hello
// webpack.config.js
const path = require("path");
const slsw = require("serverless-webpack");
const nodeExternals = require("webpack-node-externals");
module.exports = {
entry: slsw.lib.entries,
target: "node",
mode: slsw.lib.webpack.isLocal ? "development" : "production",
performance: {
hints: false
},
resolve: {
extensions: [".js", ".json"]
},
externals: [nodeExternals()]
};
externals: [nodeExternals()] will remove all external dependencies from the bundle and includeModules: true will still add them to the zip under node_modules
Use a Lambda layer:
# layer yaml
service: firebase-layer
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'us-east-1'}
layers:
firebase:
path: ./layer
description: Layer with all the required dependencies to use firebase
compatibleRuntimes:
- nodejs8.10
- nodejs10.x
licenseInfo: MIT
retain: true
and
service: serverless-layer-firebase
provider:
name: aws
runtime: nodejs10.x
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'us-east-1'}
plugins:
- serverless-webpack
- serverless-pseudo-parameters
package:
individually: true
custom:
webpack:
webpackConfig: "webpack.config.js"
includeModules: false
packager: "yarn"
functions:
withLayer:
handler: handler.hello
layers:
- arn:aws:lambda:${self:provider.region}:#{AWS::AccountId}:layer:firebase:1
Same webpack.config.js, but this time with includeModules: false as we don't need the dependencies in the zip file (they are loaded with the layer).
Layer structure:
Repository is available here: https://github.com/erezrokah/serverless-webpack-firebase
See the differences in package size:

Symfony/Codeception Run Errors

I have a Symfony 2.4.4 site with simple Codeception (2.1.7) acceptance tests setup. When running the acceptance tests I get the following error:
[Codeception\Exception\ConfigurationException]
AcceptanceTester class doesn't exist in suite folder.
Run the 'build' command to generate it
The AcceptanceTester class does exist in the tests/acceptance directory. If I run a build I get the following error:
[Codeception\Exception\ConfigurationException]
Configuration file could not be found.
Run `bootstrap` to initialize Codeception.
The codeception.yml file does exist and contains the following:
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
settings:
bootstrap: _bootstrap.php
colors: false
memory_limit: 1024M
coverage:
enabled: true
remote: true
include:
- app/*
exclude:
- app/cache/*
include:
...
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/_data/dump.sql
If I run a bootstrap it confirms this:
Project is already initialized in '.'
acceptance.suite.yml contains:
class_name: AcceptanceTester
modules:
enabled:
- AcceptanceHelper
Any suggestions?
AcceptanceTester.php file should be in tests/_support directory.
Run codecept build to regenerate Tester files.
You have no modules enabled acceptance.suite.yml.
You have to enable one of Symfony2, PhpBrowser and WebDriver.
Your site uses an old version of Symfony and it can cause issues for Codeception if Symfony2 module is used, so I recommend to test it using PhpBrowser or WebDriver.
I believe, you need to run command codecept bootstrap.
I had this problem, and I realise that I ran the codecept bootstrap but the vendor and the tests folders were in a wrong directory.
I followed this video and it helped me.

Use AppDomain.Load(byte[]) without loading from file?

I crack my mind... I trying to manually load and unload domain with one assembly:
var domainInfo = new AppDomainSetup
{
PrivateBinPath = baseDir
};
_hostedDomain = AppDomain.CreateDomain("Domain", null, domainInfo);
_hostedDomain.UnhandledException += HostedDomainUnhandledException;
_hostedDomain.DomainUnload += _hostedDomain_DomainUnload;
var bytes = File.ReadAllBytes("Facade.dll"); // Loads facade from hosts location.
_hostedDomain.Load(bytes);
string asmName = Path.Combine(baseDir, Properties.Settings.Default.AssemblyName);
bytes = File.ReadAllBytes(asmName);
var entryPoint = _hostedDomain.Load(bytes); // exception here!
And what I see:
When I tryed to load assembly I see that system load it from CurrentDir/assemblyname.dll (and fails).
Exception: System.IO.FileNotFoundException:
Could not load file or assembly Worker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:#Development!test\trunk\bin\Debug\Bootstrapper.vshost.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///D:/#Development/!test/trunk/bin/Debug/Worker.DLL.
LOG: Attempting download of new URL file:///D:/#Development/!test/trunk/bin/Debug/Worker/Worker.DLL.
LOG: Attempting download of new URL file:///D:/#Development/!test/trunk/bin/Debug/Worker.EXE.
LOG: Attempting download of new URL file:///D:/#Development/!test/trunk/bin/Debug/Worker/Worker.EXE.
BTW. It is impossible to use LoadFrom due to limitations (I've got the problem with XML serialization....).
Wat the hell .NET doing in this routines?
Why it is so hard to load and unload domain?
Thanks for the help!

Resources