views:

206

answers:

2

Jesus, Krishna, Budda!

I've migrated to EntLib 5.0, but classes like ISymmetricCryptoProvider are not recognized anymore. Funny to say that Data, Logging and other blocks are working compiling fine.

Here's the problematic class:

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;//-->it's not working anymore
using Microsoft.Practices.EnterpriseLibrary.Security.Cryptography;//-->it's not working anymore

namespace MyClassLibrary.Security.EnterpriseLibrary
{

    public sealed class Crypto
    {

        public static ISymmetricCryptoProvider MyProvider
        {
            get 
            {
                //IConfigurationSource is not recognized either, neither SystemConfigurationSource
                IConfigurationSource cs = new SystemConfigurationSource();
                SymmetricCryptoProviderFactory scpf = new SymmetricCryptoProviderFactory(cs);
                ISymmetricCryptoProvider p = scpf.CreateDefault();
                return p; 
            }
        }

The references are fine on project too. I really don't know why this particular project it's causing too many trouble on VS2010! Older references were deleted, project was cleaned, rebuilt, but can't make it compile :-(

The references are:

Microsoft.Practices.EnterpriseLibrary.Common
Microsoft.Practices.EnterpriseLibrary.Logging
Microsoft.Practices.EnterpriseLibrary.Logging.Database
Microsoft.Practices.EnterpriseLibrary.Security
Microsoft.Practices.EnterpriseLibrary.Security.Cryptography

Why some namespaces can be found while others can't?

A: 

Share the command-line when building (output window, csc.exe command line with all the -r's to see what references are going to the compiler)? It might suggest the problem.

Brian
I noticed that on Output window is showing:Compile complete -- 3 errors, 0 warningsC:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Junior Mayhé
this 4.1.0.0 version is not installed and I don't see any reference at this .targets file. The dll doesn't exist, it's not referenced and I don't know why VS2010 is showing this message
Junior Mayhé
What does the underlying .csproj file have listed as the `<Reference>` element here? It sounds like whatever it is, it is wrong. May be useful to post the whole .csproj file to help diagnose.
Brian
well, now it's working, even thinking that Clean option over the solution would help me, I came out with erasing bin and out folders for every project. So I found out that there was a second class library using two ancient dlls. I added the new ones there and now it's compiling well. This "Clean" option on Solution Explorer could have some issue?!
Junior Mayhé
A: 

Based on the 4.1 references that you have, you are still referencing the Enterprise Library 4.1 assemblies. You need to remove those references and add references to the Enterprise Library 5.0 assemblies.

The cryptography block should be usable as is without changing your code. Also make sure to update the "references" in all of your configuration files.

Tuzo