|
how can i copile C# projects (with VS 2005) for netFrameWork 1.1 ...
i intstalled Vs2005 and so netframework2 installed .. so every projects for netfr..2 .. and dont work with only netFrame..1.1
??
(sorry for my bad English )
|
|
|
|
|
There's no easy way as far as I know, this did come up a few days ago in one of CP's forums but I can't remember which (I think it was this one).
I seem to remember that there is a build of MSBuild (no pun intended) that targets .NET 1.x and since the VS2005 solution files (or project files) are glorified MSBuild files then you can build the solution with MSBuild targetting .NET 1.x.
But unless you write some form of macro or add-in I don't think that there's a way to accomplish this from within VS2005 but you can do it outside the environment.
Ed
|
|
|
|
|
oo this bad for me.. thank ou Ed .. and any other solution for this.. i will wait..
-- modified at 17:17 Tuesday 11th April, 2006
|
|
|
|
|
Why do you need to run stuff under 1.x if you have 2.x?
Ed
|
|
|
|
|
yippie i found .. thanks Ed.. but this is lon long way.. no other way , so i will try this.
(i tagged with code so any adv. link bla bla)
http://weblogs.asp.net/israelio/archive/2005/06/08/410811.aspx
-->> this boy reads this info from msdn blogs [until now i will search from there,, this is better way.. and offcourse i will write what i learned ]
you ask: Why do you need to run stuff under 1.x if you have 2.x?
i will show my projects to my friends,teasher and others.. we are using 2003 in school and the computers dont have netfr..2.x and i have no permission to install vs 2005 ..
thats why i need this..
thanks
-- modified at 17:28 Tuesday 11th April, 2006
|
|
|
|
|
If you're using the full copy of VS2005 and not the express versions then you could write a macro which calls MSBuild to build it targetting .NET 1.x, then map a keyboard shortcut to this macro so that at a keypress you can build the .NET 1.x version.
Of course you need to make sure you don't use any of the new classes available in .NET 2.0.
Ed
|
|
|
|
|
I think this might be possible, but because of the difference in the compilers between 1.1 and 2.0 and the framework it may prove to be a challenge.
One method to get around this, is to compile the project using the 2.0 compiler and forcing the compiled 2.0 assembly to run using 1.1 when 2.0 is absent. To do this, add this section to your App.config file:
<configuration>
<startup>
<supportedRuntime version="v1.1.4322"/>
<supportedRuntime version="v1.0.3705"/>
<supportedRuntime version="v2.0.50727" />
</startup>
</configuration>
Regards, Graham
|
|
|
|
|
microsoft developers says interesting words [this is stupid i think:a pruduct cant running at older versions. ]
their soutions are long long ...
Have you seen my MSBuild Toolkit yet?all links are bad in m!cro$oft blogs.
-- modified at 2:31 Wednesday 12th April, 2006
|
|
|
|
|
|
Hi everybody
I am developing an aplication to conect with a Microsoft Access database. I need to know wich drivers i need to install in a PC with Windows ME, to make this software functional, because i install yet the .net framework, but when the application tries to connect to the database, it throw an exception.
|
|
|
|
|
Try hunting for Jet 4 (Jet is the name of the Access driver) on the MSDN website. I can't remember which version it's currently at sorry...
Ed
|
|
|
|
|
I have a case where several objects may trigger an event that is handled in one place. I use the sender object type to determine whether I should perform some task on the object. However, how can I catch the condition where an object inherits from the type of object I am interested in? I'd like to include that object as well.
Here is an example of what I am doing:
<br />
if (sender.GetType() == typeof(CMyClass) )<br />
{<br />
}<br />
If something is derived from CMyClass, I'd like it to go through the "Do Something" code. How can I check for it?
|
|
|
|
|
Just test if you can cast it to the other class/interface:
if (sender as CMyClass != null)
{
}
|
|
|
|
|
Ah, thanks! That is what I wanted.
In case anyone else is interested, another way to handle this issue (or get around it) is by associating your base class with an interface. All inherited classes are also of the same interface so I was able to do something like this:
if (sender is ISomeInterface)
{
}
|
|
|
|
|
Use the is keyword:
if (sender is CMyClass) {<br />
}
---
b { font-weight: normal; }
|
|
|
|
|
Ah! This is what I want. Thanks.
|
|
|
|
|
Apologies for the rather vague thread title, it is difficult to summarise this question.
I would like to make sure I havent broken any cardinal sins with the following implementation of a delegate. Essentially I have the following classes:
class MyClass
{
public delegate void MyDelegate(string s)
private object delegateObj;
public MyClass(MyDelegate md)
{
this.delegateObj = md
}
public void DoSomething1(string s)
{
(this.delegateObj as MyDelegate).DynamicInvoke(new object[] { s });
}
}
class Worker
{
public void DoSomethingA()
{
MyClass.MyDelegate delegateObj = new MyClass.MyDelegate(MyFunction);
MyClass mc = new MyClass(delegateObj)
mc.DoSomething1("hello");
}
public void MyFunction(string s)
{
Console.WriteLine(s);
}
}
The reason for this is that I dont want to have to pass the a reference to the delegate every time I call the DoSomething1 method.
public void DoSomething1(string s, MyDelegate md)
{
md(s)
}
I couldnt find a way to store an instance of MyDelegate directly so in came the object and as cast and DynamicInvoke . While this seems to work fine, but as I am fairly inexperienced with delegates it just seems a little flakey to me.
An alternative would be this:
public void DoSomething1(string s)
{
(this.delegateObj as MyDelegate)(s)
}
Although I have a feeling that under the hood this is exactly the same
|
|
|
|
|
With the following declaration you can avoid the casting:
private MyDelegate delegateObj;
Also I would recommend your alternative to invoke the delegate because it is typesafe (you could put any kind of objects into the DynamicInvoke call - the compiler won't complain).
|
|
|
|
|
Hello, all. I'm writing a little app that lives in the system tray. I'd like to display a different context menu for the NotifyIcon control based on whether the user clicks the left or right mouse button. However, I can only get the context menu to display on a right-click, which is the NotifyIcon control's normal behavior. From doing a bit of reading on the internet, I've seen that the NotifyIcon control is not really a control but a component, though I'm not sure of the differences.
Anyone have an idea on how I could make this work? The less hack, the better... but I suppose I can't be too picky since I can't get it to work now anyway. Any help would be most appreciated. Thanks.
|
|
|
|
|
Have you tried catching the click event of your notify icon and calling the Show method of your context menu inside the event handler.?
www.troschuetz.de
|
|
|
|
|
Yep. Unfortunately, that produced some odd results. The context menu ends up showing at the top-left corner of the screen (0,0) instead of around the system tray where the mouse was clicked. Setting the top and left properties didn't seem to make a difference, it still stayed in the same position at the top-left of the screen. Any other thoughts would be appreciated.
|
|
|
|
|
How did you call Show method of your ContextMenu? I tried it myself and failed, cause both overloads require an instance of Control class, but unfortunately NotifyIcon is directly derived from Component type.
www.troschuetz.de
|
|
|
|
|
I am putting shapes in to a list array
Then I use the code below to draw them on the forms background, I have this in the forms paint handler.
foreach (Shape s in shapesArray)
{
s.Draw(g);
}
What I want to do is click on the form and a message box come up and saying true or false if the mouse point was in the shape.
I have tried using the region command and isvisible but I can not get it to work how I want.
Any help would be much appreciated.
|
|
|
|
|
Try to get the location where you clicked and check if it's contained in the control.
Must be something like this:
if (s.Location.ClientRectangle.Contains(e.Location) == true)
{
...
}
|
|
|
|
|
Hi. I'm trying to solve a very strange problem. I have a windows forms application that makes calls to a web service. When the web service method is invoked, it is executed without exceptions on the web service side. When this method returns, the application exits without exceptions. It simply closes with error 0 (success).
Other methods of the webservice are called before this problematic method without problems.
Another strange behaviour: if I am debugging the application, it ends on the initialization when I call the problematic webservice method. But if I run the executable itself (without debugging), the application starts (the problematic method works) but it fails on another webservice method invoked on a button click.
The windows forms application looks like this:
public void Main()
{
try
{
webService.NormalMethod1();
webService.NormalMethod2();
webService.ProblematicMethod1(); //returns a DataSet with one table and one row
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void button_Click(object sender, EventArgs e)
{
try
{
webService.NormalMethod3();
webService.ProblematicMethod2(); //returns a string
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
As I said, if I am debugging, after the webService.ProblematicMethod1() method is called the application ends. If I run the executable itself webService.ProblematicMethod1() works and when the button is clicked, webService.ProblematicMethod2() makes the application terminate. In both cases, the catch block is never reached (the MessageBox is never shown). I've created a event handler for the Application.ThreadException event but it is never invoked.
The windows application also communicates with mobile devices through ActiveSync. The described problem only occurs when devices running Windows Mobile 5.0 are connected. It works fine with older devices. In my point of view, the PDA should not affect the windows application since what's involved in this piece of code is only the web service.
I don't know what to do and I need to solve this problem as soon as possible. Any suggestions will be greatly appreciated.
Thanks
|
|
|
|