1

I'm creating a web service that uses multiple DLLs, some of which are projects that I have developed and others are external DLLs. Those that are external, I have simply copied into the Bin directory of my WebService. However, those that are from my own projects I have added as references by right clicking on the bin folder and selecting add reference. This adds both a dll and a pdb file to the bin folder. However, when I build the website, I am not sure where these two files are pulled from. I need to know because I am trying to encrypt these DLLs as a post build step on the web service and I need to know where I can find the DLL I should encrypt. Need any more information let me know.

1 Answer 1

1

If the files are part of another project in your solution, then open the project folder for those projects (right click on the project node in VS and choose "Open In Explorer..."). There is a bin directory in that folder that the assembly for that project is placed in after it is built. When the web site project is built, the assembly is copied from this bin folder into the bin folder for the web site.


EDIT

As discovered (in the comments to this answer), VS actually copies assemblies from the obj directory rather than the bin directory.

7
  • It seems this isn't exactly the case. I run the encryption on these files and they are encrypted, and then the web service finds a version of the dll that's not encrypted and uses that one instead. Any idea where it gets the non-encrypted dll from? It's definitely not from the bin/Release directory.
    – jrbalsano
    Jun 24, 2011 at 15:08
  • Are you doing the encryption post build? If so, then you need to look in the bin directory for the website it self, as the assembly files are copied there before the post build event is executed. Jun 24, 2011 at 15:13
  • The encryption is being done in the post-build event of the C# Project that makes the DLL, not the web service because the web service does not have pre/post build events. I thought performing it post build on the other project would then cause the web service to copy the encrypted dll from the bin/Release directory.
    – jrbalsano
    Jun 24, 2011 at 15:15
  • I'm not 100% sure on this, but I think all the post build events occur after all the other projects in the solution are built (which includes copying). What happens if you build just the assembly project itself, then when that finishes, build the website? Jun 24, 2011 at 15:18
  • No dice, it just puts in the unencrypted dll. Could it be taking this from the "obj" directory? EDIT: Actually, I'm quite confident it's getting it from the obj directory. I just put the encrypted DLL in there and then it replaced it with an unencrypted dll when I build the website.
    – jrbalsano
    Jun 24, 2011 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.