Open jcouv opened 7 years ago
From discussion with @srivatsn, the new project system simply passes to Roslyn the same path that was given to csc.exe
, then Roslyn compares that with known outputs from other project. If any of them match, the reference is rewired to a compilation reference.
What is likely happening here is that csc.exe
is getting a path to the ref assembly, passing that to Roslyn, but it doesn't match any known outputs.
Sri suggested there may be multiple design solutions, which likely involve project-system, Roslyn or both.
I'll let @davkean @jasonmalinowski comment on possible designs. I can set up a quick meeting if needed.
From discussion with Dave and Jason, I think there are three options so far:
bin/ref/a.dll
path) instead of current path (bin/a.dll
)Note that there is an msbuild flag that lets a client project ignore the ref assembly produced by a library project. We didn't discuss how that might fit in either of those options (it probably can't fit with option (1)).
I'll follow-up with Sri and Jared to get a sense of what is realistic trade-off, if any, for 15.3. My sense is that options (2) and (3) seem too late in the cycle.
@srivatsn @jaredpar What would you think if we put option (1) in place for 15.3, just to unblock our dogfooding of the ref assemblies feature, and then followed-up with a more proper and refined solution for 15.5?
From discussion with Sri and Jason, we're leaning towards option (2). That means leave the existing API as-is (to avoid breaking other consumers) and adding a new call to pass a list of output paths. Sri will get back to us on that option, and we'll also get @Pilchie's thoughts on that.
For the record, we discussed an option (4) where Rolsyn would do some string manipulation (remove "ref/" in the path) before converting path to project reference.
Also, Rainer confirmed that the output path for reference assemblies can be customized in MSBuild (with @(IntermediateRefAssembly)
).
From discussion with Jason and Kevin about 15.3 scope, I think we're landing on option (4) after all, which is a Roslyn-side workaround. Filed https://github.com/dotnet/roslyn/issues/20412 to track that. We should continue the discussion about full fix for 15.5. Thanks
Agreed, I'd like to introduce a relationship where we just pass a property bag over to the language service, and we just have a CPS XAML rule that decides what gets in that property bag. It's the same relationship we have with NuGet and it works really well and is cheap to add additional data.
@panopticoncentral @davkean Just a kindly ping to make sure this is still on the radar for 15.5. The implemented workaround for patching P2P references seems to work, but it still has hardcoded logic for the "ref" folder. Let me know. Thanks
@panopticoncentral @davkean I didn't hear back from you.
@panopticoncentral @davkean I didn't hear back from you for two weeks.
@jcouv We've introduced this property bag and I'm ready to start passing reference assembly data across to Roslyn. From above, it's not clear what data you actually want passed. Can you clarify?
@davkean You should probably sync up with @jasonmalinowski.
Jason introduced a workaround (there is some hardcoded assumption that ref assemblies live in a folder called ref
). He should confirm whether the property bag you introduced meets his needs and the workaround could be removed now.
So all we just need is the path to the reference assembly in the bin path. I'm not sure if that's exposed via a property that would be pulled off of the MSBuild evaluation or something else, but just toss it into the property bag and we'll do it from there.
I would be stoked to have this work soonish ^_^
Repro:
<CompileUsingReferenceAssemblies>true</CompileUsingReferenceAssemblies>
).From discussion with Jason, this is likely a misbehavior of the project system exposing information about project references to the IDE.
Relates to:
FYI @panopticoncentral @davkean @srivatsn for triage. Can we take a look for 15.3?