金曜日, 11月 28, 2025

AI/ML同梱 WinUI3 MSIXアプリケーション構築ガイドライン

バージョン: 1.0

最終更新: 2025年11月28日
対象技術: WinUI3 + MSIX + ONNX Runtime + Large AI Models
基盤: FindSpark実装経験 + 0xc000027b問題解決からの学び


📋 Executive Summary

本ガイドラインは、ONNX Runtimeなどのx64ネイティブ依存関係を持つAI/MLライブラリを含むWinUI3アプリケーションをMSIXパッケージとして構築する際の、クリティカルな設定要件とベストプラクティスを定義します。

数百MB〜数GBの大容量AIモデルを同梱し、Microsoft Store配信またはサイドローディングを実現するための、実証済みアーキテクチャと実装戦略を提供します。

🎯 適用対象プロジェクト

  • ✅ ONNX Runtime (Microsoft.ML.OnnxRuntime) 使用アプリ
  • ✅ 大容量AIモデル(100MB〜数GB)同梱アプリ
  • ✅ WinUI3 + .NET 8/9 デスクトップアプリ
  • ✅ Microsoft Store配信予定アプリ
  • ✅ x64専用ネイティブ依存関係を持つアプリ

⚠️ クリティカル問題の予防

このガイドラインに従うことで、以下の問題を未然に防止できます:

問題症状根本原因
0xc000027b クラッシュ起動直後にMicrosoft.UI.Xaml.dllで即座にクラッシュPackage.appxmanifest ProcessorArchitecture未指定
DLL Not Foundonnxruntime.dll/onnxruntime_providers_shared.dll読み込み失敗runtimes/win-x64/native/ディレクトリ構造問題
Model Load FailureAIモデルファイルが見つからない(MSIX環境のみ)パス解決戦略の欠如
Store Submission拒否WACKテスト失敗、アーキテクチャ不整合VCLibs依存関係欠如、RuntimeIdentifier不整合

🏗️ アーキテクチャ概要

レイヤー構造

┌─────────────────────────────────────────────────┐
│ WinUI3 Application Layer                        │
│  ├─ ViewModels (MVVM)                          │
│  ├─ Views (XAML)                               │
│  └─ Services (UI Orchestration)                │
└─────────────────────────────────────────────────┘
                    ↓
┌─────────────────────────────────────────────────┐
│ AI/ML Service Layer                             │
│  ├─ IEmbeddingService                          │
│  ├─ IInferenceService                          │
│  └─ IModelManagementService                    │
└─────────────────────────────────────────────────┘
                    ↓
┌─────────────────────────────────────────────────┐
│ ONNX Runtime Infrastructure                     │
│  ├─ ONNX Session Management                    │
│  ├─ Model Loading & Caching                    │
│  └─ Tensor Processing                          │
└─────────────────────────────────────────────────┘
                    ↓
┌─────────────────────────────────────────────────┐
│ Native Dependencies (x64)                       │
│  ├─ onnxruntime.dll (13.5MB - 17.4MB)         │
│  ├─ onnxruntime_providers_shared.dll           │
│  └─ VCLibs.140.00.UWPDesktop (Framework)       │
└─────────────────────────────────────────────────┘
                    ↓
