|
Will my C# .Net programs work on other opperating system? Like OSX?
/\ |_ E X E GG
|
|
|
|
|
Visual Studio .NET only creates Windows apps, but there is a cross-platform, open-source version of .NET called Mono. You can use SharpDevelop[^] which can create Mono apps. SharpDevelop currently does not have many of the features of VS .NET, but it is being steadily improved, and it is FREE. You cannot currently run SharpDevelop on any OS but Windows, but I believe next version (0.95) will allow you to do this. You cannot build windows forms apps that are cross-platform yet, because System.Windows.Forms cannot be ported to other platforms.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
As long as theres a clr on that operating system it will work. Take that with a pinch of salt though cos who knows what features etc will be supported on that version of the clr.
Mircosoft have made one called rotor that runs on
'Windows XP, the FreeBSD operating system, and Mac OS X 10.2'
here[^]
Also someones doing it for linux, mono.
mono[^]
Which looks cool.
I have no experience with either of these implementations but I'll bet your in for some headaches trying to get your code to run on them as they seem to still be in development.
Hope this helps.
|
|
|
|
|
I am creating a "Visual Studio .NET" deployment project to install some component assemblies.
I would like that the setup program make the assemblies appear in the Visual Studio .NET "Customize Toolbox" dialog box.
|
|
|
|
|
In your deployment project for you "developer" version, create a new registry key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders. Use a unique string for the key name. The Default value should point to the directory where your assembly is located.
You'll need two copies of your assembly, one in the GAC, and one in a normal directory.
Hope that helps.
Burt Harris
|
|
|
|
|
I've been using Visual Studio 7.0 to develop a C# application for a while. Today, I downloaded and installed the .NET 1.1 framework and SDK. But I can't figure out how to get Visual Studio to start using the new version of the SDK. If I rebuild my project and run, it's still using .NET 1.0... you can see this in the output:
'DefaultDomain': Loaded 'c:\winnt\microsoft.net\framework\v1.0.3705\mscorlib.dll', ...
...
How do I get Visual Studio to start using the new version?
Part of my problem may be that I didn't install Visual Studio in its default location. I put Visual Studio in one place, but I installed the new SDK in the default place (i.e., Program Files).
I hope that I don't have to buy another copy of Visual Studio just to use the new SDK
|
|
|
|
|
I hope that I don't have to buy another copy of Visual Studio just to use the new SDK
I know you may not want to but you can upgrade to VS 2003 just for a "cost-of-materials" price, i.e., about $30.
However, there should be a way to do what you want but I've no idea how!
Kevin
|
|
|
|
|
Not if you're an academic
|
|
|
|
|
Actually, Visual Studio 2002 only targets NET 1.0.You you can not use the .NET 1.1 from within Visual Studio 2002. (
To build a .NET 1.1 App you have two options:
1. Use Visual Studio to write and organize your files and then use the command line compiler on the 1.1 SDK folder to build your app (but remember that NET 1.1 introduces some code-breaking changes to NET 1.0)
2. Upgrade to Visual Studio 2003
|
|
|
|
|
I have question. We are planning to write major stand alone app in .NET which hosts various GUI (Windows)
Screens( in ActiveX Objects) . Does .NET Remoting help us to host GUI Objects display remotely ?
Does .NET Support to display GUI Obejcts? or its just messaging protocol?
If you have good links please point me there
Thanks
Pavi
|
|
|
|
|
I am creating a setup project and I would like to install some assembly files into the Global Assembly Cache (GAC). How to indicate that in the setup project?
|
|
|
|
|
It depends on the setup program. But if it supports custom actions, then you can do
"gacutilpath\gacutil.exe" /i "assemblypath\assemblyname.dll"
where gacutil path is the path to gacutil.exe and assemblypath is the path to the assembly.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
I have finally discovered that the Deployment project in Visual Studio .NET offers a GAC folder. I have just, when creating my deployment project, to place my assemblies in this folder.
And now, I have another question: I would like that the setup program make the assemblies appear in the Visual Studio .NET "Customize Toolbox" dialog box. How to do that?
|
|
|
|
|
Hi. Can you please tell me what the AutoEventWireUp is for? I've read the explanations in SDK but I couldn't understand what it does.
|
|
|
|
|
I know you can make web-references dynamic, which then only need a small change in the web.config file to repoint them to the new location you want to look at.
My question is, can you do something aking to this with regular (non-web) references? Perhaps using the web/<application>.config file, or a manifest file or something?
We are looking to create a central library directory where we can keep our common libraries for access from any machine which needs them. One consideration was 2K's Distributed File System, but that is an awful lot of complications, especially since it means getting our domain administrators involved. So i was thinking there might be an easier way by being able to just put in a line which tells the app where to look for the reference at run-time. yes??
Thanks in advance.
|
|
|
|
|
There is a way of doing this with regular refrences though you are required to use reflection to dynamically load the assembly you are looking for.
Have a squizz here http://msdn.microsoft.com/library/en-us/cpguide/html/cpconhowruntimelocatesassemblies.asp[^]
It would probably be eaiser to just setup a network share for the library, and add a project reference. I think deciding which asseblies to use at runtime is most suited to situations where you know the interface but you want the freedom to decide which assembly you will use to implement that interface.
|
|
|
|
|
That sounds about right.
I would just point out that assemblies run from a network share will have reduced permissions when using the default security settings for .NET. Depending on what your assemblies do, you may need to alter these settings to give your assemblies the necessary permissions.
Regards
Mark Smithson
|
|
|
|
|
Sorry for the long post, but I need some help. I'm writing a class that implements IComparer, and I'm having some problems. What do you make of this:
My class looks like this:
class RandomComparer : IComparer
{
private static Random c_random;
private static RandomComparer c_instance;
public static IComparer Default
{
get {return c_instance;}
} // End Default
static RandomComparer()
{
c_random = new Random();
c_instance = new RandomComparer();
} // End RandomComparer()
int IComparer.Compare(object objA, object objB)
{
// Are the objects different?
if (Comparer.Default.Compare(objA, objB) != 0)
{
// Get two random numbers.
int numberA = c_random.Next(0, m_maxSample);
int numberB = c_random.Next(0, m_maxSample);
// Compare them and return the results.
if (numberA > numberB)
return 1;
else if (numberA < numberB)
return -1;
} // End if the objects are not the same.
return 0;
} // End Compare()
} // End class RandomCompare
I use this class to sort an array like this:
string[] someArray = new string[] {"item 0", "item 2", ... "item N"};
Array.Sort(someArray, RandomComparer.Default);
Everything works fine most of the time, but every now and then the framework throws an exception that says:
"An unhandled exception of type System.ArgumentException occured in mscorlib.dll
Additional information: IComparer (or the IComparable methods it relies upon) did not
return zero when Array.Sort called x.CompareTo(x). x: value 7 x's type: String
The IComparer: RandomComparer"
If I set Visual Studio.NET to break for all exceptions, I get a different exception, this time it says:
"A first chance exception of type 'System.IndexOutOfRangeException' occured in mscorlib.dll
Addition information: Index was outside the bounds of the array."
If I elect to continue debugging in this case, the framework then throws the first exception.
I searched the Microsoft knowledge base, and did a Google search, but I couldn't find anything.
Sheesh! This should be a five minute programming task, but I've worked on this all morning long!
Has anyone ever run across this? Does anyone have any ideas?
|
|
|
|
|
OK, either my original post was too long for anyone to read or I'm the only person having this problem. Let me simplify things. Has anyone noticed flaky behavior from .NET when creating or using a custom IComparer? I'll probably submit this to Microsoft support, but that will take forever... In the meantime, has anyone run across this sort of problem?
|
|
|
|
|
Hi, Martin.
Most sort algorithms need stable comparison functions. Your function seems to be returning random results when the objects are different, so the .NET framework gets lost.
Suppose you have created a function where A > B > C > D. Your IComparable should be stable and NEVER return B > A > D > C.
Comparison is, too, a transitive function. So, if A > B and B > C, you can safelly assume that A > C. Your function does not guarantees that.
My latest article: GBVB - Converting VB.NET code to C#
|
|
|
|
|
Hello everybody,
I've dome some research for an Open Source DataGrid component for .NET but I couldn't find anything worth working with. What do you think of starting up a new project for a suite of Data-aware components that could be comparable to commercial ones?
Is there anybody interested on talking about that?
Valerio Santinelli
|
|
|
|
|
Anybody know if the functionality of the discretionary access control lists is in the .NET managed framework anywhere --- i.e. can I programatically add or remove user permissions for a given shared printer without getting down and dirty with the API?
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
I've heard that some of these features can be found in the System.Management namespace. I have personally found it easier to just wrap the pertinent SDK calls using PInvoke. I seem to recall reading an article or two related to WMI and PInvoke/DACL stuff on this website. Try doing a search.
|
|
|
|
|
Can anyone explain to me why the text retrieved from a mutli-line textbox has CRLF instead of LF for new lines? And can I alter this behaviour?
I thought we'd seen the last of the whole dos vs unix thing
|
|
|
|
|
Well I guess a simplistic replacement strategy would be:
using System.Text.RegularExpressions;
...
someTextBox.Text = Regex.Replace(
myMultiLineString, "\n", "\r\n" );
and vice versa for reading text from a TextBox.
Does seem rather ugly to me though.
|
|
|
|