VS2010 How do I supress MSB3245 (The referenced component X does not exist)
I have some project's with various compile switches, so depending on how they are built do not need a referenced dll , so I get a warning that it does not exist.
I would like to suppress this warning so we are warning free. How do I do this 开发者_StackOverflowon the project on VS2010, what number to I put in the suppress warning box on the prject page ?
It sounds like an MSBuild warning, not a C# compiler warning (by virtue of the 'MSB') which I'm not sure is supressible. But you can just make that reference conditional, probably, something like
<Reference Condition=" $(DefineConstants.Contains('THAT_ONE_SWITCH') " ... />
though I haven't tried the exact syntax offhand.
Edit your .csproj file
Condition="Exists('..\xxx\xxx.csproj')"
<ProjectReference Condition="Exists('..\xxx\xxx.csproj')" Include="..\xxx\xxx.csproj">
<Project>{E66B88FA-767A-46C7-BDCB-D283F6B889BA}</Project>
<Name>xxx</Name>
<Private>False</Private>
</ProjectReference>
精彩评论