|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Trying to use Cryptography Quickstart2.0 - January 2006. I ran the Cryptography Quickstart and it works perfect. It does exactly what I need it to do, encrypts a string and decrypts a string. I copy the few lines of code (it looks SO easy at this point): Const symmProvider As String = "symprovider" Dim stringToEncrypt As String = Me.TextBoxOriginalValue.Text Dim encryptedContentsBase64 As String encryptedContentsBase64 = Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.EncryptSymmetric(symmProvider, stringToEncrypt) Me.TextBoxEncrypted.Text = encryptedContentsBase64 and it gives me an error on the call to EncryptSymmetric. The error I get is: "Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified." So I realize that I need a reference to another dll, I add that reference, run it again and now I get an error message: "The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception." I hoped that using the recommendation from Microsoft would be easier, but I'm not getting it. I'm guessing at this point that I've missed some step along the way, but I have no clue where to go at this point. Any suggestions? BK,
Did you set a reference. There are many methods to do that, one is using the tab Project, in that Add references and than browse to where you have placed that downloadedfile. I hope this helps, Cor Show quoteHide quote "BK" <bkunn***@hotmail.com> schreef in bericht news:1153170428.779131.198670@p79g2000cwp.googlegroups.com... >I downloaded and installed the Enterprise Library for .NET Framework > 2.0 - January 2006. I ran the Cryptography Quickstart and it works > perfect. It does exactly what I need it to do, encrypts a string and > decrypts a string. > > I copy the few lines of code (it looks SO easy at this point): > > Const symmProvider As String = "symprovider" > Dim stringToEncrypt As String = Me.TextBoxOriginalValue.Text > Dim encryptedContentsBase64 As String > encryptedContentsBase64 = > Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.EncryptSymmetric(symmProvider, > stringToEncrypt) > Me.TextBoxEncrypted.Text = encryptedContentsBase64 > > and it gives me an error on the call to EncryptSymmetric. The error I > get is: > > "Could not load file or assembly > 'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0, > Culture=neutral, PublicKeyToken=null' or one of its dependencies. The > system cannot find the file specified." > > So I realize that I need a reference to another dll, I add that > reference, run it again and now I get an error message: > > "The type initializer for > 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' > threw an exception." > > I hoped that using the recommendation from Microsoft would be easier, > but I'm not getting it. I'm guessing at this point that I've missed > some step along the way, but I have no clue where to go at this point. > Any suggestions? > Yes, I set a reference.
Cor Ligthert [MVP] wrote: Show quoteHide quote > BK, > > Did you set a reference. > > There are many methods to do that, one is using the tab Project, in that Add > references and than browse > to where you have placed that downloadedfile. > > I hope this helps, > > Cor > > "BK" <bkunn***@hotmail.com> schreef in bericht > news:1153170428.779131.198670@p79g2000cwp.googlegroups.com... > >I downloaded and installed the Enterprise Library for .NET Framework > > 2.0 - January 2006. I ran the Cryptography Quickstart and it works > > perfect. It does exactly what I need it to do, encrypts a string and > > decrypts a string. > > > > I copy the few lines of code (it looks SO easy at this point): > > > > Const symmProvider As String = "symprovider" > > Dim stringToEncrypt As String = Me.TextBoxOriginalValue.Text > > Dim encryptedContentsBase64 As String > > encryptedContentsBase64 = > > Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.EncryptSymmetric(symmProvider, > > stringToEncrypt) > > Me.TextBoxEncrypted.Text = encryptedContentsBase64 > > > > and it gives me an error on the call to EncryptSymmetric. The error I > > get is: > > > > "Could not load file or assembly > > 'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0, > > Culture=neutral, PublicKeyToken=null' or one of its dependencies. The > > system cannot find the file specified." > > > > So I realize that I need a reference to another dll, I add that > > reference, run it again and now I get an error message: > > > > "The type initializer for > > 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' > > threw an exception." > > > > I hoped that using the recommendation from Microsoft would be easier, > > but I'm not getting it. I'm guessing at this point that I've missed > > some step along the way, but I have no clue where to go at this point. > > Any suggestions? > > Sorry,
I have overlooked that. You use Visual Studio 2005 as I may assume? Cor Show quoteHide quote "BK" <bkunn***@hotmail.com> schreef in bericht news:1153222752.878653.232150@m73g2000cwd.googlegroups.com... > Yes, I set a reference. > > Cor Ligthert [MVP] wrote: >> BK, >> >> Did you set a reference. >> >> There are many methods to do that, one is using the tab Project, in that >> Add >> references and than browse >> to where you have placed that downloadedfile. >> >> I hope this helps, >> >> Cor >> >> "BK" <bkunn***@hotmail.com> schreef in bericht >> news:1153170428.779131.198670@p79g2000cwp.googlegroups.com... >> >I downloaded and installed the Enterprise Library for .NET Framework >> > 2.0 - January 2006. I ran the Cryptography Quickstart and it works >> > perfect. It does exactly what I need it to do, encrypts a string and >> > decrypts a string. >> > >> > I copy the few lines of code (it looks SO easy at this point): >> > >> > Const symmProvider As String = "symprovider" >> > Dim stringToEncrypt As String = Me.TextBoxOriginalValue.Text >> > Dim encryptedContentsBase64 As String >> > encryptedContentsBase64 = >> > Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.EncryptSymmetric(symmProvider, >> > stringToEncrypt) >> > Me.TextBoxEncrypted.Text = encryptedContentsBase64 >> > >> > and it gives me an error on the call to EncryptSymmetric. The error I >> > get is: >> > >> > "Could not load file or assembly >> > 'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0, >> > Culture=neutral, PublicKeyToken=null' or one of its dependencies. The >> > system cannot find the file specified." >> > >> > So I realize that I need a reference to another dll, I add that >> > reference, run it again and now I get an error message: >> > >> > "The type initializer for >> > 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' >> > threw an exception." >> > >> > I hoped that using the recommendation from Microsoft would be easier, >> > but I'm not getting it. I'm guessing at this point that I've missed >> > some step along the way, but I have no clue where to go at this point. >> > Any suggestions? >> > > No problems, yes I use VS 2005.
Show quoteHide quote > Sorry, > > I have overlooked that. You use Visual Studio 2005 as I may assume? > > Cor
GetFiles exception
Threading... Copy / Paste, Excel To flexgrid lastLogonTimestamp Encrypt My.Settings setting? On error resume next bug An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll Public Structure group enumerators so intellisense shows them in VB6? Sendmessage problem help! |
|||||||||||||||||||||||