locked
Build a project referencing only other projects RRS feed

  • Question

  • Hello All,

    I have a solution with something like 40 projects inside. Some of these projects are just referencing other projects without adding any code or classes and I have two cases:
    1/ I want to compile without producing any .exe or .dll
    2/ I want to compile and produce a .dll like mySolution.dll

    For the first case, I managed to solve the problem removing the CSC task from the CoreCompile target and modifying Microsoft.Common.Targets not to copy output file.

    But for the second case i don't know if it is possible to produce a MySolution.dll without any code in my project. In fact, in Visual Studio 2005, when I build my project it does the CoreCompile target, calls the CSC Task and succeeds to create the output file. But when I use MsBuild from the command line, it tells me that there is no entry file and generates a fatal error CS2008. Can you explain me how Visual studio manages to create the output file and how I can solve the problem to produce it even with MsBuild from command line?

    Thanks a lot,

    Remi
    Tuesday, May 30, 2006 10:54 AM

Answers

  • This is a bug in the command line compilers and they are considering this as a fix for Orcas. For the record, command line compilers will not produce an assembly (by design) if there is no code to be compiled into the assembly.

    Now, the problem is that this causes a disparity between the IDE builds (which uses the in-proc compiler, and actually supports the scenario) whereas the command line compiler doesn't. It also makes it challenging to use the command line tools to build resource only assemblies, for instance.

    Thanks for bringing this up - the bug is being assessed by the compiler teams and is very likely to get handled in Orcas.

    Thanks.

    Faisal Mohamood | Program Manager | Visual Studio - MSBuild

    Saturday, August 19, 2006 9:51 PM

All replies

  • Hello,

    I have had the same problem and been looking into it. This seems to be a bug with MSBuild, check this link out for details....

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=543970&SiteID=1

    Wednesday, August 16, 2006 3:37 PM
  • This is a bug in the command line compilers and they are considering this as a fix for Orcas. For the record, command line compilers will not produce an assembly (by design) if there is no code to be compiled into the assembly.

    Now, the problem is that this causes a disparity between the IDE builds (which uses the in-proc compiler, and actually supports the scenario) whereas the command line compiler doesn't. It also makes it challenging to use the command line tools to build resource only assemblies, for instance.

    Thanks for bringing this up - the bug is being assessed by the compiler teams and is very likely to get handled in Orcas.

    Thanks.

    Faisal Mohamood | Program Manager | Visual Studio - MSBuild

    Saturday, August 19, 2006 9:51 PM
  • Workaround is to add a file to those projects that would otherwise have no code in them. If necessary, with some bogus class in it.
    Thursday, August 24, 2006 3:16 PM
  • Does anyone know if this issue has been resolved as of VS 2008 SP1? If not, is there a workaround that can be done in build script?

    Thanks,

    James
    Wednesday, September 17, 2008 4:02 PM