2013-11-20 46 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

我用下面我簽訂新的本地化組件

相關問題