Skip to content

Conversion to netstandard fixes

petroslikidis edited this page May 25, 2021 · 1 revision

#Fixes for errors when converting to dotnet standard

  • BC30002 Type 'log4net.ILog' is not defined. Solution add reference to nuget packages for log4net

  • The following error are fixed by adding a reference to the nuget package System.Configuration.ConfigurationManager System.Configuration.ApplicationSettingsBase #ctor

System.Configuration.ConfigurationElement get_Item(System.String) set_Item(System.String,System.Object)

System.Configuration.ConfigurationManager get_AppSettings GetSection(System.String) OpenMachineConfiguration RefreshSection(System.String)

System.Configuration.ConfigurationPropertyAttribute #ctor(System.String)

System.Configuration.ConfigurationSection #ctor

System.Configuration.SettingsBase Synchronized(System.Configuration.SettingsBase)

#My.Resource.XXX Solution see https://sedders123.me/2017/08/30/read-an-embedded-resource-dotnet-standard-20/

#BC30451 'IIf' is not declared. It may be inaccessible due to its protection level. Solution: "if condition" only contains one part change IIf to If

#BC30451 'IsNothing' is not declared. It may be inaccessible due to its protection level. Solution: "If IsNothing(myThing) Then". Use instead: "If myThing Is Nothing then"

#BC30002 Type 'ude' is not defined. Solution; add reference to nuget packages for Ude.NetStandard

#CS1061 DataRow' does not contain a definition for 'Field' and no accessible extension method 'Field' accepting a first argument of type 'DataRow' could be found (are you missing a using directive or an assembly reference?). Solution; add reference to nuget package for System.Data.DataSetExtensions

#CS1061 'DataRow' does not contain a definition for 'Field' and no accessible extension method 'Field' accepting a first argument of type 'DataRow' could be found (are you missing a using directive or an assembly reference? Solution; add reference to nuget package for Microsoft.Data.SqlClient

#CS0246 The type or namespace name 'JsonPropertyAttribute' could not be found (are you missing a using directive or an assembly reference? Solution; Add Newtonsoft.Jason from nuget

#CS1503 Argument 1: cannot convert from 'string' to 'System.Type' Solution; changed:

private log4net.ILog log = log4net.LogManager.GetLogger("PCAxis.Menu.Implementations.OracleDatamodelMenu"); to

private log4net.ILog log = log4net.LogManager.GetLogger("PCAxis.Menu.OracleDatamodelMenu", "OracleDatamodelMenu");

I'm getting this: $exception {"Repository [PCAxis.Menu.OracleDatamodelMenu] is NOT defined."} og4net.Core.LogException , we'll look into it.

https://www.nuget.org/packages/ClosedXML/0.94.2/ ------ replaces ClosedXml.dll

#CS0103 The name 'XLCellValues' does not exist in the current context. Solution; replaced XLCellValues with XLDataType https://github.com/ClosedXML/ClosedXML/pull/565

#CS1674 'I XLWorksheet': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Solution; Remove using

Microsoft.VisualStudio.TestTools.UnitTesting does not include PrivateType "for" Core. Commented out those tests. ;