What to do if missing DLL files are included in the _PublishedWebsites folder

My IIS project references the installation project, which references the NServiceBus project, which has the nuget package for dll:

IISProject-> SetupProject-> NServiceBusProject-> NugetPackage.

When I start my auto-build (TFS), the NugetPackage.dll and NServiceBusProject files are copied to the output folder. But they are not copied to the _PublishedWebsites folder. (But all the other DLLs I need are copied.)

I am at a loss for how to automatically copy these files.

The general answer on the Internet is to set CopyLocal = True. But this is already true for NugetPackage and NServiceBusProject references.

Does anyone know how to say: "I really want you to include dependent projects in published sites?

Or is there anything else I can look at?

+4
source share
1 answer

Since I just did something similar, despite the age of this question, that’s what I ended up doing. It is not perfect, but it works.

Set the post-build event in the project that you are actually building. In the build event, you can reference your current location using the $(ProjectDir) variable. Set up a path that points to the "normal" location of the DLL that you will need after creating it. I think in your case it will be the bin directory of the NServiceBus project.

You can get to the _PublishedWebsites directory using the $(WebProjectOutputDir) variable. When created locally, this points to the same directory as the built project. However, when msbuild is invoked with a non-standard output directory (aka from TFS), it changes to the publication directory.

 xcopy /Y /S "$(ProjectDir)..\path to needed dll" "$(WebProjectOutputDir)\bin" 

Your assemblies should work both locally and in your build environment using this script. The only downside is that it is a little fragile because you need to specify the exact name and relative location of the missing DLLs.

+2
source

Source: https://habr.com/ru/post/1390127/


All Articles