AqlaSolutions / AqlaSerializer

Binary serializer with full .NET support!
http://www.aqla.net
Other
17 stars 3 forks source link

How to build AqlaSerializer? #22

Closed inethui closed 2 years ago

inethui commented 2 years ago

I want to use AqlaSerializer to replace the .NET binary formatter we are currently using.

It would be very helpful if I can debug into AqlaSerializer's source code. I have downloaded the source code from its github site. The download includes a very short description about the build, which I could not follow. If you can show me some instructions of how to build it, it would be great.

AqlaSolutions commented 2 years ago

You can use prebuilt nuget packages. If you need to debug the source code please specify what exactly issues you have in following the instructions. Also mind that some platforms are not supported in latest VS or require installing additional SDKs. Though you might not need to build for those platforms at all. And you don't need to build all projects in the solution.

AqlaSolutions commented 2 years ago

I updated the build instruction, please try to follow it and ask here if you have issues: https://github.com/AqlaSolutions/AqlaSerializer/blob/master/READ%20IF%20YOU%20WANT%20TO%20BUILD.txt

inethui commented 2 years ago

I’m trying to use .NET reflection to build the Aqla metadata model. However, when I ran “CompileInPlace”, it failed with error: ProtoException: Type System.Double can't be handled as reference

I checked my code, there is no place that a double type or field is set with “metaType.AsReferenceDefault = true”. How to trouble-shoot this kind of issue? Is there a debug flag to turn on more detailed error messages?

Regards,

Hui Lin

