0

空白のwpf.Net3.5プロジェクトを作成すると問題が発生します。Visual Studioがエラーをスローし、動作を停止しました。これは非常に奇妙なことです。Windowsフォームのような.Net3.5で他のプロジェクトを作成したとき、それは機能しました(他の.Netフレームワークでもエラーなしでテストしました)。
コピーされたエラーの詳細は次のとおりです。

  System.ArgumentException
  Type universe cannot resolve assembly: System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
  at System.Reflection.Adds.TypeNameParser.DetermineAssembly(AssemblyName assemblyName, Module defaultTokenResolver, ITypeUniverse universe)
  at System.Reflection.Adds.TypeNameParser.<>c__DisplayClass2.<ParseTypeName>b__0(AssemblyName assemblyName)
  at System.TypeNameParser.ResolveAssembly(String asmName, Func`2 assemblyResolver, Boolean throwOnError, StackCrawlMark& stackMark)
  at System.TypeNameParser.ConstructType(Func`2 assemblyResolver, Func`4 typeResolver, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark)
  at System.TypeNameParser.GetType(String typeName, Func`2 assemblyResolver, Func`4 typeResolver, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark)
  at System.Type.GetType(String typeName, Func`2 assemblyResolver, Func`4 typeResolver, Boolean throwOnError)
  at System.Reflection.Adds.TypeNameParser.ParseTypeName(ITypeUniverse universe, Module module, String input, Boolean throwOnError)
  at Microsoft.MetadataReader.UnresolvedTypeName.ConvertToType(ITypeUniverse universe, Module moduleContext)
  at Microsoft.MetadataReader.MetadataExtensionsPolicy20.TryTypeForwardResolution(MetadataOnlyAssembly assembly, String fullname, Boolean ignoreCase)
  at Microsoft.MetadataReader.MetadataOnlyAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
  at Microsoft.MetadataReader.MetadataOnlyAssembly.GetType(String name)
  at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.GetAssemblyType(Reflectable`1 assembly, String typeName)
  at MS.Internal.Metadata.ClrAssembly.GetType(String typeName)
  at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.LoadType(String typeName)
  at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.GetType(String fullName)
  at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.GetType(String fullName)
  at Microsoft.Windows.Design.Metadata.IdentifierExtensionImplementations.GetType(IMetadataContext scope, TypeIdentifier typeId)
  at MS.Internal.Design.Metadata.Xaml.XamlAssembly.get_XmlNamespaceCompatibilityMappings()
  at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata sourceAssembly)
  at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensions.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata source)
 at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption()
 at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier)
 at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context)
 at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider)
 at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors)
 at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem()
 at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem()
 at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState()
 at MS.Internal.Host.PersistenceSubsystem.Load()
 at MS.Internal.Host.Designer.Load()
 at MS.Internal.Designer.VSDesigner.Load()
 at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()
 at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)
 at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
 at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
 at MS.Internal.Host.Isolation.IsolatedDesigner.Load()
 at MS.Internal.Designer.DesignerPane.LoadDesignerView()

画像:

ここに画像の説明を入力してください また、Visual Studioの修復、アンインストール、再インストールを試みましたが、それでもエラーが発生します。
何か助けはありますか?
更新:エラーは、xamlファイルを開いたときにのみ発生します。

4

2 に答える 2

0

何らかの理由で、3.5コードにsystem.XAML4.0への参照があります。プロジェクトをアンロードしてから編集します。system.XAMLが含まれている行を見つけて、削除します。プロジェクトをリロードした後、3.5バージョンを手動で追加できます。

于 2012-06-28T04:51:58.410 に答える
0

最後に、私はそれを修正しました。VS SP1を更新しようとすると、エラーが発生しました

インストールログファイルに書き込めませんでした。Tempフォルダーが存在し、書き込み可能であることを確認します。

次に、 %temp%ディレクトリがアクセスしないことを認識します。次に、環境変数に移動して%temp%パスを変更します(これまでこの変数に触れたことはありません)。セットアップVSSP1は正常に機能しました。また、このWPFエラーが修正されました。

于 2012-06-30T11:38:19.330 に答える