|
How do I actually do that?
I tried to call one control's event (forgot which one but that shouldn't matter) and call it inside another control's click event.
Yet the only thing I know how to do is to add a new EventHandler to a control's events and then add some code for it, but not how to call a event without the user explicitly triggering it.
modified on Friday, March 6, 2009 6:01 AM
|
|
|
|
|
Hi All,
I posted this over on the VS forum yesterday but I've not had any reply so I thought I'd try here today.
I'm having real troubles tracking down a referencing problem.
I have been incorporating a new version of one of our DLLs into a client application. When running the application it blows up complaining about not being able to find the old version of one of our DLLs.
The DLL throwing the error has been updated/rebuilt to reference the new DLL as have all the DLLs this DLL references. I've checked the .csproj file and the reference in there is correct.
Running the whole application through NDepend displays a warning on this DLL and Reflector shows this DLL as referencing both versions (which I didn't think was possible!) ...
None of the DLLs have been GAC'd either so its not getting a reference this way.
I've never seen anything like this, I'm totally at a loss as to how this DLL is getting a reference to the old version.
Does anyone have some tips on how to track this rogue reference down?
Cheers,
|
|
|
|
|
Did you try using Fuslogvw[^] ?
To fix the problem try adding a Probing private path See here[^]
Hope this helps.
|
|
|
|
|
Hi Chap,
Indeed I've been using Fuslogvw today with no luck ...
I'll have a look at this Probing path jobby ... thanks!
Cheers,
|
|
|
|
|
Jammer wrote: The DLL throwing the error has been updated/rebuilt to reference the new DLL as have all the DLLs this DLL references. I've checked the .csproj file and the reference in there is correct.
Referencing is what Visual Studio does to build your project, at runtime it's all in the manifest.
|
|
|
|
|
Indeed. The problem has now been fixed. It was a rogue dll in the referencing folder.
The app I'm building is a CAL WPF app so its all decoupled and spread over many solutions meaning that there is more leg work in terms of ensuring that all the references are as they should be.
|
|
|
|
|
Hi there,
I have created an .xsd schema which I want to include in my project (Windows Service). First question is: what is the best way to include it? as a resource? or just by doing "Add existing item"? what is the difference(if any)?
So far, I have added it as a resource (jobs.xsd). Ok, so now I want to validate an xml file, thus I am trying to do as follows:
1. XmlSchemaSet xss = new XmlSchemaSet();
2.
3. xss.Add("http://www.w3.org/2001/XMLSchema",ClassLibrary1.Properties.Resources.jobs);
4. XmlReaderSettings settings = new XmlReaderSettings();
5. settings.ValidationType = ValidationType.Schema;
6. settings.Schemas = xss;
7. settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
8.
9. XmlReader reader = XmlReader.Create(xmlPath, settings);
10.
11. while (reader.Read()){};
This code breaks on line 3, with a System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path)
at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.Path.GetFullPath(String path)
at System.Xml.XmlResolver.ResolveUri(Uri baseUri, String relativeUri)
at System.Xml.XmlUrlResolver.ResolveUri(Uri baseUri, String relativeUri)
at System.Xml.Schema.XmlSchemaSet.Add(String targetNamespace, String schemaUri)
at ClassLibrary1.ReadXml.ValidateXMLAgainstXSD(String xmlPath) in c:\myproj\ClassLibrary1\GetXml.cs:line 95}
How could I get around this problem?
Cheers
modified on Tuesday, March 3, 2009 6:57 AM
|
|
|
|
|
If you still have not figured it out, the .Add overload you're using expects the URi of your .xsd file, and not the file's contents as a string.
It compiles, because there is not type mismatch, obviously.
All you can do is stream the contents of your .xsd, then feed it to an XmlReader and then pass that XmlReader as your second parameter of .Add's next overload.
That should help, hopefully.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi Greg,
I think I should have been more precise. I knew I was passing the wrong data type to the .Add method. My problem was converting my string into a valid data type that the .Add will take.
At the end I am doing as follows:
StringReader sr = new StringReader(ClassLibrary1.Properties.Resources.jobs);
XmlSchema schema = XmlSchema.Read(sr,null);
sr.Close();
xss.Add(schema);
Anyway, thanks for your post!
|
|
|
|
|
i have problem for resizing of selected image.
|
|
|
|
|
|
Please elaborate on your requirement. If you mean to resize or edit icon or Bitmap, Then you can open it in Visual studi editor itself and do it.
|
|
|
|
|
I have to find the code blocks from the given code using Regex in C#.
e.g. I have to find the For loop block from the following code
For A in 1..10 Loop stmt1; For C in cur_op Loop stmt2; end loop; end loop; For T in 4..8 loop stmt3; end loop;
I want to retrieve the code blocks as
For A in 1..10 Loop stmt1; For C in cur_op Loop stmt2; end loop; end loop;
and
For T in 4..8 loop stmt3; end loop;
Can anyone suggest me any Regex for this?
Thanks.
|
|
|
|
|
what about -
"For + in + Loop +;"
im not 100% thou
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
|
If you realy think so, why dont u do it and tell me the answer?
|
|
|
|
|
hi dear friends
i wnat details in sqlconnect to C# ............ how can i connect sql2005
|
|
|
|
|
can you please reformulate?
|
|
|
|
|
First try a sensible subject, then go to here[^]
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
In c# code similar to the windows task manager functionality and when i'm trying to reach some processes
like sqlserver a runtime error appears(access is denied)
how i can reach this problem?
|
|
|
|
|
Hi,
if you are trying to change a process that is not yours (SQL Server owns to a service account by default) Windows will block your activities.
For example: try to change the priority of SQL Server via Taskman, and you'll see.
AFAIK there's no work arround. It's not a problem in C# but in Windows.
Bye,
monsta
|
|
|
|
|
In my code:C#,
when i'm trying to reach to the starttime or make killing to some processes like sqlserver, an error msg appear(access denied)
but
when i make that through windows task manager which already come with windows, no error occur.
|
|
|
|
|
You can't kill processes you don't have access to. You are the weakest link, goodbye.
|
|
|
|
|
Hi,
did you try, to set the priority (right click in Windwos Taskman)? I'm running here an SQL Express 2005 under a service account. I'm not able to change the priority, because therefore I must have the permissions to do it.
I could end the task, but that's NOT the same.
Kind regards
|
|
|
|
|
I have an application that writes any data it receives on a port to a file. The files have the date appended to them which means I have to keep an eye out for a new day to roll around.
At present I'm using this little bit of code...
DateTime today = DateTime.Now;
if (!(today.Date == DateTime.Now.Date))
{
today = DateTime.Now;
}
...which is straight forward enough. I am just wondering if there is a better (more efficient) means to know when the clock rolls over to a new day? As it is, I'm running that bit of code immediately before EVERY file write, and change the file name as needed. For now, its not an issue take the time to do things this way, but as my incoming data load increases I can see where streamlining is going to become an issue.
Any suggestions?
---------------------------------------------
Help... I'm embedded and I can't get out!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler
|
|
|
|