Aracılığıyla paylaş


İzlenecek yol: C# kullanarak bir sdk oluşturma

Bu izlenecek yolda, basit bir matematik kitaplığı sdk, Visual C# kullanarak oluşturun ve ardından Visual Studio Uzantısı (VSIX) olarak sdk paketini öğreneceksiniz.Aşağıdaki yordamları tamamlamanız:

Önkoşullar

Bilgisayarınızda yüklü olmalıdır Visual Studio 2012 ve Visual Studio 2012 SDK makinenizde yüklü.Bu sdk Visual Studio indirebilirsiniz Downloads sayfa.

SimpleMath Windows çalışma zamanı bileşeni oluşturmak için

  1. Menü çubuğunda Seç Dosya, Yeni, Yeni bir proje.

  2. Şablonlar listesini genişletmek Visual C# veya Visual Basic, seçin Windows deposu düğümü ve sonra seçin Windows çalışma zamanı bileşeni şablonu.

  3. İçinde adı kutusuna SimpleMath belirtin ve sonra seçin Tamam düğmesi.

  4. İçinde Çözüm Gezgini, kısayol menüsünü açmak SimpleMath proje düğümünü ve sonra özelliklerini.

  5. Rename Class1.cs için Arithmetic.cs ve aşağıdaki kodu eşleşecek şekilde güncelleştirin:

  6. İçinde Çözüm Gezgini, kısayol menüsünü açmak Çözüm 'SimpleMath' düğümü ve sonra seçin Configuration Manager.

    Yapılandırma Yöneticisi iletişim kutusunu açılır.

  7. İçinde Etkin çözüm yapýlandýrmasý listesinde, seçim yayın.

  8. İçinde yapılandırma sütun, doğrulayın SimpleMath ayarlanmış satır yayınve sonra seçin Kapat değişikliği kabul etmek için düğme.

    Önemli notÖnemli

    SimpleMath bileşeni için SDK'yı yalnızca bir yapılandırma içerir.Bu yapılandırma yayın yapısı olmalı veya bileşenini kullanan uygulamalar olmayacaktır sertifika geçirmekWindows Mağazası.

  9. İçinde Çözüm Gezgini, kısayol menüsünü açmak SimpleMath proje düğümünü ve sonra Yapı.

SimpleMathVSIX uzantı projesi oluşturmak için

  1. Kısayol menüsünde Çözüm 'SimpleMath' düğümü seçin Ekle, Yeni bir proje.

  2. Şablonlar listesini genişletmek Visual C# veya Visual Basic, seçin genişletilebilirlik düğümü ve sonra seçin VSIX projesi şablonu.

  3. İçinde adı kutusuna SimpleMathVSIX belirtin ve sonra seçin Tamam düğmesi.

  4. İçinde Çözüm Gezgini, seçim source.extension.vsixmanifest öğesi.

  5. Menü çubuğunda Seç Görünüm, kod.

  6. Varolan xml aşağıdaki xml ile değiştirin:

  7. İçinde Çözüm Gezgini, seçim SimpleMathVSIX proje.

  8. Menü çubuğunda Seç Proje, Add New Item.

  9. Listesinde Ortak öğeleri, genişletme verive sonra seçin xml dosyası.

  10. İçinde adı kutusunda, belirttiğiniz SDKManifest.xmlve sonra seçin Ekle düğmesi.

  11. İçinde Çözüm Gezgini, kısayol menüsünü açmak SDKManifest.xml, seçin özelliklerinive değeri değiştirin Include in VSIX özelliğini doğru.

  12. Aşağıdaki xml dosyasının içeriğini değiştirin:

  13. In Solution Explorer, open the shortcut menu for the SimpleMathVSIX project, choose Add, and then choose New Folder.

  14. Rename the folder to references.

  15. Open the shortcut menu for the references folder, choose Add, and then choose New Folder.

  16. Rename the subfolder to commonconfiguration, create a subfolder within it, and name the subfolder neutral.

  17. Repeat the previous four steps, this time renaming the first folder to redist.

    The project now contains the following folder structure:

    references\commonconfiguration\neutral
    redist\commonconfiguration\neutral
    
  18. In Solution Explorer, open the shortcut menu for the SimpleMath project, and then choose Open Folder in File Explorer.

  19. In File Explorer, navigate to the bin\Release folder, open the shortcut menu for the SimpleMath.winmd file, and then choose Copy.

  20. In Solution Explorer, paste the file into the references\commonconfiguration\neutral folder in the SimpleMathVSIX project.

  21. Repeat the previous step, pasting the SimpleMath.pri file into the redist\commonconfiguration\neutral folder in the SimpleMathVSIX project.

  22. In Solution Explorer, choose SimpleMath.winmd.

  23. On the menu bar, choose View, Properties (Keyboard: Choose the F4 key).

  24. İçinde özellikleri Değiştir penceresinde Yapı eylemi özelliğini İçerikve Include in VSIX özelliğini doğru.

  25. In Solution Explorer, repeat this process for SimpleMath.pri.

  26. İçinde Çözüm Gezgini, seçim SimpleMathVSIX proje.

  27. On the menu bar, choose Build, Build SimpleMathVSIX.

  28. In Solution Explorer, open the shortcut menu for the SimpleMathVSIX project, and then choose Open Folder in File Explorer.

  29. In File Explorer, navigate to \bin\Release folder, and then run SimpleMathVSIX.vsix to install it.

  30. Seçim Yükleme düğmesini, yüklemenin tamamlanmasını bekleyin ve ardından Visual Studio yeniden başlatın.

Sınıf kitaplığı kullanan örnek uygulama oluşturmak için

  1. Menü çubuğunda Seç Dosya, Yeni, Yeni bir proje.

  2. In the list of templates, expand Visual C# or Visual Basic, and then choose the Windows Store node.

  3. Choose the Blank App template, name the project ArithmeticUI, and then choose the OK button.

  4. In Solution Explorer, open the shortcut menu for the ArithmeticUI project, and then choose Add Reference.

  5. In the list of reference types, expand Windows, and then choose Extensions.

  6. In the details pane, choose the Simple Math SDK extension.

    Additional information about your SDK appears.You can choose the More Information link to open http://www.msdn.microsoft.com, as you specified in the SDKManifest.xml file earlier in this walkthrough.

  7. In the Reference Manager dialog box, select the Simple Math SDK check box, and then choose the OK button.

  8. On the menu bar, choose View, Object Browser.

  9. In the Browse list, choose Simple Math.

    You can now explore what’s in the SDK.

  10. In Solution Explorer, open MainPage.xaml, and replace its contents with the following XAML:

  11. Update MainPage.xaml.cs to match the following code:

  12. Uygulama çalıştırmak için F5 tuşuna basarak seçin.

  13. In the app, enter any two numbers, choose an operation, and then choose the = button.

    Doğru sonucu görünür.

You have successfully created and used an Extension SDK.

Ayrıca bkz.

Görevler

İzlenecek yol: C++ kullanarak bir sdk oluşturma

Kavramlar

Nasıl yapılır: bir yazılım geliştirme seti oluşturmak

Diğer Kaynaklar

İzlenecek yol: JavaScript kullanarak bir sdk oluşturma