┌─────────────────────────────────────────────────┐
│ AI Model Assets (ONNX format)                   │
│  └─ Assets/models/{model_name}/*.onnx          │
│     (100MB - 数GB)                              │
└─────────────────────────────────────────────────┘

🔧 CRITICAL: 必須設定チェックリスト

✅ Phase 1: Package.appxmanifest 設定(最優先)

ファイル: {ProjectName}.PKG.wapproj/Package.appxmanifest

xml
<?xml version="1.0" encoding="utf-8"?>
<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
  IgnorableNamespaces="uap rescap">

  <!-- CRITICAL: ProcessorArchitecture="x64" を明示的に指定 -->
  <Identity
    Name="com.yourcompany.yourapp"
    Publisher="CN=..."
    Version="1.0.0.0"
    ProcessorArchitecture="x64" />  <!-- ← 必須! -->

  <Properties>
    <DisplayName>Your App Name</DisplayName>
    <PublisherDisplayName>Your Company</PublisherDisplayName>
    <Logo>Images\StoreLogo.png</Logo>
  </Properties>

  <Dependencies>
    <TargetDeviceFamily 
      Name="Windows.Desktop" 
      MinVersion="10.0.17763.0" 
      MaxVersionTested="10.0.26100.0" />
    
    <!-- CRITICAL: VCLibs依存関係を明示的に宣言 -->
    <PackageDependency 
      Name="Microsoft.VCLibs.140.00.UWPDesktop" 
      MinVersion="14.0.33519.0" 
      Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
  </Dependencies>

  <Capabilities>
    <!-- フルトラスト必須(ONNX Runtimeはサンドボックス制限外の動作が必要) -->
    <rescap:Capability Name="runFullTrust" />
    
    <!-- 必要に応じて追加 -->
    <!-- <Capability Name="internetClient" /> -->
    <!-- <rescap:Capability Name="broadFileSystemAccess" /> ※最小限に -->
  </Capabilities>

  <Applications>
    <Application Id="App"
      Executable="$targetnametoken$.exe"
      EntryPoint="$targetentrypoint$">
      <uap:VisualElements
        DisplayName="Your App Name"
        Description="Your App Description"
        BackgroundColor="transparent"
        Square150x150Logo="Images\Square150x150Logo.png"
        Square44x44Logo="Images\Square44x44Logo.png">
        <uap:DefaultTile 
          Wide310x150Logo="Images\Wide310x150Logo.png" 
          Square71x71Logo="Images\SmallTile.png"
          Square310x310Logo="Images\LargeTile.png" />
        <uap:SplashScreen Image="Images\SplashScreen.png" />
      </uap:VisualElements>
    </Application>
  </Applications>
</Package>

重要ポイント:

  • ProcessorArchitecture="x64"最重要設定(欠如すると0xc000027bクラッシュ)
  • VCLibs依存関係は、ONNX Runtimeの動作に必須
  • runFullTrust capability必須(ONNX RuntimeはUWPサンドボックス外の機能使用)

✅ Phase 2: .wapproj プロジェクトファイル設定

ファイル: {ProjectName}.PKG.wapproj

xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" 
         xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  
  <PropertyGroup>
    <ProjectGuid>{YOUR-GUID}</ProjectGuid>
    <TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
    <DefaultLanguage>en-US</DefaultLanguage>
    
    <!-- CRITICAL: VCLibs自動インクルード -->
    <WinUISDKReferences>true</WinUISDKReferences>
    
    <!-- x64専用ビルド強制 -->
    <AppxBundlePlatforms>x64</AppxBundlePlatforms>
    <AppxBundle>Always</AppxBundle>
    
    <!-- 署名設定 -->
    <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
    <PackageCertificateThumbprint>YOUR-THUMBPRINT</PackageCertificateThumbprint>
    
    <!-- エントリーポイント -->
    <EntryPointProjectUniqueName>..\src\{YourApp}\{YourApp}.csproj</EntryPointProjectUniqueName>
  </PropertyGroup>

  <!-- すべての構成でx64を強制 -->
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <AppxBundle>Always</AppxBundle>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <AppxBundle>Always</AppxBundle>
  </PropertyGroup>

  <ItemGroup>
    <AppxManifest Include="Package.appxmanifest">
      <SubType>Designer</SubType>
    </AppxManifest>
  </ItemGroup>

  <!-- ONNX Runtime DLLを直接配置 -->
  <ItemGroup>
    <!-- オプション1: NuGetパッケージから自動コピー(推奨) -->
    <!-- Microsoft.ML.OnnxRuntime NuGetパッケージが自動的に配置 -->
    
    <!-- オプション2: 手動配置(runtimes問題回避) -->
    <Content Include="..\packages\Microsoft.ML.OnnxRuntime.1.23.0\runtimes\win-x64\native\*.dll">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      <Link>%(Filename)%(Extension)</Link>
    </Content>
  </ItemGroup>

  <!-- AIモデルファイルをAssetsディレクトリに配置 -->
  <ItemGroup>
    <Content Include="..\models\{model_name}\**\*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      <Link>Assets\models\{model_name}\%(RecursiveDir)%(Filename)%(Extension)</Link>
    </Content>
  </ItemGroup>

  <Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
  <Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
  
  <ItemGroup>
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
  </ItemGroup>
  
  <ItemGroup>
    <ProjectReference Include="..\src\{YourApp}\{YourApp}.csproj" />
  </ItemGroup>
</Project>

重要ポイント:

  • <WinUISDKReferences>true</WinUISDKReferences> でVCLibs自動インクルード
  • すべてのPropertyGroupにRuntimeIdentifier=win-x64を明示
  • ONNX Runtime DLLは実行ディレクトリ直下に配置(runtimes/win-x64/native/問題回避)

✅ Phase 3: .csproj アプリケーションプロジェクト設定

ファイル: src/{YourApp}/{YourApp}.csproj

xml
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
    
    <!-- CRITICAL: x64専用設定 -->
    <Platform>x64</Platform>
    <PlatformTarget>x64</PlatformTarget>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <Platforms>x64</Platforms>
    <RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
    
    <!-- WinUI3設定 -->
    <UseWinUI>true</UseWinUI>
    <EnableMsixTooling>true</EnableMsixTooling>
    
    <!-- MSIX最適化 -->
    <WindowsPackageType>MSIX</WindowsPackageType>
    <WindowsAppSDKSelfContained>false</WindowsAppSDKSelfContained>
    
    <!-- 公開設定(Store配信時) -->
    <PublishReadyToRun>true</PublishReadyToRun>
    <PublishTrimmed>false</PublishTrimmed> <!-- ONNX Runtimeは trim 非対応 -->
    <SelfContained>false</SelfContained>
  </PropertyGroup>

  <ItemGroup>
    <!-- Windows App SDK -->
    <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250310001" />
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.6584" />
    
    <!-- ONNX Runtime -->
    <PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.23.0" />
    
    <!-- その他AI/ML関連 -->
    <PackageReference Include="Microsoft.ML" Version="3.0.1" />
    <PackageReference Include="Microsoft.ML.Tokenizers" Version="2.0.0-preview.25373.1" />
    
    <!-- MVVM Toolkit -->
    <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
  </ItemGroup>

  <!-- ONNX Runtime DLL配置の確保 -->
  <Target Name="CopyOnnxRuntimeDlls" AfterTargets="Build">
    <ItemGroup>
      <OnnxRuntimeFiles Include="$(NuGetPackageRoot)\microsoft.ml.onnxruntime\1.23.0\runtimes\win-x64\native\*.dll" />
    </ItemGroup>
    <Copy SourceFiles="@(OnnxRuntimeFiles)" 
          DestinationFolder="$(OutDir)" 
          SkipUnchangedFiles="true" />
  </Target>
</Project>

重要ポイント:

  • PublishTrimmed=false 必須(ONNX Runtimeはリフレクション使用のためtrim不可)
  • SelfContained=false 推奨(.NET Runtimeは別途Framework依存)
  • ONNX Runtime DLLの明示的コピーターゲット(MSBuild)

このドキュメントは、FindSpark (v1.0.0 - v1.0.16.0) の開発経験と、10連続バージョンでの0xc000027b問題解決過程から得られた実証済み知見に基づいています。

完全版は1400行以上のガイドラインで、以下のセクションを含みます:

  • AIモデル配置戦略(MSIX同梱 vs 初回ダウンロード)
  • ONNX Runtime実装ベストプラクティス
  • パフォーマンス最適化(ArrayPool, Span<T>, バッチ処理)
  • セキュリティ・プライバシー考慮事項
  • MSIXパッケージサイズ管理
  • トラブルシューティング完全ガイド
  • FindSpark実装例と実績データ
  • 実装チェックリスト

土曜日, 9月 27, 2025

Find Spark Privacy Policy


 

Last Updated: September 27, 2025

1. Our Privacy Commitment

Find Spark is an application designed with your privacy as its highest priority. Our founding principle is simple: Your data is yours, and it stays on your device. This application has no functionality to transmit your personal information or usage data to any external server.


2. Information We Do Not Collect

To guarantee your privacy, Find Spark does not collect or transmit any of the following information:

  • Personally Identifiable Information (PII) such as your name, email address, or location.

  • Application usage data or analytics.

  • Crash reports or diagnostic data.


3. Information Processed Locally on Your Device

The core function of this application is to create an index of local files that you specify.

  • All Processing is Offline: The entire indexing process is self-contained and occurs exclusively on your device. The indexed data and the original files are never sent over the internet or to any external server.

  • You Control Your Personal Information: If the files you choose to index contain personal information, you remain in complete control of that data. Because the application does not transmit your data externally, your privacy is preserved.


4. User Support

We are committed to providing support without collecting your personal information.

  • Official X Account: All support and inquiries are handled through our official X (formerly Twitter) account: @FindSparkSup.

  • No Email Support: To ensure anonymous support and protect your privacy, we do not offer assistance via email.

  • A Note on Public Communication: Please be mindful not to share your own personal or confidential information in any public posts when seeking support.


5. Your Rights Under GDPR and CCPA

Find Spark respects the principles of the General Data Protection Regulation (GDPR) and the California Consumer Privacy Act (CCPA).

  • You Are the Data Controller: As all data is stored and processed on your device, you are in complete control. You have the full right to access, rectify, and erase your data.

  • How to Exercise Your Rights: You do not need to send us a request to exercise your rights. You can manage your data at any time by deleting the source files or by rebuilding/deleting the index within the application.

  • No Data Transfers: No cross-border data transfers occur, as no data ever leaves your device through the application.


6. Children's Privacy

This application does not knowingly collect any personal information from children under the age of 13 (or the relevant age in your jurisdiction).


7. Changes to This Privacy Policy

This privacy policy may be updated to reflect changes in the law or our services. If significant changes are made, we will notify users through appropriate channels.


8. Contact Us

For any questions or concerns regarding this privacy policy, please contact us at our official X account:

@FindSparkSup

月曜日, 1月 27, 2025

2024年版:経営者のためのAI導入戦略完全ガイド



AI革命の時代:あなたの組織は準備できていますか?

現代のビジネス環境において、経営者が直面している現実があります:66%の人々が人工知能(AI)が自身の生活を根本的に変えると考え、その半数以上が変化に対して大きな不安を抱いています。これは単なる技術革新ではなく、すでに顕著な成果を示している変革の波です。最新のデータによると、企業の55%が少なくとも1つのビジネス機能でAIを活用しており、2017年のわずか20%から劇的に増加しています。もはや問題は、AIを導入するかどうかではなく、いかに従業員の信頼を維持しながら、法令順守の下で成功に導くかということです。

ビジネスインパクト:無視できない数字が示す真実

AI導入を支持するデータは説得力があり、その緊急性も増しています。AIの導入に成功した組織では、42%がコスト削減を達成し、59%が売上増加を実現しています。さらに注目すべきは、AIを効果的に実装している高業績企業は、同業他社と比較して10%以上の収益増加を達成する確率が約3倍高いという事実です。ただし、これらの機会には課題も伴います:76%の経営者がAI統合は決して容易ではないと認め、AIパイロットプロジェクトの本番移行成功率は54%にとどまっています。

成功の基盤構築:人間中心のアプローチ

AI導入の成功の鍵は、単なる技術的なアップグレード以上のものとして認識することにあります。最も優れた結果を出している組織は、技術的な考慮事項と共に人的要因を重視する包括的なアプローチを採用しています。これは特に重要な戦略であり、現在Fortune 500企業の137社がAI規制を重要なビジネスリスクとして認識していることからも明らかです。

戦略的導入:成功への道筋

効果的なAI統合への道のりには、慎重に計画されたアプローチが必要です。法務、コンプライアンス、データサイエンス、経営陣を統合したAIガバナンス戦略の確立から始めましょう。このフレームワークには以下が含まれます:

まず、組織のAI対応状況を徹底的に評価し、技術的能力と従業員の準備状況の両方を検討します。この初期段階は極めて重要です。というのも、組織はAIスキルの不足(33%)とデータの複雑さ(25%)を主な導入障壁として報告しているからです。

次に、包括的なコミュニケーション戦略を策定します。最も成功している導入事例では、AI施策に関する定期的な更新と、AIが人間の仕事を代替するのではなく補完するという具体的な例示を組み合わせることで、従業員の抵抗を大幅に軽減し、採用率を向上させています。

最後に、影響力が高く、リスクの低い領域から優先的に展開する段階的なロールアウトアプローチを実施します。この戦略により、組織は早期の成功事例を示しながら、自信と専門知識を築くことができます。

実践へ:経営者のための具体的なステップ

これらの洞察を実践に移すため、以下の実証済み戦略に焦点を当てましょう:

現在および今後の規制要件に対応する明確なガバナンスフレームワークを確立することから始めます。AI規制は急速に進化しているため、フレームワークは順守体制を維持しながら適応可能でなければなりません。

AIツールとその応用について理解を深める包括的な研修プログラムに投資します。従業員教育と導入プロセスへの参加が、採用率と成果を大幅に向上させることが報告されています。

継続的な改善を可能にするフィードバック機構を構築します。最も成功している導入事例では、従業員からの意見に対するオープンなチャネルを維持し、実際の結果とユーザー体験に基づいて定期的にアプローチを調整しています。

未来への展望:次のステップ

AI革命は前例のない機会と重要な課題の両方をもたらします。データは明確です:従業員の信頼と法令順守を維持しながらAIを成功裏に導入している組織は、大きな成果を上げています。AI導入領域で63%の企業が売上成長を報告しており、行動を起こすビジネスケースは説得力があります。

明確なガバナンス体制の確立、透明性のあるコミュニケーション、そしてコンプライアンスと従業員エンゲージメントの両方への揺るぎない焦点を当てることから始めましょう。成功するAI導入は、単なる技術の問題ではありません。規制の範囲内で組織の全員に利益をもたらす持続可能なイノベーションフレームワークを作ることなのです。

今日から、貴社のAI対応状況を評価し、包括的な導入戦略の策定に着手しましょう。ビジネスの未来はAIが実現します。行動を起こすべき時は今です。

Mastering AI Implementation: A Strategic Guide for Business Leaders in 2025

 



The AI Revolution Is Here: Are You Ready to Lead?

In today's business landscape, a striking reality confronts every leader: 66% of people believe artificial intelligence will fundamentally reshape their lives, with more than half harboring significant anxieties about these changes. This isn't just another technological shift – it's a transformative wave that's already showing remarkable results. Recent data reveals that 55% of organizations now leverage AI in at least one business function, a dramatic leap from just 20% in 2017. The question isn't whether to implement AI, but how to do it successfully while maintaining employee trust and regulatory compliance.

The Business Impact: Numbers That Demand Attention

The evidence supporting AI adoption is compelling and increasingly urgent. Organizations that have successfully implemented AI are reporting transformative results – 42% have achieved significant cost reductions, while an impressive 59% have experienced revenue increases. Even more telling, high-performing companies implementing AI are nearly three times more likely to see revenue jumps exceeding 10% compared to their peers. However, these opportunities come with challenges: 76% of business leaders acknowledge that integrating AI has been far from straightforward, and only 54% of AI pilots successfully transition to production.

Building a Foundation for Success: The People-First Approach

The key to successful AI implementation lies in recognizing it as more than a technological upgrade. Organizations achieving the best results are taking a comprehensive approach that prioritizes human factors alongside technical considerations. This strategy is particularly crucial given that 137 Fortune 500 companies now identify AI regulation as a significant business risk – a 500% increase in recent years.

Strategic Implementation: The Path Forward

The journey to successful AI integration requires a carefully orchestrated approach. Begin by establishing a robust AI governance strategy that brings together legal, compliance, data science, and executive teams. This framework should include:

First, conduct a thorough assessment of your organization's AI readiness, examining both technical capabilities and employee preparedness. This initial step has proven crucial, as organizations report that lack of AI skills (33%) and data complexity (25%) are primary implementation hurdles.

Next, develop a comprehensive communication strategy. The most successful implementations have shown that regular updates about AI initiatives, coupled with concrete examples of how AI will augment rather than replace human work, significantly reduce employee resistance and improve adoption rates.

Finally, implement a phased rollout approach that prioritizes high-impact, low-risk areas first. This strategy allows organizations to demonstrate quick wins while building confidence and expertise. Companies following this method report higher success rates in moving AI projects from pilot to production.

Making It Work: Practical Steps for Leaders

To translate these insights into action, focus on these proven strategies:

Start by establishing clear governance frameworks that address both current and emerging regulatory requirements. With AI regulations rapidly evolving, your framework must be adaptable while maintaining robust compliance protocols.

Invest in comprehensive training programs that demystify AI tools and their applications. Organizations report that employee education and involvement in the implementation process significantly improve adoption rates and outcomes.

Create feedback mechanisms that enable continuous improvement. The most successful implementations maintain open channels for employee input and regularly adjust their approach based on real-world results and user experiences.

Charting the Course Forward: Your Next Steps

The AI revolution presents both unprecedented opportunities and significant challenges. The data is clear: organizations that successfully implement AI while maintaining employee trust and regulatory compliance are seeing substantial rewards. With 63% of companies reporting revenue growth in areas where AI was implemented, the business case for action is compelling.

Begin your journey by establishing a clear governance structure, prioritizing transparent communication, and maintaining a steadfast focus on both compliance and employee engagement. Remember, successful AI implementation isn't just about technology – it's about creating a sustainable framework for innovation that benefits everyone in your organization while staying within regulatory boundaries.

Take the first step today by assessing your organization's AI readiness and developing a comprehensive implementation strategy. The future of business is AI-enabled, and the time to act is now.