Compile a Dll even if no other dlls it refers to exist.

zequion 111 Reputation points
2024-04-30T02:47:09.7766667+00:00

I have several Asp.net, Winforms and Wpf projects and use several dll projects that are common in C#.

Sometimes, for example, when the "Recompile" option is executed, all the dll projects are cleaned, so the compiled ones are no longer in bin\release and then in each compilation of each dll the error that it cannot be found appears. the rest of the dlls, so it cannot be compiled.

How can I make it compile the active dll project even if there are no other dlls that it can reference?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,363 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiale Xue - MSFT 35,556 Reputation points Microsoft Vendor
    2024-04-30T07:37:20.59+00:00

    Hi @zequion , Welcome to Microsoft Q&A,

    You should include them separately in your project, then set them to content and set copy if newer.

    User's image

    You can also use the Xcopy code to make a copy.

    For more information on how to copy the contents of a file in VS, you can see Karen Payne's blog.

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.