|
I am sorry, I didn't expressed well...
I am trying to make components compilable on both .Net 1.1 and .Net 2.0 using "platform specific" GUI. Meaning that for example, on 1.1 it uses MenuItem and on 1.0 MenuItemStrip.
So I have to make some choiches based on the core version.
Is there anyway to find out what version I am facing?
ps: Thank you for your previous answer
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Your best bet would be to write a small C++ program that checks the registry (or some other source) for all sorts of .NET frameworks installed. Then you would start your .NET assembly that matches the framework version. So I think you need to compile your program both against 1.1 and 2.0 (using pragma directives) and then start the appropiate assembly.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
the easiest might be just to check if those types are available:
if (Type.GetType ("Some.Name.Space.Some20specificTypeName",false,false) != null)
{
//you are in 2.0
}
else if (Type.GetType ("Some.Name.Space.Some11specificTypeName",false,false) != null)
{
//you are in 1.0
}
else
{
}
however I usually make 2 solutions , one for 1.x and one for 2.0
and define a conditional var like "net20"
#if NET20
#else
#endif
//Roger
http://www.puzzleframework.com
|
|
|
|
|
Your ideea is interesting, I think I will consider it. But the main problem is that the code will fail to compile for the 2.0 version if is compiled from the 1.1 - ie. compile, not execute.
Macrodefinitions and conditional code was what I had in mind. I thought that there was some kind of macro __dotNet1_1 or __dotNet2_0 defined standard.
My intention was to make the code usable with no user intervention, but currently I think that this is impossible.
Thanks for the answer.
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Vlad Stanciu wrote: My intention was to make the code usable with no user intervention, but currently I think that this is impossible.
Just don't use any .NET 2 classes or constructs (such as anonymous methods) and then it will automatically, and hopefully happily, compile under both regardless of which version is used.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
The best programming way may not be the simplest...
Btw, in your post you suggest me not to do what I want, the source of the whole thread
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Vlad Stanciu wrote: Btw, in your post you suggest me not to do what I want, the source of the whole thread
Well then the only solution is that you're going to have to maintain "two" different versions, those that use .NET 2 classes and constructs and those that don't. This can either involve having two seperate solutions / projects / directories or by using a hell-of-a-lot of
#ifdef DOTNET2
#elif
#endif It's the only way I'm afraid.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
Ed.Poore wrote: Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
hi every body
i need help in getting an input to the parallel port using c#
i read about using timer with round robin method , please help me
thanx for reading my message
hi score
-- modified at 6:44 Sunday 18th June, 2006
|
|
|
|
|
Um, Google!
http://www.google.co.uk/search?q=reading+from+parallel+port+%2Bc%23[^]
How about looking at the first result, exactly what you want me thinks.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
hi all,
i create installer class that will run while installation but it will receive value from user during installation
what is the proper way for this?
thank you
|
|
|
|
|
Depends on what you're using.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
Could someone please suggest the least problematic way of storing tables that have been created and filled with data runtime, into a SQL server database.
I am also looking to name the new tables in the database sequentially.
Any suggestion would be appreciated. ![Confused | :confused:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
|
That sounds like a good way of arranging things, however as a beginner I am having problems managing items such as datasets and tables that are being created dynamically as the program runs and items that already exist as they have been created in the IDE, such as data sources, table adapters ETC.
I am working on a data import program so the conventional approach of creating a database , data source, tables, table adaptors, and so on in the IDE doesnt work as there is no data to begin with.
I currently have all my imported data in a datagrid , parsed correctly , just would like to know the best way of moving this to a blank SQL database.
Thanks for all the help so far
|
|
|
|
|
|
i have an windows application that is a client for my web service ,where i use sessions to keep if someone is logged in !
but every time i call i new method from the client application , the web service does not remember that i had logged in just before to calle that methot!
pls help ..
Thanks!
|
|
|
|
|
You have to get the cookies that the server returns when you are logging in, and send them back to the server in every request for the server to be able to identify the session.
---
b { font-weight: normal; }
|
|
|
|
|
can i learn fast to work with cookies, if its simple i mean if i could make it in 10 minutes ...could u give me a simple example?
if its not simple i will make it in a different way...
-- modified at 7:10 Sunday 18th June, 2006
|
|
|
|
|
You don't have to .net framework allready has the functionality for this. You just have to set the CookieContainer property of the client service with CookieContainer instance and also you must take care to use the same container on every call if you want to use the same session.
damianbc
|
|
|
|
|
u check for this in web sites
|
|
|
|
|
|
|
|
No, you're wrong!
It's because of the difference between a pigeon!
|
|
|
|