0

After a long hiatus away from it, I've returned to a project that targets the CF framework; the project has two references tagged with yellow "yield"/Warning glyphs (namely "ErikEJ.SqlCe.NetCF" and "Newtonsoft.Json.Compact").

The project compiles, so it seems whatever ails these two references is not causing a big problem.

Does this state of affairs (compiles, but displays warning signs) mean I can safely remove those references, or does it mean some action is required on my part to make these references "safe for democracy" again?

The project seems to be confused as to where these are, as the Path property is blank and the Version property is "0.0.0.0"

If they can't be found, and yet all is presumably well, that indicates to me that I can simply remove them. But...they were added for some reason, and I'd like reassurance before taking that semi-drastic step.

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 1
    You use source control, of course, so it is not an issue to remove them and see if you can build, then :-) – ErikEJ Mar 03 '14 at 17:29
  • Yeah, I had been using both of those packages, but haven't touched the code in a long time; my cohort (gleaming in purple and gold - not!) must have removed the code related to them. So, yes, removing them gives me a clean build, so I guess we will do without whatever functionality those provided, at least for now. – B. Clay Shannon-B. Crow Raven Mar 03 '14 at 17:33

1 Answers1

3

Do note that a warning symbol on top of a reference doesn't mean that it's unresolvable. Instead it means that there was some error, possibly inability to resolve, for that reference. For instance if you add a Condition property to the reference VS will show it with the warning symbol but the assembly is still resolvable.

The only way to know if the reference can be removed is to

  1. Remove it
  2. Rebuild
  3. Run all tests

If they all pass then you can say with a high degree of confidence that it is no longer needed

JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
  • Being that "Path" is empty and Version is "0.0.0.0", I reckon that they probably are unresolvable; what seems strange to me, though, is that it seems to be "okay" with that ("can't find you, but so what!") – B. Clay Shannon-B. Crow Raven Mar 03 '14 at 18:40
  • @B.ClayShannon VS doesn't know though if resolution failure is fatal, the compiler could work without it (which it does in tihs case). Overall experience is indeed strange though – JaredPar Mar 03 '14 at 18:50
  • 1
    @B.ClayShannon Is it possible that the "referenced" assembly is actually a dynamically loaded dependency of some other component your project is referencing? If so your project could compile fine without it but then fail to run at deployment. Having the reference in the project could be a means to ensure that the dependency is copied to the output directory. As JaredPar said, the only way to really know is to remove it, rebuild and then retest the application fully. – Brian Rogers Mar 03 '14 at 18:51
  • I think in the previous state (I removed them both), if the assemblies were needed, they would have failed anyway, due to the fact that the Path was zilch and the version was bogus. – B. Clay Shannon-B. Crow Raven Mar 03 '14 at 18:53