The realm dot net base example does not compile - realm

I am having trouble at getting the example "QuickJournal" to compile on iOS. The code compiles OK, but fails during the Fody step.
Goals
Try out the example application for .NET through the following
- Pull the repository
- Open the solution in examples/QuickJournal
- Compile and test
Expected Results
Smooth compilation & testing experience
Actual Results
Fody out of memory exception
Steps to Reproduce
See the setup, follow steps
I am using the latest Xamarin/Visual Studio Mac/XCode
Code Sample
The regular realm source code
Version of Realm and Tooling
git clone https://github.com/realm/realm-dotnet.git
git checkout 8f5e36ffd91e06b9c60b91f9de3fb312b411a4a4
The exception I am getting is
Fody: Found debug symbols at '~/realm-dotnet/examples/QuickJournal/QuickJournal/obj/Debug/QuickJournal.pdb'.
MSBUILD : error : Fody: An unhandled exception occurred:
MSBUILD : error : Exception:
MSBUILD : error : Out of memory
MSBUILD : error : StackTrace:
MSBUILD : error : at (wrapper alloc) System.Object:AllocVector (intptr,intptr)
MSBUILD : error : at Microsoft.Cci.Pdb.MsfDirectory..ctor (Microsoft.Cci.Pdb.PdbReader reader,
See log file
RealmCompilelog.txt

Realm 1.2.1 addresses that by using an updated version of Fody.
Answer for older Realm versions:
This is caused by a Cecil bug with Mono 5.0. As Realm depends on Fody, which uses Cecil, compilation will fail for project referencing it. Until new Cecil and Fody versions are released, the workaround is to revert to Mono 4.8:

Related

azure devops dotnet core app : why "dotnet restore" job fails?

I have an azure pipeline for a dotnet core app, and when it executes this job , i got:
2023-02-16T17:02:26.7325011Z 1>C:\hostedtoolcache\windows\dotnet\sdk\6.0.406\NuGet.targets(132,5): error : '6.1.6,6.2.3' is not a valid version string. [D:\a\1\s\WebApp\WebApp.csproj]
2023-02-16T17:02:26.7944327Z System.ArgumentException: '6.1.6,6.2.3' is not a valid version string.
2023-02-16T17:02:26.7945294Z at NuGet.Versioning.VersionRange.Parse(String value, Boolean allowFloating)
2023-02-16T17:02:26.7946303Z at NuGet.Versioning.VersionRange.Parse(String value)
2023-02-16T17:02:26.7947172Z at NuGet.Commands.MSBuildRestoreUtility.AddPackageReferences(PackageSpec spec, IEnumerable`1 items, Boolean isCpvmEnabled)
2023-02-16T17:02:26.7948010Z at NuGet.Commands.MSBuildRestoreUtility.GetPackageSpec(IEnumerable`1 items)
2023-02-16T17:02:26.7948973Z at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
2023-02-16T17:02:26.7949761Z at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
2023-02-16T17:02:26.7950412Z at NuGet.Commands.MSBuildRestoreUtility.GetDependencySpec(IEnumerable`1 items)
2023-02-16T17:02:26.7951037Z at NuGet.Build.Tasks.RestoreTask.ExecuteAsync(ILogger log)
2023-02-16T17:02:26.7951399Z Done executing task "RestoreTask" -- FAILED.
2023-02-16T17:02:26.7951774Z 1>Done building target "Restore" in project "WebApp.csproj" -- FAILED.
2023-02-16T17:02:26.7961752Z 1>Done Building Project "D:\a\1\s\WebApp\WebApp.csproj" (Restore target(s)) -- FAILED.
2023-02-16T17:02:26.8025517Z
2023-02-16T17:02:26.8026122Z Build FAILED.
2023-02-16T17:02:26.8029367Z
2023-02-16T17:02:26.8030306Z "D:\a\1\s\WebApp\WebApp.csproj" (Restore target) (1) ->
2023-02-16T17:02:26.8030690Z (Restore target) ->
2023-02-16T17:02:26.8031149Z C:\hostedtoolcache\windows\dotnet\sdk\6.0.406\NuGet.targets(132,5): error : '6.1.6,6.2.3' is not a valid version string. [D:\a\1\s\WebApp\WebApp.csproj]
2023-02-16T17:02:26.8031458Z
2023-02-16T17:02:26.8031674Z 0 Warning(s)
2023-02-16T17:02:26.8031958Z 1 Error(s)
2023-02-16T17:02:26.8033465Z
2023-02-16T17:02:26.8034195Z Time Elapsed 00:00:00.91
2023-02-16T17:02:26.8611133Z ##[error]Error: The process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe' failed with exit code 1
2023-02-16T17:02:26.8625609Z ##[error]Packages failed to restore
2023-02-16T17:02:26.8631699Z Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
2023-02-16T17:02:26.8710382Z ##[section]Finishing: Restore Nuget Packages
I am unable to figure out why, any help please ?
In your error you can see it says
System.ArgumentException: '6.1.6,6.2.3' is not a valid version string.
And indeed your problem is actually in this file: https://github.com/MohamedBenighil/WebAppWithDatabaseDemo/blob/055037f9f22bdac6db2edadeab01b412f3c4dca2/WebApp/WebApp.csproj
where you have that invalid Version string in your package reference:
<PackageReference Include="System.Management.Automation" Version="6.1.6,6.2.3" />

Azure Functions Errro - Could not load file or assembly System.Configuration.ConfigurationManager, Version=4.0.3.0

I am working on Azure Functions and these are created in .Net Core version 3.1 whereas the other libraries are written in .Net Framework 4.8. While executing the functions, I am getting following error -
System.Private.CoreLib: Exception while executing function: XXXXXX. System.Private.CoreLib: One or more errors occurred. (The type initializer for 'XXXXX' threw an exception.). XXXX.Service: The type initializer for 'XXXXX.Service.XXXXX' threw an exception. XXXX.Service: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Suggestions would be appreciated.
You can work around the issue by adding the _FunctionsSkipCleanOutput to the project file.
<PropertyGroup>
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
Make sure your package version exists. From this it seems that there is no package version in which you reported an error, check this link:
https://www.nuget.org/packages/System.Configuration.ConfigurationManager/5.0.0-preview.1.20120.5
Click Version History, and you will find:

Qt VS2015 projects load Error

Just (30.08.2016) got Qt dev-branch, compiled with nmake and got libraries.
But when I create the VS2015 projects (qmake -tp vc -recursive qt.pro) and try to open them, VS2015 states an exception while loading:
F:\dev\env64\Qt5\qtbase\examples\gui\analogclock\analogclock.vcxproj :
error : An exception was thrown while initializing part
"Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator".
Does anyone has similar errors? And is there an solution?

v-play installation - Cant deploy on desktop and device

I’ve just installed v-play but when i compile to desktop i get error :-1: error: cannot find -lGL and exits.
Then if i compile to android it will compile and install but the it never successfully opens the app and it exits on deployment.
These are the warnings i get :
Warnings while parsing QML type information of /home/theguy/V-Play/5.5/android_armv5/qml/QtCanvas3D:
/home/theguy/V-Play/5.5/android_armv5/qml/QtCanvas3D/plugins.qmltypes:1:24: Reading only version 1.1 parts.
/home/theguy/V-Play/5.5/android_armv5/qml/QtCanvas3D/plugins.qmltypes:10:5: Expected only Component and ModuleApi object definitions.
Warnings while parsing QML type information of /home/theguy/V-Play/5.5/gcc_64/qml/QtWebSockets:
/home/theguy/V-Play/5.5/gcc_64/qml/QtWebSockets/plugins.qmltypes:1:24: Reading only version 1.1 parts.
/home/theguy/V-Play/5.5/gcc_64/qml/QtWebSockets/plugins.qmltypes:10:5: Expected only Component and ModuleApi object definitions.
Warnings while parsing QML type information of /home/theguy/V-Play/5.5/gcc_64/qml/QtCanvas3D:
/home/theguy/V-Play/5.5/gcc_64/qml/QtCanvas3D/plugins.qmltypes:1:24: Reading only version 1.1 parts.
/home/theguy/V-Play/5.5/gcc_64/qml/QtCanvas3D/plugins.qmltypes:10:5: Expected only Component and ModuleApi object definitions.
And these are the compile issues I get:
15:03:42: Packaging error: Command “/home/theguy/Android/Sdk/platform-tools/adb -s 9cc172fdedea pull /system/bin/sh: readlink: not found /home/theguy/Desktop/Projects/v-play/ConverseLanguages/build-ConverseLanguages-Android_for_armeabi_GCC_4_9_Qt_5_5_0-Release/app_process” failed.Exit code: 1
15:03:42: Package deploy: Failed to pull “/system/bin/sh: readlink: not found” to “/home/theguy/Desktop/Projects/v-play/ConverseLanguages/build-ConverseLanguages-Android_for_armeabi_GCC_4_9_Qt_5_5_0-Release/app_process”.
15:03:42: Package deploy: Running command “/home/theguy/Android/Sdk/platform-tools/adb -s 9cc172fdedea pull /system/lib/libc.so /home/theguy/Desktop/Projects/v-play/ConverseLanguages/build-ConverseLanguages-Android_for_armeabi_GCC_4_9_Qt_5_5_0-Release/libc.so”.
Error while building/deploying project ConverseLanguages (kit: Android for armeabi (GCC 4.9, Qt 5.5.0))
When executing step “Deploy to Android device”
please see here for a reply: https://v-play.net/developers/forums/t/installation-problem-error-cannot-find-lgl/
Cheers, Chris

Getting error while deploying WAR file

I am getting below error while deploying war file .Here JDK version on development machine and deployment machines is same then also i am getting this error.
[05/Jun/2013:11:20:42] failure ( 5712): WebModule[/cover]: WEB2671: Error configuring application listener of class com.bt.cover.ContextListener
java.lang.UnsupportedClassVersionError: com/bt/cover/ContextListener (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1717)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:983)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1431)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3349)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3743)
at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
Based on this answer: Unsupported major.minor version 49.0, it looks like you may be running on a different JVM from what you used to compile your code. Hope this helps.

Resources