Skip to content

Install failed on Windows Universal #120

Closed

Description

@quartsystem

NuGet no longer able to install the package on a Windows Universal project with VS2015

Activity

  1. NicolasDorier commented on Aug 17, 2015

    @NicolasDorier
    Collaborator

    was it able before ? I can't compile on windows universal so I don't know. What error do you have ? (sorry for the delay)

  2. NicolasDorier commented on Aug 17, 2015

    @NicolasDorier
    Collaborator

    Can you also try the "NBitcoin For Mono" package ?

  3. quartsystem commented on Aug 17, 2015

    @quartsystem
    Author

    NuGet / Visual Studio 2015 is now able to perform the update to new release(2.1.4.7). All very strange.
    The error message was "Unable to find metadata of NBitcoin xxxx".
    Thanks anyway for the answer.

  4. NicolasDorier commented on Aug 18, 2015

    @NicolasDorier
    Collaborator

    By the way, I am interested to know if it the lib works fine on Univeral Project, since I did not tried. Let me know.
    I don't think you have access to the Node class (to connect to network) on Universal project, can you confirm ?

    If it is a problem for you, you can try NBitcoin For Mono package which include everything and should also works fine on Universal.

  5. quartsystem commented on Aug 18, 2015

    @quartsystem
    Author

    I'm developing a client for Windows 10 in my spare time.
    I'll keep you updated on the tests that will.

  6. quartsystem commented on Aug 21, 2015

    @quartsystem
    Author

    On universal Windows (app for Windows 10) NBitcoin.Mono fails installation with NuGet.
    With NBitcoin, when launching the following code is generated an exception:

    var k = new NBitcoin.Key();

    System.InvalidOperationException: You must set the RNG (RandomUtils.Random) before generating random numbers
    at NBitcoin.RandomUtils.GetBytes(Byte[] output)
    at NBitcoin.Key..ctor(Boolean fCompressedIn)
    at NBitcoin.Key..ctor()
    at TestInstallNBitcoin.MainPage..ctor()
    at TestInstallNBitcoin.TestInstallNBitcoin_XamlTypeInfo.XamlTypeInfoProvider.Activate_0_MainPage()
    at TestInstallNBitcoin.TestInstallNBitcoin_XamlTypeInfo.XamlUserType.ActivateInstance()
    at Windows.UI.Xaml.Controls.Fra

  7. quartsystem commented on Aug 21, 2015

    @quartsystem
    Author

    On Windows 10, PRNG uses the CryptographicBuffer. I solved this code:

    public class CryptographicBufferRandom : IRandom
    {
        #region IRandom Members
        public void GetBytes(byte[] output)
        {
            // https://msdn.microsoft.com/en-us/library/windows.security.cryptography.cryptographicbuffer.aspx
            IBuffer buffer = CryptographicBuffer.GenerateRandom((uint)output.Length);
            buffer.CopyTo(output);
        }
        #endregion
    }
    

    To generate the key
    NBitcoin.RandomUtils.Random = new CryptographicBufferRandom();
    var newKey = new NBitcoin.Key();

  8. NicolasDorier commented on Aug 22, 2015

    @NicolasDorier
    Collaborator

    thanks, will be useful when I'll make a specific version for universal

  9. GoldNRoll commented on Aug 1, 2017

    @GoldNRoll

    Hello,

    Any chance this will be solved for Windows 10?

    NBitcoin.4.0.0.13

    Any code fails with this error:
    System.InvalidOperationException: You must set the RNG (RandomUtils.Random) before generating random numbers

    using System;
    using NBitcoin;

    namespace Blockchain
    {
    class Program
    {
    static void Main(string[] args)
    {
    Key privateKey = new Key();
    Console.WriteLine("Private Key: {0}", privateKey);
    PubKey publicKey = privateKey.PubKey;
    Console.WriteLine("Public Key: {0}", publicKey);
    }
    }
    }

    Thanks, Alexandru

  10. NicolasDorier commented on Aug 2, 2017

    @NicolasDorier
    Collaborator

    @GoldNRoll set RandomUtils.Random to an instance of CryptographicBufferRandom made by @quartsystem just above.

    Windows Universal will soon support .NETStandard 2.0, so it will soon be not needed.

    Actually I think this is supported, in fall creator update https://blogs.windows.com/buildingapps/2017/05/19/introducing-xaml-standard-net-standard-2-0/

  11. GoldNRoll commented on Aug 2, 2017

    @GoldNRoll

    Perfect, thanks!!

  12. NicolasDorier commented on Aug 7, 2017

    @NicolasDorier
    Collaborator

    @GoldNRoll sorry I incorrectly diagnotised your problem, turns out you were not using UWP so my response does not apply.

    I fixed the problem, now you can reference NBitcoin without the issue.

    Someone reported it ProgrammingBlockchain/ProgrammingBlockchain#73

    The issue was that I dropped net452 support for I don't know what reason, but some version of Visual Studio still use this old .net version for new project template. I added back the support, so now you won't get error.

  13. GoldNRoll commented on Aug 7, 2017

    @GoldNRoll

    Hi Nicolas,

    Perfect, I updated NBitcoin to 4.0.0.15 and now it works in console application :)
    Visual Studio 2017 fresh install still comes with framework 4.5.2

    Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions