Tuesday 15 April 2014

c# - How to reference a project out of solution? -



c# - How to reference a project out of solution? -

i have visual studio c# solution consists of projects. 1 of projects needs reference project not part of solution.

at origin referencing dlls:

<itemgroup> <reference include="externalproj1, version=1.0.0.0, culture=neutral, processorarchitecture=msil"> <specificversion>false</specificversion> <hintpath>..\..\proj1\externalproj1.dll</hintpath> </reference> </itemgroup>

however must reference projects generate dlls. in fact if reference dlls , have not been created, need build projects separately.

however when referencing projects:

<itemgroup> <projectreference include="..\..\proj1\externalproj1"> <project>{3341b552-a569-4313-aabc-34452fff60ac}</project> <name>externalproj1</name> </projectreference> </itemgroup>

however when building compiler cannot find assemblies. unusual thing building process reported completed error window reports 1 warning:

the referenced component externalproj not found.

so, doing wrong? give thanks you

i see using projectreference, i'm familiar in plain (non-net) c++ projects. include attribute needs name file, not base of operations name; e.g.

<projectreference include="..\..\proj1\externalproj1.vcxproj">

that is, projectreference not reference. see common msbuild project items

also, metadata determines whether link lib automatically determined via supplied props files if not specified item. managed project producing lib? should (with filename correct) cause nominated project built dependent, doing products issue altogether.

try building msbuild.exe command line, not ide, see pure behavior before ide messes things or adds more issues figure out. and, feed specific proj file wanting, not "solution" file. .sln file unusual beast , not possible have project references not nowadays in sln, there no inherent concept of sln file @ all. other list of projects show in ide, magic file converted master proj on fly lets name various targets individually without having know proj file (or path it) handy enough, there compatibility vsbuild according the books. avoid it, @ to the lowest degree simplify things behavior want during exploration stage. add together complications in if still want them :) .

c# .net visual-studio msbuild csproj

No comments:

Post a Comment