15,884,388 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by hoernchenmeister (Top 122 by date)
hoernchenmeister
15-Jun-18 7:09am
View
Thanks for posting this. It is indeed a bouquet of interesting things. This might take me a while to go through it, but I am looking forward to it.
hoernchenmeister
15-Jun-18 7:08am
View
Thanks a lot for your contribution.
It is very much appreciated!
hoernchenmeister
10-Jun-14 10:35am
View
Thanks Peter for your answer.
Yes, you are right, these dll's are also installed in the GAC. But I did so with all versions before (removing the old one and adding the new one). That's where I am confused right now, because I really believe it worked like that before... All the projects that I own always reference the folder mentioned above and never the GAC...
Best regards
Andy
hoernchenmeister
8-Apr-14 2:39am
View
I checked the query using the SQL Analyzer tool and it creates a query like this when I use FirstOrDefault:
SELECT TOP 1 * FROM tblEmailPostbox WHERE id = @id
...so I assume that's all right. ObjectSet does not contain records, it just represents the table object to query from.
Anyway Maarten, I really appreciate your help on this one.
Thanks a lot!
Cheers
Andy
hoernchenmeister
7-Apr-14 9:25am
View
Thanks again Maarten for your time,
Resharper indeed told me to skip the Where clause :)
In this scenario context.TblEmailPostbox is an ObjectSet<tblEMailPostBox>. I am currently implementing the precompiled version of the query:
Func<emaildataentities, long,="" emaildatacontext.model.tblemailpostbox=""> getSingleEmailByIdQuery = CompiledQuery.Compile<emaildataentities, long,="" emaildatacontext.model.tblemailpostbox="">((context, emailId) => context.tblEMailPostBox.FirstOrDefault(f => f.id == emailId));
and I invoke it like this: tblEMailPostBox oDataEmail = getSingleEmailByIdQuery.Invoke(context, id); just for improving the performance as I have read about.
I have run into the OutOfMemoryException about five times and it's a really big record (Email with attachments - structure is pretty old and was accessed mainly using a SqlDataReader).
Just to make sure I understood correctly. You mentioned I should "query the right records from the database, instead of querying everything and resolving it in your application (as you are doing now)". This is confusing me a little because I assumed I would do it like that. The context variable is the ObjectContext I use for accessing the table. Would you mind to give me a little hint on how to query the right records only in this example?
I really appreciate your help Maarten,
cheers
Andy
hoernchenmeister
7-Apr-14 8:45am
View
Dear Maarten,
sorry for being so late with my reply and thanks a lot for your help on this one.
That's a really good point you made here. the property represents indeed a complete table. The "id" field is the primary key for this table. I always assumed thet FirstOrDefault would be the right way to retrieve a single record (over SingleOrDefault). Would it be better to use a where statement first?
Like this:
EmailDataContext.Model.tblEMailPostBox oDataEmail = context.tblEMailPostBox.Where(f => f.id == id).FirstOrDefault();
have a great day
Andy
hoernchenmeister
27-Mar-14 10:29am
View
I have added the relevant code stub :)
hoernchenmeister
27-Mar-14 10:29am
View
Hi Oshtri Deka,
thanks a lot for your interest in my question.
It's a Console App that will later be called by a Scheduler.
Right now I am testing it and experienced the problem mentioned above.
I am just trying to get a better overview about the possible impact of this (there might be more of those large records in the future) before taking it to the live environment.
Best regards
Andy
hoernchenmeister
12-Nov-13 10:14am
View
Great to hear ;)
we finally found a solution, if you like you can refer to my update above if you are interested. Funny you mentioned Carroll. Even if not related to the time passing between posts, but during my time debugging through this project I felt like little Alice sometimes... then, after I spent a while looking at myself in the "looking-glass" I decided to leap through... best decision since a while ;)
Thanks again for your support Sergey, it is very much appreciated.
hoernchenmeister
8-Nov-13 3:13am
View
It did Sergey, please be so kind and refer to my comment for your solution below. I just needed some time to reply and the time differences might make it look like I lost interest in this positing... which I definitely didn't :)
hoernchenmeister
8-Nov-13 3:10am
View
Thank you Ron for sharing your thoughts.
Stealth-Redesign sounds like being a good idea if applicable. Unfortunately this will not be an option in this case because it will not go unnoticed :)
I totally agree that this should be handled this way if it's possible, especially if, as you mentioned, takes less time to recode than to understand it and then add additional bunches of code that lead to even more confusion later...
In this case we can all learn something new. I learned that I have to take my responsibilities seriously, and my superior might learn that hiring people from countries far away that just started to study IT and have not too much experience need proper supervision... and a good project plan so that adding bunches of code to introduce functionality that was left out when creating the project-plan might be reduced...
It is still a good advice though, thanks a lot for sharing it Ron!
Cheers
Andy
hoernchenmeister
8-Nov-13 3:00am
View
Thank you Sergey for sharing your thoughts and experience. Your advises worked out fine for me already in the past and I am hopeful it will do this time ;)
I already spent three days in just debugging through this project, trying to get things together in order to get the big picture. But I have to admit that I can only fail in continuing to do so. My superior is normally a fine person who has his own opinions about how projects should be done, but in general he listens to my advises and accepts most of the ideas I come up with. In this case there is another anti-pattern involved that was missing in the list. I have no name for it but I'd call it "Junior/Senior Boss Father/Son" pattern... It is no excuse for the current state, but it introduces additional, family related misunderstandings that, especially in smaller companies, might add another layer of complexity.
My personal leave is already scheduled for beginning of next year, but that was so far unrelated to this project, I just want to see more, expand my knowledge and I am really looking forward to work in bigger teams again as I did in the past.
So what's left for me... I totally agree that it's my responsibility to ensure a certain level of professionalism when it comes to coding projects and in this case a rewrite will be the only good choice to make. Regarding money and regarding the quality of the project. There was certainly enough money spent on this beast and it's time to accept that this was a failure.
I have chosen to not continue to live this nightmare (besides this I want to mention that this is the only real project messed up this much, we have made several others that have been really interesting, challenging which teached me quite a bit, so all in all I have a good time). A well structured redesign will also improve speed regarding future changes (which will definitely occur). Unfortunately the "stealth-redesign" isn't an option. While it sounds fine I always preferred convincing people about something and in this case there is no other option. I just can't make changes, my IT colleague also agrees with me (he can't understand it either) so we will put our arguments on the table today. I don't fear the ugly discussion that might come up, but there is also a good chance that my suggestion will be accepted... after all we just try to do what's best for the company, not to mention the next guy who will have to deal with this project.
This might be one of those moments I just have to go through and in a few weeks when we all look back we will ahve a laugh and a few beers (payed by the money that we saved).
Your solution really gave me a boost and some new arguments that I will use in the upcoming discussion. I am optimistic that it will work out, and there can't be only sunny days, right? Sometimes you just have to run through the rain and make the best out of it (rain can be nice too if you try to find something you like instead of arguing with what you don't like).
Additionally your answer made me feel convenient again, it's nice to share opinions and experiences with people who can understand and take the time to think about it in order to help out a fellow coder :)
I love what I do for a living, I always did and I am quite sure I will come out of this bigger and stronger tha before. Even if this project sounds really bad, it still teaches me something new... in this case realizing that I am not just a tool but someone with a mission to be accomplished... Making the right decision that is the best for the company I work for. Now I will gear up, get my stuff together and do what I am here to do...
Thanks again Sergey, your advice is kindly appreciated
I keep you updated ;)
Cheers
Andy
hoernchenmeister
7-Nov-13 10:01am
View
That would work surprisingly fine... a nice sideffect would be that it would clear the "redesign" problem ;)
On the other hand, the plan for the project was quite nice as far as I know, just nobody watched over the result... and it's quality :(
hoernchenmeister
7-Nov-13 9:58am
View
You are right phil.o, at least it would make it more readable for the next guy after I took a string(Builder) for myself ;)
Problem is that the strings for the SQL are not always created in a single function... sometimes there are different DLL's and more than 5 function calls involved...
hoernchenmeister
7-Nov-13 9:54am
View
Thanks Sergey, good to not be alone out there ;)
I really guess the biggest problem was that those guys (who program pretty fine right now but won't support the project - guess why) were just at the beginning of their careers. Maybe they thought it would be a good way to make some classes, then ran into trouble and over the time just added bunches of code just to make the thing work somehow. They inherited from things that really didn't need that, lost the overview and where pretty happy when they finished their studies and moved on to different jobs. They honestly have been kind people after all, but now they are out of reach...
I already mentioned the "redesign" question, but my superior wasn't too happy about it. Money was spent and I guess throwing it away would be something "evil" because of that. The project itself isn't too complicated, websearch, results, Gogole-Maps, tourism stuff... but a certain fear is around that it might become complex after the 90% is done (have you heard about this: 90% costs 10% of the total value while the last 10% cost 90% of the budget... not wrong, but it really doesn't help in the end).
I can't really say if it would be sufficient to just exchange parts of it, I am still unable to get the complete picture, so I have a hard time estimating how long a redesign would take.
After all especially the time that would be necessary to just make changes to the SQL (besides identifying the statement), imagine you need another column... should I define a new constant and put another {x} into the String.Format call... You have no idea how dirty I feel just thinking about it ;)
Thanks for your comment Sergey, it is kindly appreciated.
cheers
Andy
hoernchenmeister
11-Jun-13 5:25am
View
Hi Matt,
first of all, sorry for the late reply.
...and thanks a lot for your explanation, I think I got it now ;)
cheers
Andy
hoernchenmeister
24-May-13 2:14am
View
Thanks for your input Matt,
this is basically the same as the third part of code I posted in my question. This should only serve as a demo somehow, because I actually want the parameter be of type "Type".
The user should pass in (typeof(SplashScreenBase)) and the Type should be restricted to Types derived from SplashScreenBase...
SplashScreenBase is actually a Form. In the application I have to launch the form that should serve as SPlashScreen in a different thread using Application.Run(new SplashScreenBase). If the user passes me an instance I can not use it due to cross threading issues, so I would have to read the type of the SplashScreenBase and create a new instance via reflection in order to run it.
The reason for me wanting to use Type as parameter is that in this way only one instance of the SplashScreenBase form has to be created, avoiding whatever has to be done in the initialization of the form...
I updated my question accordingly.
Please excuse if I somehow misunderstood you in any way
I really appreciated your help Matt, thanks a lot.
cheers
Andy
hoernchenmeister
30-Nov-12 7:12am
View
I havent thought of disabling the button on validation.
As mentioned I already set the AcceptButton property to null if the textbox has focus and reset it if it looses focus, but I just hoped there would me a more elegant way to deal with this problem...
Somehow I assumed I could trap the KeyDown and handle it before the AcceptButton fires... which was wrong obviously... :)
Next thing is that the textbox is actually on a usercontrol on the form and the AcceptButton is on the form itself, which requires visibility of elements in the usercontrol that I normally do not like to be visible to the outer world...
Thanks Pete for your answer, it is very much appreciated.
May you too have a great weekend ;)
hoernchenmeister
30-Nov-12 6:12am
View
Simon is right on this one.
While the Validating event indeed fires before, I can not test if the enter key is pressed. Even logging the keys won't work because "Enter" again activates the AcceptButton.
Anyway, thanks for your suggestion GeekBond
hoernchenmeister
30-Nov-12 5:50am
View
Hi Pete,
I actually use WinForms... still :)
hoernchenmeister
30-Nov-12 5:49am
View
Thank you Simon, even if this seems to be bad news :)
Currently (I really hoped it would be a workaround only) I set the AcceptButton of the form to null when the textbox receives focus and set it back to the related button when the textbox looses focus again.
While this actually works I do feel dirty... somehow :)
Anyway, thanks for trying to help me out and again, I am really sorry for deleting the first post...
cheers and have a great weekend
Andy
hoernchenmeister
30-Nov-12 5:19am
View
@Killzone DeathMan
Ok, let me explain a little bit more.
When I am in the textbox (where I listen to the KeyDown event and check for KeyCode == Keys.Enter) and I actually hit the enter key the ButtonClick event of the assigned AcceptButton (AcceptButton Property of the form) is fired before the KeyDown event in the textbox...
hoernchenmeister
30-Nov-12 5:16am
View
@Simon_Whale
Unfortunately the KeyPressed event is not triggered before the AcceeptButton fires...
hoernchenmeister
9-Oct-12 11:16am
View
Reason for my vote of 5
great tip
hoernchenmeister
12-Sep-12 11:48am
View
Thanks you very much for your comment Ashraff Ali Wahab.
I indeed try to create a base collection class where the Animals class should inherit from instead of ObservableCollection.
Looks somewhat like this:
BuryableBaseClassObservableCollection<
T> : ObservableCollection<
T> where T : BuryableBaseClass
in order to do the internal handling...
I am still thinking about it some more, let's see what I'll come up with ;)
Have a great day
Andy
hoernchenmeister
12-Sep-12 10:10am
View
I am sorry Malli_S but it seems that I just don't get it...
I just read upon predicates in lists, but those refer to a Find method that would be used where the predicate has to be passed as a parameter...
Would you mind to explain this a little bit more or give me a source where I could read about this?
I just don't bridge the gap in my mind where I have
grid.DataSource = animals;
and where modifying the animals class with what I just read would lead to the same code above to only display alive animals...
Dude, I really feel stupid somehow right now ;)
hoernchenmeister
12-Sep-12 10:06am
View
I do not want to show them, that is right. But maybe I wan't to reanimate them due to problems in the process where they are handled.
So if somebody buried an animal by accident I wan't to be able to get it back.
Somebody kills an animal (calls the delete function on it) and then buries it (commits the kill to its source) and then figures out that this was an error while the process which owns it is still alive it would be possible to get it back... But for a grid where the list is bound to showing those animals is useless...
hoernchenmeister
12-Sep-12 9:42am
View
I updated my question recently with an overwritten GetEnumerator() method that at least archives what I am trying for foreach etc... but Count and the Linq stuff still returns everything, not only alive/unburied animals :)
hoernchenmeister
12-Sep-12 9:40am
View
Thanks Malli_S for your reply.
Wouldn't this require that every usage of the Animals class that is already happening needs to be changed as well?
I was just wondering if it would be possible if the list could be modified somehow so that it only returns instances of Animal that meet a certain criteria to users of the list and still just behaves like a normal list... you know, just change the internals somehow?
Retrieving dead and buried animals can be implemented by a property because nobody already used them before...
I am sorry if I missunderstood your comment somehow...
hoernchenmeister
12-Sep-12 9:00am
View
Somehow... if they die (become deleted) and are buried (committed against the source) I can still store them in an internal list that might be retrieved by some kind of "GetDeadAndBuriedAnimals" function ;)
hoernchenmeister
12-Sep-12 8:59am
View
Dead animals are not inserted in the list. First they are alive, if they die (become deleted) they become buried at a certain point (committed), thats where they sould no longer be visible by the default retrieval methods (like beeing bound to a grid or something alike).
hoernchenmeister
12-Sep-12 8:57am
View
For clarification, this is some kind of made up example (surprise *LG*).
It simplyfies a problem I am dealing with where dead means deleted and buried means committed against some kind of datasource.
Retrieving dead and buried instances might be useful for undeleting and re-inserting the committed instances.
For the user of the Animals class who maybe binds the instance of Animals to a grid they should no longer be visible.
The main purpose might be to simplify the usage of the Animals class for my colleagues so that they can just bind it and do whatever they want.
They might use a porperty like InstanceOfAnimalsThatAreNotDeadAndBuried of the Animals class for binding, but binding to the instance of Animals itself looks more comfortable to me :)
hoernchenmeister
12-Sep-12 8:54am
View
Yes thats somehow right. If an animal dies it gets buried and after that it should no longer be accessible via standard retrieval methods. If anybody would be interested in retrieving a List of dead and buried animals he/she could call a "List<animal> GetDeadAndBuried()" function to retrieve (and maybe unbury and reanimate them) them
hoernchenmeister
6-Sep-12 8:16am
View
Reason for my vote of 5
Great read, very inspiring.
Thanks for sharing :)
hoernchenmeister
5-Sep-12 4:14am
View
Reason for my vote of 5
Thanks for sharing this tip, just what I was looking for :)
hoernchenmeister
27-Jul-12 5:35am
View
Thanks for your nice explanation Cloud2.0, it is very much appreciated.
I like the concepts you introduce in point 2, because I had indeed several occasions and different situations where I applied what I learned above.
The "truely static" ones following a singleton where the least troubeling ones, but most of them really changed values over their lifetime.
In the meantime I read some articles about remoting/pipes and their mechanisms to pass values byval/byref. Even if the byval approach seems to be a lot easier it becomes unusable very quickly because of the requirements that tend to evolve :)
On the other hand, as you have already mentioned, the byref approach becomes complicated very quickly :)
Thanks again for your contribution,
have a great day
Andy
hoernchenmeister
17-Jul-12 3:11am
View
Thanks to all who contributed to my question.
Have a great day
Andy
hoernchenmeister
6-Jun-12 5:47am
View
Thanks a lot for your answer Manfred.
It is very much appreciated.
have agreat day and best regards
Andy
hoernchenmeister
6-Jun-12 4:53am
View
Perfect VJ Reddy, just what I was looking for.
Thanks a ton and have a great day
Andy
hoernchenmeister
21-May-12 10:36am
View
Ok, I moved my question to the suggested board.
Thanks for pointing this out.
cheers from Munich
Andy
hoernchenmeister
14-May-12 7:02am
View
I'd like to take the opportunity to say thank you to all the people who took the time and provided an answer.
It was pretty hard to figure out which answer to accept because all of them were really inspiring. Unfortunately I can only choose one answer so I decided to take Pete O'Hanlons answer because it added another idea to my problem and made me think out of the box...
I hope nobody is upset... I really do.
Thanks again everybody for your help, I appreciate it very much. Good to have people who take the time and contribute their knowledge...
cheers and all the best
Andy
hoernchenmeister
8-May-12 11:54am
View
Thanks for your kind comments.
I figured out that the more you know about what you want to ask the better are the results. And still I love figuring out new stuff and learn new things (isn't this the essence of beeing a programmer?), so I wan't to keep the homework for myself ;)
...tonight will be very interesting :)
hoernchenmeister
8-May-12 11:50am
View
Hi Pete,
thanks a lot for your answer and for sharing your thoughts on this topic.
I guess there are two parts that I identified till now reading through all the answers.
The first is the notification part.
I described what I have in my reply to BobJanova's answer, but thats just something I play around with. It would definitely profit from your description on subscribing to certain events. Currently it passes messages from a plugin to another plugins (via mainframe) that tell the mainframe that it can handle message ABC.
The second part is what "Chriss Ross 2" mentioned beeing a "truely static context"
So if the user once logged in it will never change and might be handled by what I called ApplicationEnvironment class so far.
Even if those variables will never change after initialization I would prefer a way to combine both under a single hood.
I will read about the MVVM Mediator pattern you mentioned, unfortunately my knowledge regaring this topic is lacking details :)
Thanks again for your contribution, it is very much appreciated and you already inspired me to think into another direction I didn't thought of before :)
cheers
Andy
hoernchenmeister
8-May-12 11:34am
View
Hi Chris,
thanks a lot for taking the time to share your knowledge, I really appreciate that.
The ApplicationEnvironment class I mentioned somehow fits into what you have described.
It is a singleton that is initialized with a valid user via its factory methods after login.
After that the variables I currently think of are very unlikely to change during the apps lifetime (logged in user, connections etc.)
I try to assume what requirements will come up in the near future, but as you might have already experienced, requirements change if management decides that it has to be done ;)
So unfortunately there might be a risk that the truely static context will be softened due to "certain influences" that I am not capable of right now.
Thanks again for sharing your ideas/thougths with me, it already helped to clear the fog around me ;)
cheers
Andy
hoernchenmeister
8-May-12 11:24am
View
Thanks Marc for your solution, I really appreciate the time you took to help me on this topic.
As you mentioned I didn't choose the right terminology for what my plugins are. They indeed do not run in seperate processes, but get activated by the mainframe just as you assumed.
I like the event approach you mentioned (and I already added a comment to solution1 in the meantime that explain a little more about the project I am working on - there is an event based messaging model available, ready for use).
Currently I am quite unsure how the app will evolve (the management and requirement bridge) but as you mentioned it might be necessary to work with different processes (real processes) in the future, so I will let you words run through my brain a little more.
Thanks again for your answer and for mentioning different ways/ideas, it is very much appreciated!!!
cheers
Andy
hoernchenmeister
8-May-12 11:12am
View
Hi BobJanova,
first of all, thanks a lot for taking the time to reply to my question. It is very much appreciated!
You are totally right, I was talking about subsystems that interact with the application.
MEF (Managed Extensibility Framework) handles the activation of plugins for me, but more or less I am pretty sure it activates the instances using the Assembly namespace just as you described it.
The communication between the subsystems and the mainframe is handled using an event based model.
the subsystem raises an event that passes the message to the mainframe which then searches for plugins that can handle the message type that was sent. Upon finding a relevant plugin (they implement an ICanProcessMessage interface) the plugin is activated if not yet done and passes the message which is then handled by the plugin. After that the plugin manipulates the event arguments so that the sender knows what was done or not done.
I also have a MessageBus System at hand which is based on UDP that behaves like what you mentioned regarding the TCP sockets, but UDP is also something people say it is not the most elegant solution :)
Point is that it is a pretty early stage of the application and I try to be as flexible as possible, so crafting something that fullfills my needs is possible.
Regarding the static variables, I currently use them (as long as I don't know any better) to store information like the logged in user so that, theoratically all plugins could access the static ApplicationEnvironment class where the user is stored after the login (or a dummy user if no login was done due to plugin development). This class currently also provides conenction strings that are read from a Xml configuration (for the duck programmers) so that a plugin can use it.
That's where my quest started and where I read about how bad static variables are...
I was a little concerned just by reading that they are "bad practice", so I started to look around for something more elegant and extensible.
So there was little time until I stepped into named pipes. Due to the fact that I haven't used them before I am curious in learning new stuff, so personally I'd like to give them a chance and digg into it...
...but as you suerly know, a clear idea about something is the first step :)
Thanks a lot for your great reply, it already inspired me to go on and see what else can be done ;)
Cheers
Andy
hoernchenmeister
8-May-12 10:29am
View
Thanks Pablo, I am already a little exited about how this will turn out ;)
hoernchenmeister
25-Apr-12 7:37am
View
Too bad...
I didn't thought of that, but your query suerly archives the goal ;)
I still think a little about just constructing the WHERE clause dynamically so that I can put in "is null" if necessary, but I'll see.
Thanks OriginalGriff for your help, it is very much appreciated,
cheers
Andy
hoernchenmeister
25-Apr-12 6:17am
View
Nevermind, it's probably me beeing lost in translation ;)
Basically I fire queries against a Sql database using SqlConnection/SqlCommand/SqlDataReader.
For that purpose I created a parameterized query:
SELECT * FROM xzy WHERE col1 = @val1
I now "fill" the parameters using SqlParameter
string sVal1 = "fubar";
SqlParameter para1 = new SqlParameter("@val1", (String.IsNullOrEmpty(sVal1) ? DBNull.Value : (object)sVal1));
That works, the problem comes up when I have to assign a null value lie this:
string sVal1 = null;
SqlParameter para1 = new SqlParameter("@val1", (String.IsNullOrEmpty(sVal1) ? DBNull.Value : (object)sVal1));
In that case the parameters value is set to DBNull.Value.
Unfortunately I now do not get the values I expected.
In plain SQL I would write:
SELECT * FROM xzy WHERE col1 IS NULL
instead of:
SELECT * FROM xzy WHERE col1 = NULL
So maybe this is the cause for not getting rows...
So I was wondering if there is a way how such a query should be constructed if the Where clause might be bugged with null values.
Just let me know if you have questions or if anything is unclear... and of course get well soon ;)
Cheers
Andy
hoernchenmeister
25-Apr-12 5:44am
View
Thanks for takning the time OriginalGriff,
If I understand this query right it also returns rows where col1 is not only null. Did I get this right?
I checked it:
declare @pn nvarchar(256)
set @pn = null
SELECT * FROM table1
WHERE col2 = 'fubar' AND (@pn IS NULL OR col1 IS NULL OR col1 = @pn)
it should behave like this:
SELECT * FROM table1 WHERE col2 = 'fubar' AND col1 IS NULL
As I am filling a SqlCommand I pass the null value via DBNull.Value...
I hope I could explain this right :)
hoernchenmeister
25-Apr-12 5:32am
View
Thanks for pointing this out, that was just a typo :)
hoernchenmeister
12-Apr-12 2:22am
View
You are wellcome :)
hoernchenmeister
11-Apr-12 11:49am
View
Yes, that's right. I can confirm that the contracts Dll is not necessary in the plugin folders.
I stumbled into another possible solution that worked (at least with the tests I am doing).
I added a
<probing privatePath="lib"/>
segment to my MainApplications config file.
This allows me not to use the AssemblyResolve because probing includes the lib folder now.
In my opinion both solutions behave somehow the same. One specifies a directory in a config, the other loads dll's from a directory in code...
It would be interesting to see what option is preferred by other devs.
Or even better how to overcome the need to do this :)
Thank you Steve for contributing :)
cheers
Andy
hoernchenmeister
11-Apr-12 11:01am
View
Thanks Steve for taking the time to answer.
Good to know that I am not totally off with my ideas ;)
Honestly I wouldn't mind having the contract DLL in the MainFolder neither if I could get rid of the AssemblyResolve stuff (that just somehow feels "not right").
I am currently testing different setups to figure out which might suit me best. One of the main goals is still the reduction of duplicates in the plugin folders. Maybe our customers want to create plugins on their own, which should also be possible (at the end that's one big advantage of a plugin system). They will have to code against the contracts DLL and I am pretty sure there will be a copy in their plugin folder as well... which seems to be useless die to the FileNotFoundException that is thrown when resolving the plugin via the PluginManager of the MainApp.
We'll see what kind of inspirations this post will bring up...
Thanks again for your input Steve, it is very much appreciated.
best regards
Andy
hoernchenmeister
15-Mar-12 8:10am
View
That's fine Sergey, and it helps not making me look stupid ;)
Normally I run my messages through a spellchecker, but it seems I missed that somehow.
Luckily I will not be a target to the Grammar Police anymore ;)
cheers and have a great day
Andy
hoernchenmeister
14-Mar-12 5:51am
View
Hi SA,
that indeed makes sense to me. I believe that the "Comfort Zone" is one of the biggest enemy of personal and professional evolution.
On the one hand I can understand that people use existing solutions to fix their problem fast without using the opportunity to learn something new if they have tight deadlines. That also happens to me from time to time, but it always leaves a bad taste... a wasted chance to improve oneself still is what it is... a wasted chance.
On the other hand I believe that the job we are doing requires an open mind that needs to be let loose from time to time to gain new impressions, new ideas or just needs to be fed with some articles that would never appear on my schedule when sticking to the projects I deal with only. This is what fascinates me so much, the sheer endless options to evolve if you just keep on being curious. Programming something offers the possibility to be one of the most creative professions I ever came along if you want it to be that way. A little bit like painting or making music. And its one of the rare professions where the borders of how far you can go are drawn by yourself only.
In the modern, fast paced world where profit justifies a lot, curiousness is a habit that is sometimes hard to cultivate.
Luckily I had the opportunity of having a great mentor when I started learning to program. He taught me a lot of the soft skills and alwas tried to let us find the solution ourselves by just putting our heads into the right direction from time to time. Just as I mentioned above he always told us to take a chance to learn something new whenever possible. Even if it sometimes look off-topic, you never know what you can make out of it someday.
You remind me of him though, he had an equal style of explaining things and understood that helping someone to find the solution on their own is much more valuable than just providing the solution itself.
So please keep it up ;)
Thanks again Sergey, take care and best regards
Andy
hoernchenmeister
13-Mar-12 5:33am
View
Interesting idea digimanus,
what you basically mean is to store the group instead of having a lookup table for users, did I get this right?
simplified:
Table Messages(id, text, timestamp)
Table MessageGroupLookup(id, messageId, GroupGuid)
-> where I would use the userIds to create a unique sequence by transforming the ids into a comma separated, ordered (by id) string serving as the guid.
like: '1,3,6,8'
It would simplify my setup and lets me easily get the messages.
Only drawback would be that it makes it harder to lookup messages that have been sent to a specific user (if there would be a need for it in the future).
What do you think? Did I get your idea right?
Thanks for your input digimanus, it is very much appreciated.
cheers
Andy
hoernchenmeister
13-Mar-12 5:21am
View
Actually I already have the users I am intersted in and try to lookup the messages.
Assume I have userids: 1,3,5
Now I need all messages that have been assigned to user 1 and 3 and 5. Not more that the specified users and not less.
I also thought about grouping, but I just coudn't imagine how that should work ;)
Thanks for taking the time DominicZA, it is very much appreciated.
Cheers
Andy
hoernchenmeister
13-Mar-12 4:57am
View
I should mention that I get the data using Entity Framework, but I could create stored prcedures/views as well.
hoernchenmeister
13-Mar-12 4:56am
View
Yes, that's right.
Someone can select 1 to n users and then the application should display all messages that have been sent to the selected users (exactly the selected ones).
hoernchenmeister
13-Mar-12 4:40am
View
Hi SA,
I now understand what you explained. It's sometimes hard for me to get the "message", even if I my english is quite good (in my opinion at least).
I do know how to deal with resources, I just couldn't put it all together.
I really appreciate all the efforts you made to help me out and to explain it as nicely as you have done it.
I have finally chosen the facade approach and stopped trying to use the designer. That's also the reason for the long period of time that passed by until I finally started to write down these lines.
You made a big impact on my way of thinking regarding the use of the designer. I use the designer primarily to set up my forms and to interact with third party tools (Infragistics) that provide helper windows to adjust complex components quite fast. Additionally I use Resharper for the refractoring purposes, but I never looked at the designer itself the way you described it.
It took me some thinking and I needed to drop some opinions I gained over the years, but you are pretty much right with what you've said.
Especially the "reusability part", because I strive to create reusable things if applicable (I remeber heated discussions with my superior trying to convince him that we need libraries so that we can reuse things that have already been done before - when I started here they were pretty much on VB6 only without anything beeing reusable and on forms only).
So finally I want to thank you for your input on this topic and for the way you try to help me with my problem.
I appreciate that you tried to make me look at that problem in a different way. Isn't that the way to become better?
Moving your head into a different direction to gain knowledge instead of sticking to old habits due to comfort purposes?
I think it is.
I really got much more out of this post than I have thought in the first place.
thanks again SA and have a great day,
best regards
Andy
hoernchenmeister
17-Feb-12 3:02am
View
Thanks Wonde Tadesse for this nice explanation.
It helped me get the picture and inspired me to find a solution to my problem.
I finally decided to use a wrapper for auditing purposes instead of extending the EntityObject. Tha gives me the opportunity to track EntityObjects and get the id after they have been inserted.
Thanks for your help, it is definitely worth a five ;)
cheers
Andy
hoernchenmeister
13-Feb-12 4:40am
View
Thanks for your comment.
I googled for a while but I couldn't find a "persist" method related to the ObjectContext. I found out about the repository pattern though.
Would you mind to point me into the right direction on where to search?
That'll be great ;)
hoernchenmeister
13-Feb-12 4:34am
View
Thanks for your help.
Ok, I understand that there is a way to check for the last inserted identity value. The problem is that I currently have no way to check anything after the insert is completed.
The point from where I have to try this is the SavingChanges event of the context.
As mentioned, I do some kind of auditing so I implemented an interface for the context (and all contexts that need the auditing options) that helps me and my colleagues to easily add this capabilities.
So now the context fires its SavingChanges event. All I got is the context and the entities and their changes (added/modified/deleted).
As far as I know I can not attach anything to the context/entity that enables me to execute any code after the insert is done.
...am I missing something here?
cheers
Andy
hoernchenmeister
13-Feb-12 4:28am
View
Thanks for your help.
I guess you pointed out the problem pretty nicely. There is no option to get the id before the values are actually written to the database, which of course makes sense.
Problem is that there is no such event like "SavedChanges", only "SavingChanges" which is the place where I am currently trying to attach anything that might enable me to check the id later.
I also wasn't able to attach anything to the entity that will be saved when the SavingChanges event is fired so I can not check the id after the insert is completed (as far as I know)
hoernchenmeister
10-Feb-12 10:08am
View
I have added a partial OnContextCreated to my context that registers the SavingChanges event.
I am doing this in order to audit the changes that have been made to the context.
Then I save the changed column values together with the DataRowState and the id for the entry.
This works fine for Modified/Deleted entries, but for Added entries I can not store the id (because it is not created at this point).
I could store 0, but that doesn't help finding the added entry later in the database.
So now I am searching for a way to get the real id of the entry that will be added.
I hope I could explain what I want to do ;)
hoernchenmeister
8-Feb-12 6:19am
View
Deleted
Thank you very much for the explanation. I get the idea now ;)
Still I will need some time to digg into this, which I will.
I really appreciate your help,
cheers
Andy
hoernchenmeister
8-Feb-12 4:46am
View
Deleted
Thanks for your comment. Yes, you are right, I use Console.WriteLine.
I have taken it from the code above and somehow thought that was the point of the example.
As stated above, and I agree on this one, there are often abandoned Console.WriteLine calls in an application and I was not able to see those when fireing the console after IO output was already written somewhere.
What would you suggest to use instead. You mentioned the win32 api? Would you mind to clarify this a little bit?
thanks and cheers
Andy
hoernchenmeister
6-Feb-12 3:30am
View
Deleted
Just a quick note.
The console window has to be attached before any IO output is created.
I tried to put it into my app as some kind of "Developer Help", but it never worked if I used a button inside the app.
Now I attached a commandline parameter that is read in the Main() function that created the console on startup if the specific parameter is attached.
That way I get a console that shows every single WriteLine in the whole app, regadless which dll is actually working.
hoernchenmeister
27-Jan-12 4:11am
View
Thanks a lot SA for your explanantion.
Unfortunately I have a hard time to follow...
I got that part with the facade class though, but I somehow struggle with the rest. Would you mind helping me understanding this in its depths (no code, I really want to get the idea).
If I got it right I need a resource assembly first. So I went ahead and created a class library containing a resource file that hosts some images. I added a class too, to be able to load that assembly with a ResourceManager in case this will become useful somehow. I compiled and now I have a dll.
Then I created a WinForm project for testing purposes.
You wrote: "For example, you need to add N images. The best way of doing it through the designer is this: you add the *.res resources using the Designer as separate image files using "Add existing file""
Hopefully you don't think I am stupid, but I just don't get it ;)
I can translate it into my mother language, but I am not really sure what you mean here.
Do you mean add the *.resx file from the resource assemblies project as existing file to the test-project?
Regarding the facade, besides my tries above I created another class library project containing a resx file with some images. There I added a static class that exposes the images from the resx via an enumerator (exmpl. enum GlobalImages{Delete, Edit, New}). I am now able to get the images in other applications from code.
Just to make sure I explained my question correctly. My colleague now can use the dll and get images in a controlled way, which is really good. But for example, if he has a form with a button on it he want's to set the image for the button using the property window of the designer. Which is not possible because he can only select from .resx in the project.
Will your approach make this possible?
Thanks a lot for your efforts SA,
it is always a pleasure (even if it sometimes hard for me to follow in the first place) reading your explanations, answers and articles. I already learned a lot in the past, and will of course continue to do so in the future :)
cheers
Andy
hoernchenmeister
26-Jan-12 11:20am
View
So am I ;)
hoernchenmeister
20-Jan-12 8:41am
View
Deleted
Reason for my vote of 5
Nice tip, thanks for sharing
hoernchenmeister
20-Jan-12 8:41am
View
Deleted
Great tip,
I just made a test with a WinFormApp having 2 buttons. One for opening/closing the console and one for writing to the console.
Unfortunately the Console.WriteLine("") does not show up, only the Debug.WriteLine("").
Do you have any idea about this?
thanks a lot and best regards
Andy
hoernchenmeister
27-Dec-11 9:04am
View
Thanks for your answer John,
thing is that I deal with a Component (component class): In my case it is a non visual component that should be dragged from the ToolBox to a Form/Usercontrol.
Thus it does not have a Parent property.
Only
Container
and
Compnents
...
My
OwningControl
did exactly what you mentioned. It had a setter that called the formatting logic. The setter was set by the form in its load event. But in that stage it was just a class.
<pre lang="c#">
private Control _hostingControl;
public virtual Control HostingControl
{
get { return _hostingControl; }
set
{
_hostingControl = value;
if (_hostingControl == null)
{
return;
}
Format();
}
}
</pre>
The goal now is to turn that into a non visual component that can be dragged to any form/usercontrol and formats stuff without any further action.
So my colleagues just need to drag it and thats it...
I am sorry if my question wasn't clear enough on this...
hoernchenmeister
27-Dec-11 8:51am
View
The primary goal is that this task is performed at runtime, but if it is possible to do that at design time (I've seen that a lot from 3rd party controls) it would be a great thing ;)
hoernchenmeister
16-Nov-11 11:20am
View
Thanks BillWoodruff, even if it means that I will be stuck.
I guess thats one of the things people mean when they say "think about your interface design in the first place". But it is System.Windows.Form that the plugins return, nor a derived variant that already overrides ScrollToControl ;)
It seems that there is a little bit of candy in all this, it turns out that not too many of the plugins need scrolling...
I'll sleep over this and will think about it again tomorrow with a fresh mind ;)
That helps deciding ;)
hoernchenmeister
16-Nov-11 6:53am
View
The Plugin has a method that is called by the PluginManager and returns an instantiated form to the Pluginmanager which it then docks in the right area (tabbed MDI), so basically yes ;)
hoernchenmeister
16-Nov-11 6:53am
View
Deleted
The Plugin has a method that is called by the PluginManager and returns an instantiated form to the Pluginmanager which it then docks in the right area (tabbed MDI), so basically yes ;)
hoernchenmeister
16-Nov-11 5:31am
View
I would have to add the mousedown to every control on the form, the form itself would not be enough...
The autoscroll thingy is perfectly solved by overriding the ScrollToPoint method, my main goal is to not have to implement anything into the existing plugins, but to have the PluginManager handle this problem somehow...
I would have to recompile a lot of plugins, to some of them I don't even have access...
Thanks dieforwhat for your suggestion,
it is kindly appreciated
hoernchenmeister
15-Nov-11 5:35am
View
You helped more than enough, I guess it was the
"Has anything else, like antivirus, been installed besides of updates?" sentence that gave me the right turn into the correct direction...
Enumerating interfaces is a great idea, but as far as I am aware about the problem it is already known to Oracle...
So far I already go through the available IP's, picking the right one, but as lopng as the virtual network adapter is active it "swallows" the packages. That was also the reason for wireshark not seeing any packages on the physical netowrk adapter (I of course never scanned through the virtual one).
hoernchenmeister
15-Nov-11 4:47am
View
I figured it out...
I called the admin and he said he installed a virtual network adapter from Oracle Virtual Box together with the Win7 updates.
I have seen them on ipconfig but didn't made the bridge.
I have disabled the virtual network card and everything started to work again...
Thanks a lot Timberbird for all the efforts you made helping me on this topic. It helped a lot rethinking everything and reconsidering all the little things that were lost on the way.
I really appreciate it!!!
Besides, you somehow made my day today ;)
Thanks again and best regards
Andy
hoernchenmeister
15-Nov-11 4:26am
View
The server itself is behind a firewall but only to the outside of the internal network. Communication internally is not affected by any tool.
We have TCP/IP, NETBIOS and WINS up and running and all inside of a Win2000 domain...
I can not check the Win XP machines with wireshark dut to admin restrictions (yes... again) but I tested the client installation with my testapp for the client that showed that they connect successfully and they get registered too... so I assume that the packages are sent.
Might be the so called "broadcast" be an issue?
I use the specific host/server Ips and ports for connecting, but always with a broadcast for the complete network (does that make sense?).
hoernchenmeister
15-Nov-11 3:45am
View
Unfortunately not... currently both are enabled, but I tried both without the other one too.
hoernchenmeister
15-Nov-11 3:41am
View
Due to my inability to use wireshark in a perfect way i didn't use any filters at all and checked all protocol entries myself...
We figured out that only Win7 64 bit machines are affected... Win7 32 bit seem to still work...
hoernchenmeister
15-Nov-11 3:25am
View
...and yes, no errors are thrown, it just keeps trying to connect periodically (which is normally done until it receives a response from the server that the client is registered).
hoernchenmeister
15-Nov-11 3:23am
View
The returned server address/port is returned correctly.
I am also not good using wireshark, but I checked the complete list it collects when the application tries to connect and couldn't find anything.
The telnet command I am using:
telnet ip port
doesn't work on the XP machines :(
hoernchenmeister
15-Nov-11 3:21am
View
I cant even view my update history due to administrator restrictions...
hoernchenmeister
15-Nov-11 3:18am
View
No, it is not obfuscated.
hoernchenmeister
15-Nov-11 3:01am
View
The program starts normally not causing any problems nor throwing any errors...
I handle the error event of the UDP component but there is nothing...
Like it just doesnt send or receive anything....
If I run the server/client setup in my project locally everything works fine until I try to reach out to the remote server in our network...
My colleague also faces the same problem after the updates but we are not authorized to uninstall any updates nor to install updates...
I have very little technical knowledge on this topic but my first thought was that the update closed something that was open before... (yeah, that sounded technical *LG*) ;)
hoernchenmeister
14-Nov-11 2:37am
View
Hi SA,
thanks a lot for your explanation.
You have been totally right regarding the DeclaringType, I seem to somehow miss that it is only applicable to members, which of course makes a lot more sense ;)
I made the "PermissionObject" a member of the relevant classes and was able to get the information I needed using your above mentioned answer.
Goal was to get the Type of an object that owns a "PermissionObject" to be able to add its information (based on custom Attributes) to an administration view automatically. I ended up using MEF (which I already use a lot) and export/import what I need, which also works fine for me.
I really appreciate your help on clarifying this,
thanks again
Andy
hoernchenmeister
9-Nov-11 10:26am
View
I updated the question to make the "need" a little more clear ;)
hoernchenmeister
9-Nov-11 10:18am
View
That would work on the base type, I am looking for the type of object that instantiated the object...
I'll update my questiojn to clarify this a little more.
hoernchenmeister
9-Nov-11 10:16am
View
I already tried that, but it is always null.
I will update my question to clarify it a little more.
Thanks for trying to help me out on this one, your help is kindly appreciated!
hoernchenmeister
20-Oct-11 8:09am
View
I really appreciate that ;)
hoernchenmeister
20-Oct-11 3:06am
View
Thanks a lot Mehdi for the quick answer, exactly what I was looking for ;)
cheers
Andy
hoernchenmeister
18-Oct-11 2:37am
View
Deleted
Reason for my vote of 5
Lovely, thanks for sharing
hoernchenmeister
17-Oct-11 2:27am
View
We use a commercial library called IpWorks, but this approach applies to pretty much all other libs too.
I am pretty sure you might find a free library using google.
hoernchenmeister
20-Sep-11 8:21am
View
Deleted
Reason for my vote of 5
Great tip, implemented it right away ;)
hoernchenmeister
20-Sep-11 8:21am
View
Deleted
Reason for my vote of 5
Great alternative ;)
hoernchenmeister
17-Aug-11 3:52am
View
Hi SA,
you are totally right, IsClicked won't even compile if the button isn't inherited from Button and got a property named IsClicked.
I thought the question was related to a kind of toggle button situation (apologize my english, I am not a native speaker thought).
If a button is clicked, another button should not be allowed to be clicked. I didn't mean at the same time (which is impossible as both of you already mentioned). Maybe I should have named the property WasClicked.
Therefore the suggestion using the enabled state of the button. Shurely this is not perfect, but disabling the button that shouldn't be allowed to be clicked after the first one was clicked (WasClicked *LG*) isn't that bad... or am I totally wrong on this one ;)
Sorry for the confusion though,kind regards
hoernchenmeister
22-Jul-11 2:25am
View
I know what you mean ;)
hoernchenmeister
11-Jul-11 8:26am
View
You are totally right, buttons do not have support for
IsClicked()
.
If you need that functionallity more often you could also create a UserControl that inherits from Button and add a property.
I had similar problems and solved them using the buttons
Enabled
property. This worked because btn1 could not be clicked 2 times.
On the btn1 click-event I disabled btn1 so I could check for
btn1.Enabled
.
cheers
Andy
hoernchenmeister
23-Mar-11 10:21am
View
Deleted
I agree, maybe adding a TimeSpan MaxWaitTime in order to allow a break after a certain time would help.
hoernchenmeister
3-Mar-11 6:44am
View
There is nothing wrong with your approach ;)
Quite often it's like in real life, the way is much more intersting than the destination itself, especially if you leave the main route and check out some hidden trails ;)
Cheers
Andy
hoernchenmeister
3-Mar-11 6:44am
View
Deleted
There is nothing wrong with your approach ;)
Quite often it's like in real life, the way is much more intersting than the destination itself, especially if you leave the main route and check out some hidden trails ;)
Cheers
Andy
hoernchenmeister
2-Mar-11 3:39am
View
You are totally right ;)
I'll accept this solution because I really think this is a very important issue for development in general. And of course it would have helped me with restoring my designer, especially regarding the time it takes when recovering from such errors without revision control.
I really appreciate your effort on this, even if some might think this is an off topic solution.
Beeing on topic sometimes means changing my point of view from fixing an error to avoiding an error, or in this case to better recover from such.
Thanks again and have a great week
Andy
hoernchenmeister
2-Mar-11 2:30am
View
I totally agree with your opinion on this topic. I used to work a lot with svn (Tortoise) in the past, even SourceSafe (but luckily that's quite a while ago).
So your advice on using such systems is a really good one!!!
I just cant span the bridge between your advice and my designer crashing (and working again after restarting VS).
Would you mind and explain the difference that using a revision control system would make according to the designer-problem? It seeme that I don't know too much about the "magic" happening in the background of VS that causes the problem.
Thanks for your advice, I really appreciate it and I already readdressed the need for revision control to my supervisor,
best regards
Andy
hoernchenmeister
1-Mar-11 10:40am
View
Douh, the problem went away after rebooting...
Anyway, thank you Robert for explainig the cause for the problem.
I didn't knew this ;)
best regards
Andy
hoernchenmeister
1-Mar-11 5:54am
View
Thanks Robert for this information. Sounds good to me...
Do you have any idea where to check in order to remove the previously serialized CustomObject?
Or where to suppress this?
I made sure this is the only copy of the assembly flying around.
hoernchenmeister
21-Jan-11 9:33am
View
Thanks a lot for explaining this to me, it makes perfectly sense!
Have a great day and thanks again,
best regards
Andy
hoernchenmeister
21-Jan-11 9:23am
View
The error is the following (sorry, I translated it...)
The type "library.Contracts.Core.Application.IEnvironmentProvider" is defined in a not referenced assembly. Add a reference to assembly "library.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
Its all about an interface there...
hoernchenmeister
20-Jan-11 2:25am
View
The idea behind is that every plugin shall write its logging information into the same database.
But if necessary this should be exchangable via the plugin mechanism.
I thought about this tonight and maybe the idea where every plugin just imports a "Logger" would suite best.
I would be able to exchange importing code for the plugins if necessary and put the configuration of the EntLib logging into an extra dll. It would also allow to import multiple loggers (if ever necessary) in a later stage.
Anyway, it is more a theoretical question now... still the other option would be having the mainframe import the loggers via MEF and then inject those into the plugins on load. That would require a change to the contract the plugins are based on (its a pretty early stage so this would be possible).
I really like the idea behind having MEF import whatever I need, but is this the best approach?
What do you think?
hoernchenmeister
22-Nov-10 2:43am
View
Nobody? Not a single idea?
I can provide Testprojects to reproduce this behavior if necessary...
hoernchenmeister
18-Nov-10 5:38am
View
Thanks Dave ;)
...this bugs me for days already :(
hoernchenmeister
18-Nov-10 3:15am
View
The service configuration is always the same. I just copied it from the C# test-environment to the VB test-environment. Also the TestClient.config resides within the same directory as the C#/VB Test-App.
hoernchenmeister
11-Nov-10 7:58am
View
Yes, that definitely makes sense...
Thanks for pointing this out, I really appreciate it.
hoernchenmeister
11-Nov-10 2:35am
View
The project I am working on is splitted into three parts. The first one wrapps up the service (initializes it and handles lifetime) and fires an event (maybe that is important) if a message is received, the second one is a static class with a static method to be called to send the message.
The last part is an application that hosts the service-host and has subscribed to the event fired by the service-host.
So if the service-host raises the IncomingMessageReceived event the app fires the MessageBox(Console.WriteLine).
that's the app-code so far:
private InterAppMessageHandler _interAppMessageHandler = InterAppMessageHandler.Factory(); //returnes an instance of the MessageHandler (service-host)
interAppMessageHandler.IncomingMessageReceived += interAppMessageHandlerIncomingMessageReceived;
void interAppMessageHandlerIncomingMessageReceived(object sender, string msg)
{
MessageBox.Show(msg);
Console.WriteLine(msg);
}
The sending application (different form) just calls the static method:
InterAppMessageSender.SendMessage("some text");
What might be important is that if I send the message like this:
Task.Factory.StartNew(() => InterAppMessageSender.SendMessage(msg));
I do not get any problems at all, even with the messagebox...
hoernchenmeister
11-Nov-10 2:21am
View
So this happens even if the service does not return anything?
What makes me wondering was that the timeout happened on the client. I didn't expect that the service that received the call successfully and does not return anything causes such a behavior.
hoernchenmeister
9-Nov-10 11:25am
View
You are totally right. This happened due to renaming the namespaces for this post... It should just serve as a sample to hide the ugly, companyenforced namespaces I have to use ;)
hoernchenmeister
9-Nov-10 9:55am
View
I already tried this, but honestly I would prefer to know how to do this without having to change the namespace manually over and over again ;)
I am quite new to the topic and I am not sure if this would leat to other problems later on...
hoernchenmeister
8-Nov-10 3:20am
View
Thanks dude, I'll go for this approach ;)
hoernchenmeister
22-Oct-10 12:40pm
View
...just what I was searching for ;)
Thanks a lot and have a great weekend,
cheers
Andy
Show More