0

I am trying to ensure that the .dll.config file generated in a reference project is pulled into the parent project's /bin directory during a build. I've read here and here about using the AllowedReferenceReleatedFileExtension setting in the parent project's .vbproj file, but I'm getting a warning:

The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'AllowedReferenceRelatedFileExtensions' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'

the property group I added to the end of the .vbproj file looks like this:

  <PropertyGroup>
    <AllowedReferenceRelatedFileExtensions>
      .pdb
      .xml
      .dll.config
    </AllowedReferenceRelatedFileExtensions>
  </PropertyGroup>

I'm a little out of my depth with .net builds, so I'm not sure where to start trying to resolve this warning. There are a few other similar warnings in the .vbproj file that don't seem to be causing any problems, but running the build after I added this section didn't actually copy the reference project's .dll.config file over.

Any ideas?

Community
  • 1
  • 1
Dave Novelli
  • 2,086
  • 4
  • 32
  • 42

3 Answers3

2

According to this answer (which worked for me), it seems you need to add a semi colon after each extension.

Not sure if that is mandatory

Community
  • 1
  • 1
Xavi Ivars
  • 634
  • 8
  • 22
2

Set the build output verbosity to Detailed and see where the dependencies are being copied from. It is possible that your target dll is referenced indirectly from multiple projects and it is being copied from the project that does not have the AllowedReferenceRelatedFileExtensions set.

In the build output search for: Dependency "your target dll" Resolved file path is "path where the target dll is being copied from"

P.S.: "Target dll" means the dll whose .dll.config is required to be copied to the referencing project's output folder.

I-A-N
  • 159
  • 3
  • 3
1

Did you try to use MSBuild instead of add tags manually?

MSBuild.exe MyProject.csproj /t:build "/p:AllowedReferenceRelatedFileExtensions=.pdb;.xml;.dll.config"

jotade
  • 438
  • 2
  • 5
  • I hadn't tried that, but I managed to get that to work by moving the double quotes to surround the property value and not the entire property argument. I modified the TFS build by adding it to the "Build->Advanced->MSBuild arguments" section of the build definition and it works on my TFS build server. How though can I specify this for the project's build inside of Visual Studio so that when I do local builds they keep the .dll.config file? – Dave Novelli Aug 09 '15 at 01:06