数時間の調査の後、私自身の答えを見つけたので、ここに投稿しています。うまくいけば、これは将来他の人に役立つでしょう!
問題は、パッケージをビルドするときに BackgroundProcess.exe がプロジェクトに含まれていないことです。プロジェクトに含めるファイルは、.csproj
ファイルで定義されます。好みのテキスト エディターで開きます (忘れずに Visual Studio を閉じてください)。
アセットが定義されている場所を追加します。
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
このようなものに:
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
<Content Include="AppServiceBridgeSample.BackgroundProcess.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
ファイルの名前空間としてAppServiceBridgeSample .BackgroundProcces.exeを追加したことに注意してください。これが完全に必要かどうかはわかりませんが、これが私が修正した方法です。したがって、名前空間を修正するには、すべてのクラスの前にAppServiceBridgeSampleを追加する必要があります。また、Application > Assembly name & Default namespace の下の BackgroundProcess プロジェクトのプロパティにも、拡張子を追加します。
クラスの例:
namespace AppServiceBridgeSample.BackgroundProcess
{
class Program
{
....
}
}
そして.xaml
例:
<Page
x:Class="AppServiceBridgeSample.UWP.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AppServiceBridgeSample.UWP"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="Main"
mc:Ignorable="d">
...
</Page>
また、これは私が抱えていたエラーを自動的に修正しません。また、Build Eventを追加する必要があります。 BackgroundProcess (VS のプロジェクト) > プロパティ > ビルド イベント > ビルド後のイベント コマンド ラインの下で右クリックします。
xcopy /y /s "$(TargetPath)" "$(SolutionDir)UWP"
ソリューションをビルドしてデプロイすると、AppServiceBridgeSample.BackgroundProcess.exe ファイルが UWP プロジェクト ルート (ファイル エクスプローラーで表示) に存在する必要があります。
また、この調査中に Visual Studio 15 Enterprise Preview 3 に更新しました。これは、他のエラーが発生した場合にも役立つ可能性があります。