最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - System.Windows.Interactivity reference resolving to Microsoft.Xaml.Behaviors - Stack Overflow

programmeradmin0浏览0评论

A customer currently running an older version of an app experienced an error after successfully upgrading the software: Could not load file or assembly Microsoft.Xaml.Behaviors. However, this assembly was not referenced explicitly anywhere in the codebase, through Nuget or namespace in wpf xaml or code behind or Directory.Packages.props. It might be a transitive dependency, but I used asmspy in the output directory and got no results for dependencies on this assembly. I cannot reproduce this error, every time I rebuild and reinstall the software System.Windows.Interactivity.dll is correctly placed in the output dir, which is the expected behavior.

Someone mentioned that local environment settings may cause the code that references Interactivity:

<Window
...
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">

...

<i:Interaction.Behaviors>
    <shared:ApplicationItemViewBehavior />
</i:Interaction.Behaviors>

to accidentally resolve to Microsoft.Xaml.Behaviors instead, causing the post-upgrade version of the software to be calling Behaviors instead (which of course is not found). Is this a reasonable thing that can happen? I can't think of any other way Behaviors would be introduced. The target framework is 472.

发布评论

评论列表(0)

  1. 暂无评论