2012-08-26 60 views
2

我是.NET新手,我現在正在爲Windows Live Writer編寫一個插件,因爲我寧願發佈使用它的博客比使用網絡編輯器。我想爲我的日常使用開發一些小插件。但是,在我創建了一個類libarary項目並按照一些開發人員描述的步驟構建它之後,WLW不會加載插件,因此我不知道如何調試。C#.Net爲Windows Live Writer和我的插件編寫插件無法加載

我的代碼:

using System; 
using System.Collections.Generic; 
using System.Text; 
using WindowsLive.Writer.Api; 
using System.Windows.Forms; 

namespace Insert_Colorful_Table 
{ 
    [WriterPluginAttribute 
     ("f7581112-dddd-47c9-9db0-46987a2aaae1", 
     "Insert Colorful Table", 
     Description = "Helps you create a beautiful table.", 
     ImagePath = "icon.gif",   
     PublisherUrl = "http://ggicci.blog.163.com")] 
    [InsertableContentSource("Insert Colorful Table")] 

    public class Plugin : ContentSource 
    { 
     public override DialogResult CreateContent 
      (IWin32Window dialogOwner, ref string content) 
     { 
      content = @"<table><tr><td>Ggicci</td></tr></table>"; 
      return DialogResult.OK; 
     } 
    } 
} 

我做配置「建設活動」的項目和圖像的「生成操作」設置爲「嵌入的資源」。構建我的項目時沒有發生錯誤。

回答

1

好吧,我已經弄清楚出了什麼問題。 Windows Live Writer支持使用Microsoft .NET Framework 1.1或2.0版構建的插件。編寫器要求用戶安裝.NET 2.0以安裝應用程序。但我使用.NET 4.0。所以當我將目標框架改爲2.0時,它運行良好。