By Terry Bottorff - 10/9/2012
I create my installation package but I get the following error when I try and run my software on Client Machine.
ApplicationException An error occurred while creating the main form TargetInvocationException Exception has been thrown by the target of an invocation. FileNotFoundException Could not load file or assembly 'ProRodeoChecksLibBO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Source : MicroFour StrataFrame UI
Stack Trace: at ProRodeoChecks.MainChecksfrm.InitializeComponent() at ProRodeoChecks.MainChecksfrm..ctor() at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at MicroFour.StrataFrame.Application.StrataFrameApplication.RunApplication()
It seems like it can not find the BO Library, but I did copy the entire Subdirectory into the Installation Package. It also shows up on the client machine.
What am I overlooking? I am using a laptop that just has all of the required software to run SQL Express and all of the required .Net stuff.
TIA.
|
By Edhy Rijo - 10/9/2012
Hi Terry,
Don't panic this error is very common when doing first time installations. As you may know you can have all your assemblies installed under Windows GAC or better yet on your $TARGETDIR$ to make it easier to update your current installation.
I prefer to install everything on $TARGETDIR$, so if that is not your case, then change your IA setup to put all files in $TARGETDIR$ then try to install again.
|
By Trent L. Taylor - 10/9/2012
or one of its dependencies.
Be sure that ALL referenced assemblies in that project are also included as part of your deployment. Look at your development machine and copy the files in one by one until it works. Then you will know which files are missing. Also, depending on if you are doing version specific, you may have the assembly, not not the right version of the assembly. That can be a factor also.
|
By Terry Bottorff - 10/9/2012
OK so do I copy all of the BO's into the $TargetDir$ or will there just be a single Dll?
If it is a single Dll where do I find it?
TIA.
I have tried to put all Dll's that are referenced in the project in the $TargetDir$.
|
By Trent L. Taylor - 10/9/2012
You need to copy every assembly referenced on your application to the $TARGETDIR$. Open up your project, and then open up the references for each of the project that you have. Then make sure that each of those DLLs (assemblies) and/or EXEs make it into your $TARGETDIR$.
|
By Terry Bottorff - 10/9/2012
Thanks for both of your input and help. That got me past that issue. Now this is the first time I have used Messaging and I get the following error:
LocalizationKeyNotFoundException The specified key [numberofchecksneeded] was not found within the messaging database. FileNotFoundException The file [../../messages\Message_Languages.xml] could not be found. The localization languages table could not be loaded.
Source : MicroFour StrataFrame Base
Stack Trace: at MicroFour.StrataFrame.UI.Localization.LoadLanguageTable(Boolean IgnoreExceptions) at MicroFour.StrataFrame.UI.Localization.LoadXmlFile(Int32 LocaleID) at MicroFour.StrataFrame.UI.Localization.GetKeyRowFromXml(String Key) at MicroFour.StrataFrame.UI.Localization.GetKeyFromXml(String MessageKey) at MicroFour.StrataFrame.UI.Localization.RetrieveMessage(String MessageKey) at MicroFour.StrataFrame.Messaging.MessageForm.ShowMessageByKey(String MessageKey, Object[] ReplacementValues) at ProRodeoChecks.ChecksInfoBBfrm.btnfill_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m) at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I know it says it can not find the Message_Language.xml file and therefore it can not find the particular message. I tried copying in the complete Subdirectory where my messages are and I also copied in the 2 individual files into the #TargetDir$ and that did not work.
In my AppMain I have the following:
MicroFour.StrataFrame.UI.Lcalization.MessageXmlPath = "../../messages" Should I maybe make that "messages"????????
TIA.
|
By Edhy Rijo - 10/9/2012
Hi Terry,
I prefer to have my messages stored in an XML file included in the project, so in the AppMain.InitApplication I have these:
MicroFour.StrataFrame.UI.Localization.MessageKeyType = MicroFour.StrataFrame.Messaging.MessageKeyDataType.XML MicroFour.StrataFrame.UI.Localization.MessageLocaleID = MicroFour.StrataFrame.UI.Localization.GetActiveLanguage("YourApplicationKeyHere")
Then you need to include in your projects the following generated xml files:- Message_Languages.xml
- Messages_10033.xml
Now re-build and enjoy!!!
|
By Ivan George Borges - 10/9/2012
Hi Terry.
Just adding to Edhy's message, don't forget to set the XML file as an "Embedded Resource":
|
By Edhy Rijo - 10/9/2012
Ivan George Borges (10/9/2012) Just adding to Edhy's message, don't forget to set the XML file as an "Embedded Resource" Thanks Ivan, I forgot that part
|
By Terry Bottorff - 10/9/2012
Alright I think that answered one of my questions because I was going to ask Edhy if his "included in the project" meant 'Embedded' as used in the Strataframe Docs.
So if I understand correctly. I generate the XML for the messages. I copy the XML's into my project subdirectory or a folder in the subdirectory. I include them in the project. I select the Xml files and on their properties sheet I make sure the Build Action is 'Embedded Resource'.
Does that pretty well outline my issue?
Thank you so much for Your Help and Edhy's...... You guys are a blessing for this Forum.
|
By Edhy Rijo - 10/9/2012
You are welcome Terry.
Terry Bottorff (10/9/2012) ...I generate the XML for the messages. I copy the XML's into my project subdirectory or a folder in the subdirectory What I do is that in the Localization project, in the Output Path, I enter the same path as expected by the VS project, so when you "Generate XML", it will be already in your VS project so when you build your VS project the localization files will be there. i even create a folder in the VS project named "Localization Files"
|
By Terry Bottorff - 10/9/2012
Whoa what you just said went over my head. I will have to look at that alot closer to see if I can figure out what you said.
I appreciate your help and will let you know if I can not figure out what you said. Thanks again.
|
By Terry Bottorff - 10/10/2012
What I do is that in the Localization project, in the Output Path, I enter the same path as expected by the VS project, so when you "Generate XML",
Can you explain a bit more on the above? I copied the XML files into a subdirectory called "Localization Files" and I embedded the files into the exe. I removed the following and my messages seem to work at least on my development machine but I have not tried it yet on the client's laptop. Soon for that.
MicroFour.StrataFrame.UI.Lcalization.MessageXmlPath = "../../messages"
But I do not understand the Output Path?
TIA.
|
By Terry Bottorff - 10/10/2012
Just tried new install on Client's laptop and All Seems to Work. Thank both of you for your excellent help.
Edhy I still would like to know about my previous question.
|
By Edhy Rijo - 10/10/2012
Terry Bottorff (10/10/2012) But I do not understand the Output Path?
No problem, let me be a bit clear: In the Localication and Messaging Editor, when you create a project, it will ask you for the "Output Path" where you want the localization files to be created. Here I enter the same folder ex: "E:\Visual Studio 2008 Projects\StrataFrame\Card Tracking System Projects\CardTrackingSystem.NET\Localization Files" as I used in my VS project. This way, when I modify my messages in the Localization and Messaging Editor, and then then click the "Generate XML" button, the files will be where expected by my VS proeject, so I don't have to manually copy those files over, or worse, forget to copy them until the customer call reporting the error
|
By Edhy Rijo - 10/10/2012
Terry Bottorff (10/10/2012) Just tried new install on Client's laptop and All Seems to Work. Thank both of you for your excellent help.
Well, isn't that a good feeling Congratulations!!!!
|
By Terry Bottorff - 10/10/2012
OK I do understand that. But, does that not mean you have to ReCreate all your messages from project to project? If your messages are pretty much the same from project to project how do you reuse the XML or Messages?
Thanks for the help.
|
By Terry Bottorff - 10/10/2012
Yes Sir Re Bob!!!!!!!
|
By Michel Levy - 10/10/2012
Hi Terry,
define all common messages and texts in the Common repository, in the Messaging Editor. And in the settings of the Messaging project, check "Include Common Repository". Common messages will be saved in the xml file of the project.
|
By Terry Bottorff - 10/11/2012
Oh, so much to learn and so little time. I am just starting to use the Messaging system. Is there a way to use the xml that I have at this point and make it the common repository?
TIA.
|
By Michel Levy - 10/11/2012
the xml istself, I don't see any way to load it. But if you have an xml file, you have a project. Open this projetc in the messaging editor, and right click on the message or the category, last contextual menu is "Move to", then select the Common Repository as the target project.
|
By Terry Bottorff - 10/11/2012
Cool I can do that. Thank you and all for the great help. This entire segment has been a "Perfect Storm of Learning" for me. Your all great.
|