gpt4 book ai didi

c# - Windows Phone 8 应用程序不包含 InitializeComponent 的定义

转载 作者:太空狗 更新时间:2023-10-29 21:08:44 24 4
gpt4 key购买 nike

我刚刚下载了 14 CTP 版本的 Visual Studio 并为 Windows Phone 创建了一个空白应用程序。我尝试打开 MainPage.xaml,设计器显示以下错误:

enter image description here

对于那些看不到图片的人:

System.Exception
Package failed updates, dependency or conflict validation.

Windows cannot install package App.a5cd6ef3c.a895b.a4508.a96fd.af1634c30bb13 because this package depends on another package that could not be found. This package requires minimum version 0.0.0.0 of framework Microsoft.VCLibs.140.00.Debug published by any publisher to install. Provide the framework along with this package.
at Microsoft.Expression.HostUtility.Platform.AppContainerProcessDomainFactory.CreateDesignerProcess(String applicationPath, String clientPort, Uri hostUri, IDictionary environmentVariables, Int32& processId, Object& processData)
at Microsoft.Expression.DesignHost.Isolation.Primitives.ProcessDomainFactory.ProcessIsolationDomain..ctor(ProcessDomainFactory factory, IIsolationBoundary boundary, AppDomainSetup appDomainInfo, FrameworkName targetFramework, String identifier, String baseDirectory)
at Microsoft.Expression.DesignHost.Isolation.Primitives.ProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary)
at Microsoft.Expression.HostUtility.Platform.AppContainerProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary)
at Microsoft.Expression.DesignHost.Isolation.Primitives.IsolationBoundary.Initialize()
at Microsoft.Expression.DesignHost.Isolation.Primitives.IsolationBoundary.CreateInstance[T](Type type)
at Microsoft.Expression.DesignHost.Isolation.IsolatedObjectFactory.Initialize()
at Microsoft.VisualStudio.ExpressionHost.Services.VSIsolationService.CreateObjectFactory(IIsolationTarget isolationTarget, IObjectCatalog catalog)
at Microsoft.Expression.DesignHost.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget)
at Microsoft.Expression.DesignHost.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget)
at Microsoft.Expression.DesignHost.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget)
at Microsoft.Expression.DesignHost.IsolatedDesignerService.CreateLease(IIsolationTarget isolationTarget, CancellationToken cancelToken, DesignerServiceEntry& entry)
at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)
at Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler.InvokeWithCulture[T](CultureInfo culture, Func`2 func, CancellationToken cancelToken)
at Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler.<>c__DisplayClass5`1.<StartTask>b__7()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

我输入了 App1.xaml.csMainPage.xaml.cs 并且我看到了 AppMainPage,分别没有 InitializeComponent() 的定义。

该项目处于 Visual Studio 创建时的状态,我没有做任何更改!

为什么会发生这种情况,我该如何解决?

最佳答案

今天同样的事情开始发生在我身上;为重现该问题,我只打开 Visual Studio 2013 Update 4,创建一个空白的 Windows Phone 8.1 并双击 MainPage.xaml。

我通过执行以下操作(混合了我在网上阅读的内容)解决了问题:

  • 退出所有 Visual Studio 实例
  • 删除 %localappdata%\Microsoft\VisualStudio\12.0\Designer\ShadowCache 上的所有内容
  • 使用管理员权限打开命令提示符并执行以下命令:

    pushd %VS110COMNTOOLS%
    icacls ..\IDE /grant *S-1-15-2-1:(OI)(F)
    icacls ..\IDE /grant *S-1-15-2-1:(CI)(F)
    icacls ..\IDE\PrivateAssemblies /grant *S-1-15-2-1:(OI)(F)
    icacls ..\IDE\PrivateAssemblies /grant *S-1-15-2-1:(CI)(F)
    icacls ..\IDE\PublicAssemblies /grant *S-1-15-2-1:(OI)(F)
    icacls ..\IDE\PublicAssemblies /grant *S-1-15-2-1:(CI)(F)

最后,重启。适用于 Windows 8.1 64 位。

关于c# - Windows Phone 8 应用程序不包含 InitializeComponent 的定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24593249/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com