How to configure log4net for Xamarin - xamarin.forms

I am trying to use Log4Net for
Xamarin forms Project (Xamarin.Android and Xamarin.iOS)
to write a temp log file
How can I configure it?
where should I add appender code?
Is there permission required and what is the preferred path should I use for the log file for Android and iOS?

Related

Manage User Secrets in a custom config file

I have a Xamarin.Forms app. As it does not have built in configuration file, I used a solution found here:
https://www.andrewhoefling.com/Blog/Post/xamarin-app-configuration-control-your-app-settings
and here
https://github.com/HoeflingSoftware/XamarinAppSettings
So now I have a custom appsettings.json file. The secrets in the file are replaced in AzureDevops pipeline. But how can I run the app from Visual Studio (on an emulator)? If it was a web application, I would use Manage User Secrets functionality, which would store the secrets in my file system. So it would be used automatically when the app is running during development. But how can I do it for a Xamarin.Forms app with its custom json file?
You could use the Replace Text in Source Files task on Marketplace to replace text in your source, before you build the project. You can then store the secret as a secure value in the pipeline variables library.
We use a similar approach to update the build versions for Xamarin Apps and for providing access to the Signing files.

FileNotFoundException occurred while upload the photo/video using xamarin forms android

We are using xamarin essentials for camera permission. To capture photo/video we are using crossmedia nuget. After capture saved in local path then going to upload the photo/video. While upload the photo/video, I am getting below error in app center
System.IO.FileNotFoundException: Could not find file "/storage/emulated/0/Android/data/myproj/files/Movies/myproj/VIDEO_20200729_114115.mp4"
How to resolve this error?

File access denied for netstandard on UWP

I want to read files from UWP app, and using broadFileSystemAccess cap together with app's permissions set in settings. Access to files work great, but only when using Window.Storage api which is exclusive for WinRT api. My app use net standard 2.0 library, so files are readed via System.IO api, and that's where problem is, because access is denied for this api. What I determined, is that access depend on version of Microsoft.NETCore.UniversalWindowsPlatform (project's references). For v5.X access is granted, and System.IO api just works. For v6.X access is denied. Unfortunately I must use v6.X in my app and library. So question is: are there any switch / way to get access to files using System.IO api on Microsoft.NETCore.UniversalWindowsPlatform v6.X ?
File access denied for netstandard on UWP
As you mentioned, broadFileSystemAccess only support Window.Storage api within UWP platform, If you do want to use System.IO to access the file system, we suggest you use desktop bridge extension to approach that could access file with System.IO directly. For more info please refer desktop bridge official tutorial .

How to update web.config file of Asp.net using desktop application?

I have one desktop application to update the website whenever new release comes using this desktop app I want to update "Web.config" file of website programmatically.
I tried using:
Configuration configuration = WebConfigurationManager.OpenWebConfiguration("~");
but in desktop System.Web.Configuration namespace not found.
I have other way using read as XML and than proceed but its not efficient way for Add/Update/Delete configuration tag at any level.
Please any one suggest best way for this.

BizTalk : How to deploy a custom pipe line for all application

When I try to deploy a custom generic receive/send pipe line in Visual Studio.
I found it deploy to a default BizTalk application not for all applications.
Is there any way we can do it?
No, you cannot add new artifacts to the System application. The best you can do is Deploy to a 'shared' Application, then Reference that from any other Application that needs to use that Pipeline.

Resources