E
heiho
folgenes, ich habe eine solution in der ich ein projekt hab was eine dll baut, drunter dann ein consolen projekt um dieses zu testen und ein wpf projekt
also
- wpfapp (wpf)
- modules (dll)
- testapplication (c# console)
alles funktioniert soweit, das problem ist nur, das "modules" steht als startup projekt, sobald ich das wpf als startup projekt definiere, kann die window 1 xaml nicht mehr dargestellt werden, und beim starten wirfts eine exception:
visual studio window1.xaml schrieb:
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.InitApplicationAssembly(AssemblyName applicationAssembly)
at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.InitApplicationAssembly(AssemblyName applicationAssembly)
at MS.Internal.Package.VSIsolationProviderService.CreateIsolationProvider(String identity, AssemblyReferenceProvider assemblyReferences, IEnumerable`1 assemblyFolders)
at MS.Internal.Providers.VSDesignerContext.GetIsolationProvider(IServiceProvider provider, IVsHierarchy hierarchy, AssemblyReferenceProvider assemblyReferences)
at MS.Internal.Providers.VSDesignerContext.Initialize(IServiceProvider provider, IVsHierarchy hierarchy, UInt32 itemid, Object docDataObj)
at MS.Internal.Providers.VSDesignerContext..ctor(IServiceProvider provider, IVsWindowFrame frame, Object docDataObj)
at MS.Internal.Providers.VSDesignerContext.GetContext(IServiceProvider services, IVsWindowFrame frame, Boolean createIfNotExist)
at MS.Internal.Designer.DesignerPane.InitializeDesigner()
The 'ResourceAssembly' property of the 'Application' type cannot be changed after it has been set.
at System.Windows.Application.set_ResourceAssembly(Assembly value)
startup:
exe schrieb:
Die in der Assembly "APFApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" definierte Instanz von "Window1" kann nicht erstellt werden. Ein Aufrufziel hat einen Ausnahmefehler verursacht. Fehler in Markupdatei "Window1.xaml", Zeile 1, Position 9.
sobald ich das startup wieder auf modules leg, funktioniert alles problemlos
hae???
//dazu edit
wenn ich das startup projekt auf das wpf leg, und dann visual studio neu starte, kann die window1 wieder normal angezeigt werden, aber die exe wirft (auch nach nem rebuild) diese nichts aussagende exception /=
//dazu edit 2
anscheinend wirft der window1 konstruktor diese exception, kann das loesen indem ich code zum loaded event schieb
finds nur komisch das das nicht shcon geworfen wurde als das projekt noch in einer eigenen solution lag
probleme sozusagen geloest
exe error liegt am code, und das aendern des startup projekts erfordert ein neustart von visual studio