错误 2 未能找到类型或命名空间名称“DecompressionDLL”(是否缺少 using 指令或程序集引用?) E:\vssmanage\project\Document\编码\转换和解压\解压\DecompressionApp\DecompressionApp\MainClass.cs 5 7 DecompressionApp
 
DecompressionDLL 这个dll文件是同一项目中的,我重新移除添加引用后,显示正常,但是一生成,就报这个错误,检测启动项Bin文件夹下没有将这个dll复制过来,属性设置里面设置了复制到本地。 
请高手解决!!!

解决方案 »

  1.   

     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text; 
    using System.Windows.Forms;
    using System.Configuration;
    using DecompressionDLL;namespace DecompressionApp
    {
        class Program
        {
            static string oldPath = ConfigurationManager.AppSettings["resourcePath"].ToString();
            static string newPath = ConfigurationManager.AppSettings["saveFilePath"].ToString();
            static string password = ConfigurationManager.AppSettings["passwordForRar"].ToString();
            static string faledLogPath = ConfigurationManager.AppSettings["faledLogPath"].ToString();
            static string convertLogPath = ConfigurationManager.AppSettings["convertLogPath"].ToString();         [STAThread]
            static void Main(string[] args)
            {
                Console.WriteLine("开始批量解压,请按回车! 按任意键退出。");            ConsoleKeyInfo info = Console.ReadKey();            
                if (info.KeyChar != '\r')
                {
                    return;
                }            FolderBrowserDialog dialog = new FolderBrowserDialog();
                dialog.ShowNewFolderButton = true;            if (dialog.ShowDialog() == DialogResult.OK)
                {
                    oldPath = dialog.SelectedPath;
                    Console.WriteLine("你选择的目录是:"+ oldPath + " 。 如确认无误,请按回车继续,退出请按任意键!");                ConsoleKeyInfo key = Console.ReadKey();                if (!(key.KeyChar == '\r'))
                    {
                        return;
                    }            }
                else
                    return;
                 
                try
                {
                StartDecompression();
                }
                catch (Exception ex)
                {
                    Console.WriteLine("应用程序出现严重错误!错误信息:{0}", ex.Message);
                }
            }        /// <summary>
            /// 开始解压
            /// </summary>
            public static void StartDecompression()
            {
                try
                {
                    //添加xml路径配置
                    XMLOperate.AddPathsToXML(oldPath);            }
                catch(Exception ex)
                {
                    Console.WriteLine("配置xml信息出现错误!错误信息:{0}",ex.Message);
                }
                Decompressions dec = new Decompressions(faledLogPath, convertLogPath, true);            bool start = true;            do
                {
                    //获得压缩文件路径
                    List<string> list = XMLOperate.GetPathTop();                if (list == null || list.Count == 0)
                    {
                        Console.WriteLine("没有需要解压的文档或者操作已经完成! 请按任意键退出");
                        Console.ReadKey();
                        return;
                    }
                    else
                    {
                        try
                        {
                            //开始解压
                            dec.BatchDecompress(list, newPath, password);                    }
                        catch (Exception ex)
                        {
                            Console.WriteLine("解压过程中出现了错误!错误信息:{0} ",ex.Message);
                        }
                        XMLOperate.DeleteXmlPath(list);
                    }
                }
                while (start);        }
        }