From: Vladyslav Taranov Sent: Wednesday, March 23, 2022 3:03 AM To: AqlaSolutions/AqlaSerializer Cc: inethui; Author Subject: Re: [AqlaSolutions/AqlaSerializer] How to build AqlaSerializer? (Issue #22)

You can use prebuilt nuget packages. If you need to debug the source code please specify what exactly issues you have in following the instructions. Also mind that some platforms are not supported in latest VS or require installing additional SDKs. Though you might not need to build for those platforms at all. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

AqlaSolutions commented 2 years ago

I can't answer your question without a reproducable example.

You don't need to use any reflection to call methods inside AqlaSerializer. You can use RuntimeTypeModel API to configure things.

inethui commented 2 years ago

How to run the build? I loaded "AqlaSerializer.sln” and tried to build the solution but this failed with many errors:

Severity Code Description Project File Line Suppression State Error CS0534 'EventGen.EventInfoProxy' does not implement inherited abstract member 'EventInfo.IsNonPrivate.get' RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 254 Active Error CS0534 'EventGen.EventInfoProxy' does not implement inherited abstract member 'EventInfo.IsPublic.get' RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 254 Active Error CS0534 'EventGen.EventInfoProxy' does not implement inherited abstract member 'EventInfo.IsStatic.get' RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 254 Active Error CS0534 'EventGen.EventInfoProxy' does not implement inherited abstract member 'MemberInfo.GetCurrentToken()' RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 254 Active Error CS0534 'EventGen.EventInfoProxy' does not implement inherited abstract member 'MemberInfo.IsBaked.get' RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 254 Active Error CS0115 'EventGen.EventInfoProxy.IsPublic': no suitable method found to override RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 277 Active Error CS0115 'EventGen.EventInfoProxy.IsNonPrivate': no suitable method found to override RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 278 Active Error CS0115 'EventGen.EventInfoProxy.IsStatic': no suitable method found to override RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 279 Active Error CS0115 'EventGen.EventInfoProxy.IsBaked': no suitable method found to override RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 280 Active Error CS0115 'EventGen.EventInfoProxy.GetCurrentToken()': no suitable method found to override RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 281 Active Error CS0016 Could not write to output file 'o:\Dropbox\CodeProjects\RunSharp\src\RunSharp\RunSharp.xml' -- 'Could not find a part of the path 'o:\Dropbox\CodeProjects\RunSharp\src\RunSharp\RunSharp.xml'.' RunSharp (netstandard2.1) D:\RunSharp\src\RunSharp\CSC 1 Active Error CS7027 Error signing output with public key from file 'runsharp_key.snk' -- File not found. RunSharp (netstandard2.1) D:\RunSharp\src\RunSharp\CSC 1 Active Error CS0246 The type or namespace name 'AqlaSerializer' could not be found (are you missing a using directive or an assembly reference?) SO11895998_Portable D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\SO11895998_Portable\DTOs.cs 2 Active Error CS7027 Error signing output with public key from file '..\AqlaSerializer2Key.snk' -- File not found. SampleDto D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\SampleDto\CSC 1 Active Error CS0006 Metadata file 'D:\RunSharp\src\RunSharp\bin\Debug\netstandard2.1\RunSharp.dll' could not be found RunSharp.Tests (net45) D:\RunSharp\src\RunSharp.Tests\CSC 1 Active Error CS0006 Metadata file 'D:\RunSharp\src\RunSharp\bin\Debug\net35\RunSharp.dll' could not be found aqlaserializer (netstandard2.1) D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\CSC 1 Active Error CS0006 Metadata file 'D:\RunSharp\src\RunSharp\bin\Debug\netstandard2.1\RunSharp.dll' could not be found aqlaserializer (netstandard2.1) D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\CSC 1 Active Error CS0006 Metadata file 'D:\RunSharp\src\RunSharp\bin\Debug\net20\RunSharp.dll' could not be found aqlaserializer (netstandard2.1) D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\CSC 1 Active Error CS0006 Metadata file 'D:\RunSharp\src\RunSharpIKVM\bin\Debug\RunSharp.dll' could not be found aqlaserializer_IKVM D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net_IKVM\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found DataPipeline D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\DataPipeline\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\netstandard2.1\aqlaserializer.dll' could not be found Examples (net5.0) D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\Examples\CSC 1 Active Error CS0006 Metadata file 'D:\RunSharp\src\RunSharp\bin\Debug\netstandard2.1\RunSharp.dll' could not be found Examples (net5.0) D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\Examples\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found LateLoaded D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\LateLoaded\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found MonoSerBuilder D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\MonoSerBuilder\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found MyDtoLayer D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\BasicHttp\MyDtoLayer\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found Net45Dto D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\Net45Dto\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found QuickStart D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\QuickStart\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net30\aqlaserializer.dll' could not be found SqlClr D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\SqlClr\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found TestWcfDto D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\TestWcfDto\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found aqlaserializer.Enyim D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net.Enyim\protobuf-net.Enyim\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found aqlaserializer.Extensions D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net.Extensions\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\netstandard2.1\aqlaserializer.dll' could not be found aqlaserializer.unittest (net5.0) D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net.unittest\CSC 1 Active Error CS0006 Metadata file 'D:\RunSharp\src\RunSharp\bin\Debug\netstandard2.1\RunSharp.dll' could not be found aqlaserializer.unittest (net5.0) D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net.unittest\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\SampleDto\bin\Debug\SampleDto.dll' could not be found aqlaserializer.unittest (net5.0) D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net.unittest\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net_IKVM\bin\Debug\aqlaserializer.dll' could not be found precompile D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\precompile\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found HttpClient D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\BasicHttp\HttpClient\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\BasicHttp\MyDtoLayer\bin\Debug\MyDtoLayer.dll' could not be found HttpClient D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\BasicHttp\HttpClient\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found HttpServer D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\BasicHttp\HttpServer\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\BasicHttp\MyDtoLayer\bin\Debug\MyDtoLayer.dll' could not be found HttpServer D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\BasicHttp\HttpServer\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found TestWcfServer D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\TestWcfServer\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\TestWcfDto\bin\Debug\TestWcfDto.dll' could not be found TestWcfServer D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\TestWcfServer\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found aqlaserializer.Enyim.Tests D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net.Enyim\protobuf-net.Enyim.Tests\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net.Enyim\protobuf-net.Enyim\bin\Debug\aqlaserializer.Enyim.dll' could not be found aqlaserializer.Enyim.Tests D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net.Enyim\protobuf-net.Enyim.Tests\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net_IKVM\bin\Debug\aqlaserializer.dll' could not be found precompile.tests D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\precompile.tests\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\precompile\bin\Debug\precompile.exe' could not be found precompile.tests D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\precompile.tests\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\protobuf-net\bin\Debug\net35\aqlaserializer.dll' could not be found TestWcfClient D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\TestWcfClient\CSC 1 Active Error CS0006 Metadata file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\TestWcfDto\bin\Debug\TestWcfDto.dll' could not be found TestWcfClient D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\TestWcfClient\CSC 1 Active Error CS1729 'EventInfo' does not contain a constructor that takes 0 arguments RunSharp_IKVM D:\RunSharp\src\RunSharpShared\EventGen.cs 258 Active Error Application Configuration file "app.config" is invalid. Could not find file 'D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\DataTableSerializer\app.config'. DataTableSerializer D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0\DataTableSerializer\app.config
Error Project '..\protobuf-net\aqlaserializer.csproj' targets 'netstandard2.1;net30;net35'. It cannot be referenced by a project that targets '.NETPortable,Version=v4.0,Profile=Profile158'. SignedDto

Regards,

Hui Lin

From: Vladyslav Taranov Sent: Wednesday, March 23, 2022 3:33 AM To: AqlaSolutions/AqlaSerializer Cc: inethui; Author Subject: Re: [AqlaSolutions/AqlaSerializer] How to build AqlaSerializer? (Issue #22)

I updated the build instruction, please try to follow it and ask here if you have issues: https://github.com/AqlaSolutions/AqlaSerializer/blob/master/READ%20IF%20YOU%20WANT%20TO%20BUILD.txt — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

inethui commented 2 years ago

I downloaded “RunSharp” source file “runsharp-v.1.0.23.zip”, where should I put its content? My AqlaSerializer source code is in “D:\AqlaSerializer\AqlaSerializer-v.2.0.1.0”.

Thanks

Hui Lin

From: Vladyslav Taranov Sent: Wednesday, March 23, 2022 3:33 AM To: AqlaSolutions/AqlaSerializer Cc: inethui; Author Subject: Re: [AqlaSolutions/AqlaSerializer] How to build AqlaSerializer? (Issue #22)

I updated the build instruction, please try to follow it and ask here if you have issues: https://github.com/AqlaSolutions/AqlaSerializer/blob/master/READ%20IF%20YOU%20WANT%20TO%20BUILD.txt — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

AqlaSolutions commented 2 years ago

Don't build whole solution. You should try to build only one project: aqlaserializer.csproj. RunSharp files should be in ..\RunSharp\src\RunSharp which is D:\AqlaSerializer\RunSharp\src\RunSharp in your case. You can verify the path from Solution Explorer (RunSharp is in the solution and should be loaded). Also you won't be able build until you generate snk keys.

inethui commented 2 years ago

Vladyslav,

Thanks for updating the build instruction. I’m following it to build the downloaded source code. There is a problem, .NET Framework Developer Pack 4.5 is no longer supported and not available for download. So I downloaded and installed version 4.5.2. However, AqlaSerializer doesn’t seem to accept it, and insist on finding 4.5. This is the error message:

Error MSB3644 The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

Is there a way to let AqlaSerializer use .NET Framework 4.5.2?

Regards,

Hui Lin

From: Vladyslav Taranov Sent: Wednesday, March 23, 2022 3:33 AM To: AqlaSolutions/AqlaSerializer Cc: inethui; Author Subject: Re: [AqlaSolutions/AqlaSerializer] How to build AqlaSerializer? (Issue #22)

I updated the build instruction, please try to follow it and ask here if you have issues: https://github.com/AqlaSolutions/AqlaSerializer/blob/master/READ%20IF%20YOU%20WANT%20TO%20BUILD.txt — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

AqlaSolutions commented 2 years ago

You don't need to search any SDKs online. When opening the solution VS 2022 prompts to install everything needed, including the proper version .NET Framework.

AqlaSolutions commented 2 years ago

Please reopen if you need more help

AqlaSolutions commented 2 years ago

I pushed some changes in an effort to simplify the build process. You should be able to build solution except MonoDroid project after installing everything what Visual Studio suggests and putting PEVerify.exe into the Tools directory.