简体   繁体   中英

C# Class Library DLL is not Updating properly

I Have a class library project where i am dealing with my business logic after compilation i am getting DLL in bin/debug folder.

i am using the that DLL in another solution by manual copy which is fine.

Again i have updated my code class library project and build-ed it and copied the DLL file manually to another project there is not showing my updated code or methods. I have checked it through ILSPY decompilation .
just i have added below code

protected string CheckDllMethod()
    {
        try
        {
            return "Test Completed";
        }
        catch (Exception ex)
        {
            EmergeLogWriter.WriteError("CheckDllMethod()", EventCode.EMERGE_GET, ex.ToString());
            return string.Empty;
        }
    }

Thanks! in advance

Edit :

Actually We are separately maintaining class libraries in one solution and reusing the resulting DLL in multiple projects.
When i de-compile it through ILSPY In my environment updated code is showing but when i check them in another system or environment updated code is not showing

You can probably set the build property Copy to output directory=Copy Always but disadvantage would be that every time your dll gets updated you will have to re-copy them again. You may consider placing the dll in GAC in case there are multiple consumer present

DLL in another solution by manual copy

No, instead use VS add reference and browse to the directory where dll present and add the dll to your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM