Closed BennyKJohnson closed 8 years ago
Hello,
I added every SharpDX library that is included with ATF to the Circuit Editor sample app, and I'm not getting that exception. It's legal and normal to reference the same dll from multiple projects.
Do you have the setting "break when an exception is thrown" set for all exceptions? This is in Debug -> Exceptions. I'm wondering if you have accidentally defined a method named ResourceUtil.Register(Type)
. That static Resources class uses reflection to search for that method, but it will throw an exception if it finds two of them. You would see an InvalidOperationException being raised in this case, but if you don't have break-on-exceptions turned on, you might just see the TypeInitializationException thrown afterwards, whose InnerException property is the original InvalidOperationException.
If that's not it, maybe you could set a breakpoint in Sce.Atf.Resources, in the static constructor, and see how far execution gets (if at all).
Please let me know how it goes and if you can report more info.
--Ron
I am also getting the same error, by including the SharpDX 3.1.1 library without any references (in code) to it.
System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Sce.Atf.Applications.StandardEditCommands' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint: ContractName Sce.Atf.Applications.IContextRegistry RequiredTypeIdentity Sce.Atf.Applications.IContextRegistry
Resulting in: Cannot set import 'Sce.Atf.Applications.StandardEditCommands..ctor (Parameter="contextRegistry", ContractName="Sce.Atf.Applications.IContextRegistry")' on part 'Sce.Atf.Applications.StandardEditCommands'. Element: Sce.Atf.Applications.StandardEditCommands..ctor (Parameter="contextRegistry", ContractName="Sce.Atf.Applications.IContextRegistry") --> Sce.Atf.Applications.StandardEditCommands --> TypeCatalog (Types='Sce.Atf.Applications.SettingsService, Sce.Atf.Applications.StatusService, ...').
System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Sce.Atf.Applications.StandardEditHistoryCommands' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint: ContractName Sce.Atf.Applications.IContextRegistry RequiredTypeIdentity Sce.Atf.Applications.IContextRegistry
Resulting in: Cannot set import 'Sce.Atf.Applications.StandardEditHistoryCommands..ctor (Parameter="contextRegistry", ContractName="Sce.Atf.Applications.IContextRegistry")' on part 'Sce.Atf.Applications.StandardEditHistoryCommands'. Element: Sce.Atf.Applications.StandardEditHistoryCommands..ctor (Parameter="contextRegistry", ContractName="Sce.Atf.Applications.IContextRegistry") --> Sce.Atf.Applications.StandardEditHistoryCommands --> TypeCatalog (Types='Sce.Atf.Applications.SettingsService, Sce.Atf.Applications.StatusService, ...').
System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Sce.Atf.Applications.StandardSelectionCommands' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint: ContractName Sce.Atf.Applications.IContextRegistry RequiredTypeIdentity Sce.Atf.Applications.IContextRegistry
Resulting in: Cannot set import 'Sce.Atf.Applications.StandardSelectionCommands..ctor (Parameter="contextRegistry", ContractName="Sce.Atf.Applications.IContextRegistry")' on part 'Sce.Atf.Applications.StandardSelectionCommands'. Element: Sce.Atf.Applications.StandardSelectionCommands..ctor (Parameter="contextRegistry", ContractName="Sce.Atf.Applications.IContextRegistry") --> Sce.Atf.Applications.StandardSelectionCommands --> TypeCatalog (Types='Sce.Atf.Applications.SettingsService, Sce.Atf.Applications.StatusService, ...').
I was wondering if there was any resolution to this? Throws on Atf.Core.vs2010/ATF/Framework/ATF.Core/MefUtil.cs line 60.
Hi, Currently ATF is in maintenance mode, no more work will be done expect major bug fixes.
Thanks Alan
Hi, ATF is great. However for my current project I need access to the SharpDX libraries. When I add a reference to SharpDX in an ATF project I receive the error "System.TypeInitializationException". If I'm not mistaken I believe this issue is the result of SharpDX already being used in the ATF framework.
I was wondering if anyone knew how to resolve this issue or other method to get access to the SharpDX libraries within the main project.
Full Error: An exception of type 'System.TypeInitializationException' occurred in Atf.Gui.WinForms.dll but was not handled in user code Additional information: The type initializer for 'Sce.Atf.Resources' threw an exception.
Thanks