じょーログ(C#,Xamarin,Unity)

主はC#,Xamarin,Unity、後は思った事を綴る

MVCのHTMLヘルパーでえらい悩んだ

VisualStudio2013 Update5を使用している。


プロジェクト構成としては、

xxx.Infrastructure(クラスライブラリプロジェクト)
xxx.Web(MVCプロジェクト)

xxx.Infrastructureには拡張メソッド群がある。
今回の例ではこちら。

        public static HtmlString Button(this HtmlHelper helper,
                                     string innerHtml,
                                     object htmlAttributes)
        {
            return Button(helper, innerHtml,
                          HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes)
            );
        }

xxx.Webではxxx.Infrastructureを参照設定しているにも関わらず、@Htmlを押しても
独自で追加した拡張メソッドが表示されない。意味不明。

解決方法としては、


xxx.Infrastructure
xxx.Web

プロジェクトを再読み込みしたらインテリセンスが出た。
意味不明だ。