Error deserializing Windows logs as PSObjects? - c#

Trying to deserialize Powershell logs using "PSSerializer.Deserialize(log) as PSObject;" but keep getting error:
"System.Xml.XmlException: 'Element 'Objs' with namespace name 'http://schemas.microsoft.com/powershell/2004/04' was not found. Line 1, position 2.'"
Log example:
"<Obj RefId=\"0\">
<MS>
<Obj N=\"PowerShell\" RefId=\"1\">
<MS>
<Obj N=\"Cmds\" RefId=\"2\">
<TN RefId=\"0\">
<T>System.Collections.Generic.List`1[[System.Management.Automation.PSObject, System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]</T>
<T>System.Object</T>
</TN>
<LST>
<Obj RefId=\"3\">
<MS> ......

Appending this worked for me:
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
..Log...
</Objs>

Related

Dnspy compilation error without editing the code

The 'ConnectionState' exists in both 'System.Data.Common, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
bool flag2 = this.sqlite_conn.State != ConnectionState.Open;
if (flag2)
{
this.sqlite_conn.Close();
this.sqlite_conn.Open();
}
Getting above error in this line of code while using dnspy.
Error code is CS0433 from main.cs
Check your project references and using statements and remove any unused ones.
Try to explicitly put the proper namespace in front of your enum, like:
System.Data.ConnectionState.Open;

UIAComWrapper assembly is throwing error while building solution

Automation solution is cleaning and building properly but while building it using build definition its throwing error,
Its checking with the file on location where we are saving the builded solution .dll files and throwing error:
Desktop\Pages\NewFieldPropertiesPage.cs(729,45): error CS1705: Assembly 'Aptean.Windows.Automation' with identity 'Aptean.Windows.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'UiaComWrapper, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'UiaComWrapper' with identity 'UiaComWrapper, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [C:\agent-DGA1BDT04TFS13_work\1\s\Respond.Test.Base\Respond.Test.Base.csproj]
This is how we define automation element:
and getting error findin "AutomationElement" and "PropertyCondition" which is coming from "System.Windows.Automation" assembly
``` {
``` get
``` {
``` AutomationElement root = AutomationElement.RootElement;
``` PropertyCondition PropApplicaionRoot = new PropertyCondition(AutomationElement.AutomationIdProperty, "MainForm");
``` AutomationElement ApplicationRoot = root.FindFirst(TreeScope.Subtree, PropApplicaionRoot);
``` PropertyCondition PropSideMenuRoot = new PropertyCondition(AutomationElement.AutomationIdProperty, "pnlObjectAndFieldDetails");
``` AutomationElement SideMenuRoot = ApplicationRoot.FindFirst(TreeScope.Subtree, PropSideMenuRoot);
``` PropertyCondition propEntitiesAndFields = new PropertyCondition(AutomationElement.NameProperty, "Boolean Field 135374");
``` AutomationElement OKButton = SideMenuRoot.FindFirst(TreeScope.Subtree, propEntitiesAndFields);
``` return OKButton;
``` }
``` }
Below is the error i am getting, one of the error statement:
Respond.Test.Base\Desktop\UIMap\SelectSkillPageMap.cs (30, 45)
Respond.Test.Base\Desktop\UIMap\SelectSkillPageMap.cs(30,45): Error CS1705: Assembly 'Aptean.Windows.Automation' with identity 'Aptean.Windows.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'UiaComWrapper, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'UiaComWrapper' with identity 'UiaComWrapper, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Actually we are checking in the correct file and solution was also building, while digging deep in the error mentioned,
It was only failing when building using the source solution in a VM, where when getting latest was not changing the reference file.
Deleted the solution from the location and then ran the VNext build has resolved the issue as this time it took the latest versions of .dll files from source.
Thanks.

Xamarin error cs0263 partial declarations must not specify base classes

I have already looked to similar answers and I don't know why I am still have this error:
Severity Code Description Project File Line Suppression State
Error CS0263 Partial declarations of 'MainPage' must not specify different base classes MyNavDraw.Android (my path ...)\MainPage.xaml.cs 13 Active
MainPage.xaml.cs:
namespace MyNavDraw
{
public partial class MainPage : MasterDetailPage
{
...
MainPage.xaml
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyNavDraw"
x:Class="MyNavDraw.MasterDetailPage">
<MasterDetailPage.Master>
...
What I tried so far:
In xaml I have replaced the tag to:
<we:MainPage ...
I checked "x:Class" and I think is correct the syntax, I have restarted the VS and I built again the solution.
I use Xamarin with VS 2017.
After a day (from this post question) I tried to put in comments the code of "MainPage.xaml" file. Then I saved it, I removed comments, saved it again and built the solution. I have a new error in built:
No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
I have an other problem when I debug the app to my physical phone (android).
In My.Nav.Draw.Droid.MainPage.xaml.g.cs I have an exception Unhandled error.
global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(MainPage));
What can be wrong?
Try adding your project name before the namespace name, also update your xmlns:local line too:
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyProjectName.MyNavDraw;assembly:MyProjectName"
x:Class="MyProjectName.MyNavDraw.MasterDetailPage">

XamlParseException was unhandled error

I'm trying my application, but an error comes up saying 'XamlParseException was unhandled". This is what is showing in the error window:
Cannot create instance of 'Shell' defined in assembly 'myProgram, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'myProgram;component/Shell.xaml' Line 1 Position 9.
Here's my line 1 in Shell.xaml:
"Window x:Class="myProgram.Shell"
Check your Shell.xaml. Looks like some XAML is breaking there. Check below things:
1) All bindings are ok.
2) Styles used are ok and present in style
3) any converter used are ok.

BindingFailure was detectedMessage with Mono.Addins

I'm using Mono.Addins for my project. Here my code :
static void Main()
{
string modulepath = String.Format("{0}\\{1}", Loader.GetCurrentDirectory(), "modules");
AddinManager.Initialize(modulepath, modulepath);
AddinManager.Registry.Update(null); //**Error in here**
}
I'm get an error :
The assembly with display name 'Mono.Addins.CecilReflector' failed to load in the 'Load' binding context of the AppDomain with ID 2. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Addins.CecilReflector, Version=0.6.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
File name: 'Mono.Addins.CecilReflector, Version=0.6.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
Any ideas to solve this problem. Thank in advance.
Yeah my problem is solved by copy file Mono.Addins.CecilReflector to application path. Thank Ieppie.

Categories

Resources