I need to handle bitcoin in my unity project
I tried to install some nuget packages to support that
like this for example : https://github.com/blockchain/api-v1-client-csharp
but I always get this error
Could not install package 'BlockchainAPI 2.0.0'. You are trying to
install this package into a project that targets
'.NETFramework,Version=v4.0', but the package does not contain any
assembly references or content files that are compatible with that
framework. For more information, contact the package author.
unfortunately - no current unity3d plugins that support bitcoin yet
any suggestions , solutions ?
The plugin is using .NET version that is > Unity's supported .NET version.
The easiest solution I know about is to download the project directly from the link you posted.Delete any file that is NOT a C# file(.cs). Extract those folders with the remaining files and put them in your Unity project. Now look for errors. If you find any script with an error or script that uses C# 4 classes, modify it and fix the errors by hand.
This is easier than trying to implement your own bitcoin API from scratch.
NOTE: The only reason I recommend this method is because I looked inside the project and there were no DLL files inside it. So it is possible to port it if there is no DLL file in the API. Assuming there were DLL files compile with C# 4, then that would be a problem.
There's a beta edition of Unity that now supports a newer Mono version, which can let you compile .NET 4.5.2 (or older) projects.
I recommend you Nicolas Dorier's NBitcoin library for this then.
Related
I am new to windows app development. I want to use OxyPlot in UWAP C++/Xaml project. I am able to use it in C# based project but not in C++/Xaml project. First I tried to add it using Nuget package manager but it didn't install. Then I followed this (https://social.msdn.microsoft.com/Forums/en-US/8b77c775-21e0-4b43-b9f3-fb3777c43212/adding-libraries-and-use-them?forum=winappswithnativecode). In this Windows runtime component (with OxyPlot) is created in C# and used in C++ project. Here I am able to build the project but app crashes saying OxyPlot (added in C# project) not found.
Can someone please guide me. Regards
This may not 100% apply but it should. I was not trying to do this: "Use OxyPlot in Windows Universal app c++/xaml project". But I was tyring to use OxyPlot in a C++ .Net class so that it could do somethings fast, and eventually pass things back to a C# Class or WPF form. The idea I needed to know was could I create an OxyPlot.DataPoint array in C++ then put it into a C# Double array or an List in C# fast. And I can do that now fast! I hope this approach might help someone here doing this. I don't know how easy it is to use this technique to be able to use the opti chart in a C++ app or not. But if the GUI is done in C# this approach works.
I was getting the error: "You are trying to install this package into a project that targets 'native,Version=v0.0', but the package does not contain
any assembly references or content files that are compatible with that framework." when I tried to install OptiPlot.WPF or the NuGet.Commandline.
This may not be a complete solution for everyone's needs, but it worked for me. I found a "cheatin" way of getting OptiPlot.WPF into a sample C++.Net project. I had a C# main program project in my solution - I installed the package there:
Install-Package OxyPlot.Wpf -Version 2.0.0
Then I copied the packages.config file and the packages folder from there to my C++ .Net Class Library Project. Then I edited the packages.config file and took something out that didn't apply, and I probably took out a package in packages that wasn't needed. Then I added my references in the C++ .Net Class Library Project to packages/OxyPlot.Wpf.2.0.0 folder.
Now I could use the OxyPlot inside of C++! Cool!
I am building a new project in ASP.NET 5.
In my solution I have added a new Class Library (Package) project.
I right click on this project and choose for Manage Nuget packages to install PetaPoco.Core.
When I install everything seems fine except that the PetaPoco.cs file is not in my project.
In my references I se the PetaPoco version 5.1.171 installed.
Is this something different then a normal class library and do I need to use something else in order to use the installed PetaPoco class or is it a problem during the installation?
I have removed and reinstalled this but still the same.
Someone that can help me out?
/Michael
It looks like the PetaPoco.Core package isn't setup to be used in portable class libraries (PCLs).
Including content files in PCLs like the Models folder that PetaPoco.Core creates requires a different NuGet setup than a regular project. Documentation on this can be found on NuGet. I downloaded their package directly and can confirm that it is not setup in the way the linked resource describes.
It may be that the project requires features that are not available yet cross-platform, or they simply haven't had time to make changes to support PCLs, or some other reason that I am not aware of.
NuGet packages are usually installed as DLLs in the bin folder of your project, with the needed references also added automatically to the project. They usually don't include source files. You may find sources - if available - on the package/project website.
Visual Studio IntelliSense will pick up the DLLs and show what it can about the classes and methods inside, including comments and method signatures.
See here for a tutorial, including how to build your own NuGet packages.
EDIT: PetaPoco is the exception that does add a .cs file... see comment below.
I want to create a DLL from a JAR for use in Unity.
I create a jar file using JavaSE-1.7, then I create the dll from it using ikvmc v7.2.4630.5
When I use this dll in a new C# Windows application it works fine without any exceptions or errors, but when I use it in Unity it also works even though I'm getting the following TypeLoadException:
Could not load type 'java.util.Date' from assembly IKVM.OpenJDK.Core
But although this works, Unity won't export or build my project due to this exception. How can I get around this?
EDIT: Ok the only way I can get this to work is if I use JRE 1.5 and an older version of IKVM like 0.28 which doesn't solve my problem because some functionality from JRE 1.7 is not supported in JRE 1.5
Despite this is an old question, I leave some advices for future reference:
try to use the last version of IKVM (8.0 at time of writing).
Go to: Edit -> Project Settings -> Player. Under Other settings for PC / Mac change the API Compability Level from ".NET 2.0 Subset" to ".NET 2.0". Recompile.
Copy all of the DLLs provided with IKVM inside the Assets folder of your project (NOT in a subfolder).
All of the Java versions are supported (even Java 8, see Release Notes).
I would like to use the following code in my program (http://sshnet.codeplex.com/)SFTP
I downloaded it and put into the same folder where my C# project is. I aslo added code:
using Renci.SshNet;
using Renci.SshNet.Sftp;
Now I need to tell Visual Studio where to look for it. I tried "Add Reference", but what I downloaded contains only files with extension .cs no .dll.
What do I do next?
I read a couple of books about C# (By Troelsen and Michaelis), but all this assebly business is not clear to me.
Instead of downloading the source (the link entitled SshSource), try a binary link (either the 4.0 or 3.5, depending on what .NET CLR version you are targeting).
The binary links will provide dlls. Then, you can use Add Reference to link the dll in your project.
Binary distributions are what 3rd-party projects make available for use. These are usually versioned by the project and stabilized before large public release. These distributions give you the most stable component to use.
The source distribution provides all the source files. You can use/modify the source (depending on the license), however, this requires you to compile before use.
NuGet is a great way to use and manage packages for .NET. SSH.NET also has a NuGet Package. If you use NuGet, this would be the preferred way to consume the binary distribution.
Compile the code in order to get an assembly (.dll/.exe file). Then use "Add Reference".
Good luck!
The source contains a .csproj. Just add the project to your solution and then Add Reference > Solution > Projects
Instead of downloading source code, you need a compiled dll assembly, which can be found on Downloads tab. Grab either 'SshNet 4.0 Binary' or 'SshNet 3.5 Binary' depending on .NET Framework version you're using.
All the other steps you mentioned are correct.
I would use nuget to download and install this package within visual studio. Looks like they have a package for it.
https://www.nuget.org/packages/SSH.NET/
If you are not familiar with NuGet it is a package management system for visual studio that will automatically download and install the references for you. Check it out here:
https://www.nuget.org/
I have recently acquired the student licence of Mono Android from Xamarin.
After making a simple project, i decided to start using some DLL's i am familiar with such as Json.Net and H.A.P on my Android Application (mono project), and that's when the problems started.
After trying to pull those references from NuGet, they failed since the "Android Application" project is not known leading to no .dll installed (NuGet tries to match the project type with the correct .dll to be downloaded be it WindowsPhone, .NET4, .NET 3.5 and so on).
So i moved on to mannually referencing the libraries, since i have them downloaded on my PC. Referencing Works, but as soon as i try to access the HtmlAgilityPack it raises an exception.
Error CS0012:
The type 'System.Xml.XPath.IXPathNavigable' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System.Xml, Version=x.x.x.x, Culture=neutral
The exception is raised on the first execution of the code because of J.I.T compilation of .NET, i know this.
Question:
How can i use my "so loved" .dlls on my Mono Android Project?
Do i need the source code of those libraries in order to use them on my projects?
Thanks in Advance
In order to recompile an assembly you will need the source.
To see what assemblies are provided by Xamarin.Android and Xamarin.iOS you can visit these two pages:
http://docs.xamarin.com/guides/android/advanced_topics/assemblies
http://docs.xamarin.com/guides/ios/advanced_topics/assemblies
One way to recompile it would be to make a Android Class Library or iPhone Class Library and add a link to all the files in the original source and then compile it. Or when Xamarin have their PCL support done, do something similar just in a PCL so that you have one DLL targeting multiple platforms.
You may also find this post useful, which briefly describes how to compile HtmlAgilityPack against Xamarin.Android: http://forums.xamarin.com/discussion/comment/2139/#Comment_2139 You might need to alter some things as this is from December 2012, since then things might have changed.