对于UWP应用,该程序已退出,代码为-1073741701(0xc000007b)

时间:2019-11-18 21:24:36

标签: c# .net-core uwp

我已经开发UWP应用已有一段时间了。完全没有问题。将其连接到git repo和所有内容。因此,此解决方案和项目在3天前运行正常。我完成了一天的工作,提交了回购协议并关闭了计算机。当我今天回来时,尝试在Visual Studio 2019中启动我的UWP以在本地计算机上开始调试时,我收到以下消息:

  

目标进程退出而没有引发CoreCLR启动事件。确保将目标进程配置为使用.NET Core。如果目标进程未在.NET Core上运行,则可能会出现这种情况。   程序“ [2812] LaserMeasurementTool.exe”已退出,代码为-1073741701(0xc000007b)。   Windows Store应用程序“ 062a9632-d22f-4d48-991a-d1d51afe77e5_ebvsp9khn4a7w!App”的激活失败,错误为“应用程序未启动”。

Error message 1

有时在0xc000007b错误代码之后,它显示“找不到dll”,但并非每次都显示。

到目前为止,我已经尝试过:

  • 清洁并重建解决方案
  • 修复Visual Studio

我看到很多人都有这个问题。但是没有建议的解决方案对我有用。想知道是否还有更多我可以解决这个问题。如果无法运行我的程序来测试它,我做不到很多。

非常感谢您!

更新

自从第一篇文章开始,我已经尝试了其他一些方法: 我已将VS 2019中的调试器更改为仅本机。这提示了一个不同的错误对话框 Error message 2

此后,通过单击“帮助”将我带到this site

此页面可让我打开事件查看器以获取有关该问题的更多详细信息,这是事件查看器给我的:

  

激活062a9632-d22f-4d48-991a-d1d51afe77e5_ebvsp9khn4a7w!应用失败。错误代码:该应用未启动。.激活阶段:COM ActivateExtension

最后,此时VS 2019中的输出窗口显示如下:

  

'LaserMeasurementTool.exe'(Win32):已加载'\ lav-dc1 \ Folder Redirection \ bwhelan \ Documents \ Source \ Repos \ 132 Laser Measurement Tool \ LaserMeasurementTool \ LaserMeasurementToolUWP \ bin \ x86 \ Debug \ AppX \ LaserMeasurementTool.exe '。   'LaserMeasurementTool.exe'(Win32):已加载'C:\ WINDOWS \ System32 \ ntdll.dll'。符号已加载。   'LaserMeasurementTool.exe'(Win32):已加载'C:\ WINDOWS \ System32 \ kernel32.dll'。符号已加载。   'LaserMeasurementTool.exe'(Win32):已加载'C:\ WINDOWS \ System32 \ KernelBase.dll'。符号已加载。   'LaserMeasurementTool.exe'(Win32):已加载'C:\ WINDOWS \ System32 \ ucrtbase.dll'。符号已加载。   'LaserMeasurementTool.exe'(Win32):已加载'C:\ Program Files \ WindowsApps \ Microsoft.NET.CoreRuntime.2.2_2.2.27902.3_x86__8wekyb3d8bbwe \ uwphost.dll'。   'LaserMeasurementTool.exe'(Win32):已卸载'C:\ Program Files \ WindowsApps \ Microsoft.NET.CoreRuntime.2.2_2.2.27902.3_x86__8wekyb3d8bbwe \ uwphost.dll'   线程0x3b30已退出,代码为-1073741701(0xc000007b)。   线程0x1208已退出,代码为-1073741701(0xc000007b)。   程序“ [15228] LaserMeasurementTool.exe”已退出,代码为-1073741701(0xc000007b)。

总体而言,它仍然无法正常工作,我想我会添加这些东西,这些东西我现在已经尝试过,但由于我的情况而失败了。

