Cannot do file assembly references: we need to have project references so to
""Gary Chang[MSFT]"" wrote:
> Hi Richard,
>
> >VS.NET 2003 fails to build Managed C++ project from command
> >line. That is, having a VS.NET solution that contains a Managed
> >C++ project that has a "Project reference" to another assembly
> >(C# for example), will build successfully in the IDE, but not on the
> >command line (i.e. devenv /build solution.sln).
>
> I have performed some tests on this issue, also got the same results as you
> described.
>
> After some research and comparing the BuildLog.htm files of that managed
> C++ project in different scenarios, I found the problem may be the build
> command line could not process the "Project reference" dependency, the
> tempory build script which generated by the invisible VS2003 IDE will not
> link to the Project refernced assembly(the assembly in its obj\debug\
> directory):
> ...
> Creating command line "cl.exe @"e:\Gary\My Documents\Visual Studio
> Projects\W4\gif2\Debug\RSP000001.rsp" /nologo"
> Creating temporary file "e:\Gary\My Documents\Visual Studio
> Projects\W4\gif2\Debug\RSP000002.rsp" with contents
> [
> /Od /AI "E:\Gary\My Documents\Visual Studio Projects\W4\gif2\Debug" /D
> "WIN32" /D "_DEBUG" /D "_MBCS" /FD /EHsc /MTd /GS /Yc"stdafx.h"
> /Fp"Debug/gif2.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Zi /clr /TP /FU
> "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
> ".\stdafx.cpp"
> ]
>
> So the build process failed with some error as cound not find a namespace
> definition which should be provided by the referenced assembly.
>
> On the other hand, if the managed C++ project referenced that .NET assembly
> directly(the assembly(.dll) in its bin\debug\ directory), then the command
> line build would work fine:
> ...
> Creating command line "cl.exe @"e:\Gary\My Documents\Visual Studio
> Projects\W4\gif2\Debug\RSP000002.rsp" /nologo"
> Creating temporary file "e:\Gary\My Documents\Visual Studio
> Projects\W4\gif2\Debug\RSP000003.rsp" with contents
> [
> /Od /AI "E:\Gary\My Documents\Visual Studio Projects\W4\gif2\Debug" /D
> "WIN32" /D "_DEBUG" /D "_MBCS" /FD /EHsc /MTd /GS /Yc"stdafx.h"
> /Fp"Debug/gif2.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Zi /clr /TP /FU
> "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
> /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
> /FU "E:\Gary\My Documents\Visual Studio Projects\W4\tst2\bin\Debug\tst2.dll"
> ".\stdafx.cpp"
> ]
>
> So this appears to be an product limitation to the VS2003 IDE, I suggest
> you reference the .NET assembly to your managed C++ project directly, and
> the referenced assembly should be the one in its project's output
> directory(..\bin\debug\ or ..bin\release\ ) .
>
>
> Thanks!
>
> Best regards,
>
> Gary Chang
> Microsoft Community Support
> --------------------
> Get Secure! ¡§C
www.microsoft.com/security > Register to Access MSDN Managed Newsgroups!
>
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
> &SD=msdn
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>