|
Why do you want to generate XSD from WSDL ?
There are many free XSD generators available on net. Just google for it.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hello
I want to create a form like that you can see in project properties page (Right Click on project name and select properties) in visual studio.net, Is that TabControl or just some buttons with custome effects.
Tank you
|
|
|
|
|
It's a custom control, as is much of VS.NET.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
If u want to get the application just which looks like vs.net then you can try CAB/SCSF from microsoft along with third party controls. and if u r looking for only some design consideration like tabbing, thn i think third party tools will help u in designing in that fashion. One of the third party tool i have used is Infagistics. For tabbing, docking and hide positions(as it is in vs.net) is provided by dockmanager control in Infragistics. There are many third party tools, which u can try as it comes with trial versions.
|
|
|
|
|
Tank you freinds
Can you give me a site url about this third party control you mentioned ?
Regards
|
|
|
|
|
www.infragistics.com download the trial version.
|
|
|
|
|
I am writing a service and I want to load an assembly from within my bin directory where I'm executing from. Assembly.GetExecutingAssembly() returns null. Environment.CurrentDirectory points at the system32 folder. So how the heck to I get where I was loaded from???
Any help would be appreciated.
Michael
|
|
|
|
|
System.Windows.Forms.Application.ExecutablePath
|
|
|
|
|
This returns null in a windows service.
|
|
|
|
|
From: theRealCondor
If you bothered to read my post instead of jumping in and providing something worthless then you would save from making yourself look like an idiot.
Well how about
System.Windows.Forms.Application.StartupPath
I just found that I use that in one of my services.
-- modified at 19:45 Wednesday 2nd May, 2007
|
|
|
|
|
I haven't found that to be the case.
Two other methods that may work:
System.Reflection.Assembly.GetCallingAssembly().Location
System.Reflection.Assembly.GetExecutingAssembly().Location
|
|
|
|
|
FYI - I was half asleep while doing all this posting on the service. You kept asking how the ExecutablePath could return null and you are correct it did not return null. Per my original post that is the one call that returned a value: C:\Windows\System32
Obviously that was not useable. The reason I do not get the base folder is because I'm being called by the operating system in my OnStart and OnClose events. The AppDomain finally gave me the correct path since that tracks the base path of the current application domain regardless of the calling application domain.
I believe you asked about why do it in the events in one of your questions. I am managing WCF ServerHost entities which have to be started at OnStart and closed correctly at OnClose or OnShutdown. So I hope this clears all of your confusion regarding what I was experiencing vs. what you experienced.
|
|
|
|
|
System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
this will return the path of exe of windows service now to get the directory path parse the string and get the folder path i have dome it for my self u can see it.
////
public string GivePath()
{
string originalPath =System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
int length;
length=originalPath.Length;
string sp=@"/";
char c=System.Convert.ToChar(sp);
string[] splitstring=originalPath.Split(c);
int mylen=splitstring.Length;
string exepro =splitstring[mylen-1];
int exeprolen=exepro.Length;
int reqlength=length-exeprolen;
string truncstring=originalPath.Substring(0,reqlength);
int rellength=truncstring.Length - 8;
string string1=(truncstring.Substring(8,rellength));
//string msg=string.Empty;;
return(string1);
}
just relax
|
|
|
|
|
Come to think of it... how can Assembly.GetExecutingAssembly() return null ?! Are you calling from unmanaged code?
|
|
|
|
|
Thank you for the added property I needed.
Now I can give back to you for a faster way to get your path:
string originalPath = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
string location = originalPath.Substring( 0, originalPath.LastIndexOf(@"\")+1);
|
|
|
|
|
thanx thats very cool actuallty i use it every day and i have always been using the longer one thanx
masti cha yaar
|
|
|
|
|
This returned null in my windows service.
|
|
|
|
|
string originalPath = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
string location = originalPath.Substring( 0, originalPath.LastIndexOf(@"/"));
this works
|
|
|
|
|
For a service running in a secured system under the 2.0 framework :
AppDomain.CurrentDomain.BaseDirectory
Thanks for your attempts to help.
|
|
|
|
|
I really would like to know...
how can Assembly.GetExecutingAssembly() return null ?!
|
|
|
|
|
It may be due to looking for this at the OnStart implementation (in which I'm an event handler of a different process) but I really don't know. When I got tired of blowing up with each individual attempt, I finally did this:
In my OnStart event handler, I commented out all code and had a sequence of Debug.Trace messages that displayed the results of each item as follows:
Assembly.GetExecutingAssembly()==null?" GetExecutingAssembly null ":Assembly.GetExecutingAssembly();
AppDomain.CurrentDomain.BaseLocation == null?" CurrentDomain.BaseLocation null": ....
This way I got the results of everyone of the items that people suggested or that I had attempted. In that example everything came up null except for the AppDomain approach.
|
|
|
|
|
Huh, I'll have to see what I get when I do that.
|
|
|
|
|
I just tried it in the OnStart of one of my complex services, both debug and release builds.
System.Windows.Application.ExecutablePath and System.Windows.Application.StartupPath
gave the information about the executable that loaded the DLL, which is still good for simple services, but not here.
System.Reflection.Assembly.GetExecutingAssembly().CodeBase
gave the name of the actual file containing the executing code
However! My OnStart is in a base class in another DLL so I got information on that, including when in release mode the particular DLL in in the GAC!
So, I wrote an override of OnStart in my service class and I got the expected result.
But at no time did System.Reflection.Assembly.GetExecutingAssembly() return null , I am still most curious your statement that yours did.
At any rate, I doubt that OnStart() is the proper place for the code you're trying to run, it should be very small, my version is:
protected override void
OnStart
(
string[] args
)
{
# if DEBUG
System.Threading.Thread.Sleep ( 60000 ) ;
# endif
this.oktoproceed = true ;
base.OnStart ( args ) ;
if ( this.when != null )
{
this.when.Start() ;
}
LogMessage ( this.ServiceName + " started" ) ;
}
(when is a System.Timers.Timer that controls the cycling of the service)
|
|
|
|
|
I have a general service that starts up several WCF services. This all works great. Now I have two different thread processes I need to start. I would like to use a configuration file (XML) to define the classes and target methods and this requires that I use reflection to create the thread object correctly. So I basically have to recreate:
Thread newThread = new Thread(new ThreadStart(class.Method));
Any ideas or article someone can point me to? Is this even possible?
Thanks,
Michael
|
|
|
|
|
Well, a ThreadStart may be a zero-parameter delegate, but that method can contain anything...
<br />
_obj = Get_My_Object_Through_Reflection_Somehow<br />
<br />
Thread newThread = new Thread(new ThreadStart(RunObjMethod));<br />
newThread.Start();<br />
<br />
...<br />
<br />
private void RunObjMethod()<br />
{<br />
_obj.Method();<br />
}<br />
There are of course ways to clean this up... You could pass the object and a string with the method name to a private class, and have the class do something like the above code in its constructor, just to keep everything encapsulated. Make it nice and general, and hook up a static method to wrap the constructor, and you can make it look like:
<br />
StartInThread.Launch(myObj, "MethodName");<br />
<br />
...<br />
<br />
private class StartInThread<br />
{<br />
object _obj;<br />
string _methName;<br />
<br />
public static void Launch(object obj, string methName)<br />
{<br />
new StartInThread(obj, methName);<br />
}<br />
private StartInThread(object obj, string methName)<br />
{<br />
_obj = obj; _methName = methName;<br />
Thread thrd = new Thread(new ThreadStart(Run));<br />
thrd.Name = methName;<br />
thrd.IsBackground = true;<br />
thrd.Start();<br />
}<br />
<br />
private void Run()<br />
{<br />
...get a MethodInfo for _methName in _obj, and call it directly...<br />
}<br />
}<br />
(Pardon any syntax errors, since I just typed that up in this box)
|
|
|
|