none
Cannot import System.Security.Cryptography RRS feed

  • Question

  • I wrote a web service in Visual Studio 2015 that uses some of the functions in System.Security.Cryptography - specifically SHA384CryptoServiceProvider. I had no problems with it until I got a new PC with Visual Studio 2017 and the project was copied onto that machine. Now (in addition to a host of other problems involving import statements), even though I have imported System.Security.Cryptography into the project, it is still telling me SHA384CryptoServiceProvider is not defined.

    Can anyone help with this?

    Friday, March 22, 2019 12:42 PM

Answers

  • Solved the problem - had to remove the assemblies from the web.config and then it recognized the "Imports System.Security.Cryptography" statement that was already in my program.
    • Marked as answer by GretchenF Monday, March 25, 2019 1:37 PM
    Monday, March 25, 2019 1:37 PM

All replies

  • Hello,

    Check under project references, make sure you see System.Security, if not it may have been lost and needs to be added back in or if there is a yellow marker next to the reference remove the reference and add it back in.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, March 22, 2019 1:12 PM
    Moderator
  • Hi,

    It looks like no reference namespace:

    Imports System.Security.Cryptography

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 25, 2019 7:42 AM
  • Solved the problem - had to remove the assemblies from the web.config and then it recognized the "Imports System.Security.Cryptography" statement that was already in my program.
    • Marked as answer by GretchenF Monday, March 25, 2019 1:37 PM
    Monday, March 25, 2019 1:37 PM
  • Solved the problem - had to remove the assemblies from the web.config and then it recognized the "Imports System.Security.Cryptography" statement that was already in my program.
    Great to hear.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Monday, March 25, 2019 1:46 PM
    Moderator