更新CSPROJ文件

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProjectGuid>Removed for safety</ProjectGuid>
    <OutputType>AppContainerExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>LaserMeasurementTool</RootNamespace>
    <AssemblyName>LaserMeasurementTool</AssemblyName>
    <DefaultLanguage>en-US</DefaultLanguage>
    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
    <TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>Removed for safety</ProjectTypeGuids>
    <WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
    <AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
    <GenerateAppInstallerFile>False</GenerateAppInstallerFile>
    <AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
    <AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
    <GenerateTestArtifacts>True</GenerateTestArtifacts>
    <AppxBundle>Always</AppxBundle>
    <AppxBundlePlatforms>x86|x64</AppxBundlePlatforms>
    <HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x86\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <EnableGatekeeperAnalysis>false</EnableGatekeeperAnalysis>
    <UseDotNetNativeToolchain>false</UseDotNetNativeToolchain>
    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
    <OutputPath>bin\x86\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\ARM\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>ARM</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
    <OutputPath>bin\ARM\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>ARM</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\ARM64\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>ARM64</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
    <OutputPath>bin\ARM64\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>ARM64</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x64\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
    <OutputPath>bin\x64\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup>
    <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="MainPage.xaml.cs">
      <DependentUpon>MainPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Models\DataModel.cs" />
    <Compile Include="Models\ExportModel.cs" />
    <Compile Include="Models\ImportModel.cs" />
    <Compile Include="Models\LoginModel.cs" />
    <Compile Include="Models\ProgramDataModel.cs" />
    <Compile Include="Models\SettingsModel.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Utilities\CollectionConverter.cs" />
    <Compile Include="Utilities\ExcelBuilder.cs" />
    <Compile Include="Utilities\JSON.cs" />
    <Compile Include="Utilities\Messages.cs" />
    <Compile Include="Utilities\DataHelper.cs" />
    <Compile Include="ViewModels\AdminViewModel.cs" />
    <Compile Include="ViewModels\BaseViewModel.cs" />
    <Compile Include="ViewModels\CalibrationViewModel.cs" />
    <Compile Include="ViewModels\DatabaseViewModel.cs" />
    <Compile Include="ViewModels\GeneralViewModel.cs" />
    <Compile Include="ViewModels\LoginChangePasswordViewModel.cs" />
    <Compile Include="ViewModels\LoginViewModel.cs" />
    <Compile Include="ViewModels\MainDisplayViewModel.cs" />
    <Compile Include="ViewModels\MainViewModel.cs" />
    <Compile Include="ViewModels\SettingsViewModel.cs" />
    <Compile Include="Views\AdminAccountView.xaml.cs">
      <DependentUpon>AdminAccountView.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Admin\AddAccount.xaml.cs">
      <DependentUpon>AddAccount.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Admin\EditAccount.xaml.cs">
      <DependentUpon>EditAccount.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Admin\MainAccount.xaml.cs">
      <DependentUpon>MainAccount.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\ChangePasswordView.xaml.cs">
      <DependentUpon>ChangePasswordView.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\General\Calibration.xaml.cs">
      <DependentUpon>Calibration.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\General\Database.xaml.cs">
      <DependentUpon>Database.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\General\Main.xaml.cs">
      <DependentUpon>Main.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\General\Settings.xaml.cs">
      <DependentUpon>Settings.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\LoginView.xaml.cs">
      <DependentUpon>LoginView.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\MainView.xaml.cs">
      <DependentUpon>MainView.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\GeneralView.xaml.cs">
      <DependentUpon>GeneralView.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\TestView.xaml.cs">
      <DependentUpon>TestView.xaml</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <AppxManifest Include="Package.appxmanifest">
      <SubType>Designer</SubType>
    </AppxManifest>
  </ItemGroup>
  <ItemGroup>
    <Content Include="Assets\img\Add.png" />
    <Content Include="Assets\img\Add_DarkGray.png" />
    <Content Include="Assets\img\Add_White.png" />
    <Content Include="Assets\img\BackBtn.png" />
    <Content Include="Assets\img\BackBtn_White.png" />
    <Content Include="Assets\img\Checkmark.png" />
    <Content Include="Assets\img\Checkmark_White.png" />
    <Content Include="Assets\img\LaveerLogo.png" />
    <Content Include="Assets\img\Load.png" />
    <Content Include="Assets\img\Load_White.png" />
    <Content Include="Assets\img\Lock.png" />
    <Content Include="Assets\img\LogoutBtn.png" />
    <Content Include="Assets\img\LogoutBtn_White.png" />
    <Content Include="Assets\img\Person.png" />
    <Content Include="Assets\img\Plus.png" />
    <Content Include="Assets\img\Plus_White.png" />
    <Content Include="Assets\img\RemoveBtn.png" />
    <Content Include="Assets\img\EditBtn.png" />
    <Content Include="Assets\img\EditBtn_White.png" />
    <Content Include="Assets\img\Lock_White.png" />
    <Content Include="Assets\img\RemoveBtn_White.png" />
    <Content Include="Assets\img\Sync.png" />
    <Content Include="Assets\img\Sync_Shadow.png" />
    <Content Include="Assets\img\Sync_White.png" />
    <Content Include="Assets\img\X.png" />
    <Content Include="Assets\img\X_LightGray.png" />
    <Content Include="Assets\img\X_White.png" />
    <Content Include="Assets\LoginBackground.jpg" />
    <Content Include="Assets\img\Person_White.png" />
    <Content Include="Assets\img\ViewBtn.png" />
    <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>
    <ApplicationDefinition Include="App.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
    <Page Include="MainPage.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Styles\Styles.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\AdminAccountView.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\Admin\AddAccount.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\Admin\EditAccount.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\Admin\MainAccount.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\ChangePasswordView.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\General\Calibration.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\General\Database.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\General\Main.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\General\Settings.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\LoginView.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\MainView.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\GeneralView.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\TestView.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Net.Native.Compiler">
      <Version>2.2.3</Version>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.NETCore.Runtime.CoreCLR">
      <Version>2.0.8</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.NETCore.Runtime.Native">
      <Version>1.0.1</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
      <Version>6.2.9</Version>
    </PackageReference>
    <PackageReference Include="MvvmLight">
      <Version>5.4.1.1</Version>
    </PackageReference>
    <PackageReference Include="MvvmLightLibs">
      <Version>5.4.1.1</Version>
    </PackageReference>
    <PackageReference Include="Newtonsoft.Json">
      <Version>12.0.3</Version>
    </PackageReference>
    <PackageReference Include="Syncfusion.DataGridExcelExport.UWP">
      <Version>17.3.0.28</Version>
    </PackageReference>
    <PackageReference Include="Syncfusion.Licensing">
      <Version>17.3.0.28</Version>
    </PackageReference>
    <PackageReference Include="Syncfusion.Pdf.UWP">
      <Version>17.3.0.28</Version>
    </PackageReference>
    <PackageReference Include="Syncfusion.SfChart.UWP">
      <Version>17.3.0.28</Version>
    </PackageReference>
    <PackageReference Include="Syncfusion.SfGauge.UWP">
      <Version>17.3.0.28</Version>
    </PackageReference>
    <PackageReference Include="Syncfusion.SfGrid.UWP">
      <Version>17.3.0.28</Version>
    </PackageReference>
    <PackageReference Include="Syncfusion.SfInput.UWP">
      <Version>17.3.0.28</Version>
    </PackageReference>
    <PackageReference Include="Syncfusion.XlsIO.UWP">
      <Version>17.3.0.28</Version>
    </PackageReference>
    <PackageReference Include="System.Dynamic.Runtime">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Runtime.CompilerServices.Unsafe">
      <Version>4.6.0</Version>
    </PackageReference>
  </ItemGroup>
  <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
    <VisualStudioVersion>14.0</VisualStudioVersion>
  </PropertyGroup>
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

1 个答案:

答案 0 :(得分:2)

我以前见过这个问题,有点难以捉摸。尝试关闭Visual Studio并删除文件夹中的binobj文件夹。这应该确保没有残留物(有时使用Clean Solution是不够的)。然后通过“开始”菜单从PC上卸载应用程序的已安装版本,以便从全新状态进行安装。

如果这无济于事,我发现有几个报告说项目文件夹中有无效的App.config文件时发生了此问题。检查是否没有App.config文件,如果是,请尝试将其删除。

如果这两种方法均失败,也请尝试将项目克隆到其他位置,然后重试。确保项目路径不要太长(此问题在今天并不那么严重,但仍然确实发生,由于bin文件路径是太深)。