2013-11-20 26 views
1

我正在使用LocBaml本地化WPF应用程序。我已成功创建了附属程序集并将它们放入适当的文件夹中。我从我的盒子里运行应用程序,它效果很好!随时更改语言等问题是,我不能在任何其他机器上运行它,但我的。我可以让同事在他们的盒子上编译应用程序,并且我可以成功地从映射到我的机器上运行应用程序,但他不能。这是完全令人困惑的。我敢肯定这件事很简单,我忽略了它。使用LocBaml的WPF本地化:System.IO.IOException未处理

System.IO.IOException was unhandled 
    HResult=-2146232800 
    Message=Cannot locate resource 'maincontrol.baml'. 
    Source=PresentationFramework 
    StackTrace: 
     at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access) 
     at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access) 
     at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) 
     at DCG.Designer.Library.MainControl.InitializeComponent() in D:\TFS\CardWizard Software Main\Trunk\ClientInterfaces\DCG.Designer.Library\obj\Debug\MainControl.g.vb:line 628 
     at DCG.Designer.Library.MainControl..ctor() in D:\TFS\CardWizard Software Main\Trunk\ClientInterfaces\DCG.Designer.Library\MainControl.xaml.vb:line 42 
     at DCG.Designer.MainWindow.libWindow_LanguageChanged(Object sender, CultureInfo Language) in D:\TFS\CardWizard Software Main\Trunk\ClientInterfaces\DCG.Designer\MainWindow.xaml.vb:line 240 
     at DCG.Designer.Library.MainControl.Language_Click(Object sender, RoutedEventArgs e) in D:\TFS\CardWizard Software Main\Trunk\ClientInterfaces\DCG.Designer.Library\MainControl.xaml.vb:line 808 
     at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) 
     at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) 
     at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg) 
     at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
     at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
     at System.Windows.Threading.DispatcherOperation.InvokeImpl() 
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
     at System.Windows.Threading.DispatcherOperation.Invoke() 
     at System.Windows.Threading.Dispatcher.ProcessQueue() 
     at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
     at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
     at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
     at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
     at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
     at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 
     at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
     at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 
     at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 
     at System.Windows.Application.RunInternal(Window window) 
     at System.Windows.Application.Run() 
     at DCG.Designer.Application.Main() in D:\TFS\CardWizard Software Main\Trunk\ClientInterfaces\DCG.Designer\obj\Debug\Application.g.vb:line 65 
     at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) 
     at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
     at System.Threading.ThreadHelper.ThreadStart() 

回答

0

当然,在两天的自我激发后,结果是我只需要签署程序集。我的应用程序是用一个唯一的密钥签名的,因此我的本地化程序集也需要进行签名。仍然没有回答为什么它在我的机器上无效签名,但无论如何,它现在的作品!

来到这里的答案:

SN.EXE -R SV-SE \ my.resources.dll my.snk

http://social.msdn.microsoft.com/Forums/vstudio/en-US/35d7be1b-a0bb-4388-b05f-70182f0e9018/locbaml-doesnt-work

我用下面我签订新的本地化组件