|
Ok, so I finally installed .net and am starting to get into the whole managed extensions thing... But I'm reading this book in Barnes & Noble talking about the whole CLR and "Just-In-Time" compilation stuff and couldn't help but think about security. It's like compiled .net stuff is still source code, just a level lower than VB, C# or whatever .net language you want, but still above assembly or binary. Am I reading into this correctly? If I release a .net app, it is still in readable source and can be easily modified? Remember, I just installed VS7 yesterday, so don't flame me if I am totally off...
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
>Net "compiles" to IL (Intermediate Language), basically a very simple (in the RISC sense) assembly language with meta-data (dependancies, versioning,license and more). Although in this state it CAN be decompiled (even back to c# source), it cannot easily be modified if the assembly is "signed" (public/private key embedded in the assemby). Also there are "Obfuscators" available that can scramble the IL so it can't be decompiled. The IL is compiled to machine code when the assembly runs, allowing it to take advantage of any chip specific instructions, and theoretically, to run on a non-intel platform. The platform includes a viewer for the IL (ildasm.exe), which is handy if you want to compare implementations, and you can even code in IL if needed. a public domain decompiler is - Anakrino - available here[^]
It is also possible to "pre-JIT" your stuff, but you could run into probems with machine specific optimizations...
Have fun! .Net rocks
Some ideas are so stupid that only an intellectual could have thought of them - George Orwell
|
|
|
|
|
Rob Graham wrote:
It is also possible to "pre-JIT" your stuff
I don't know how the other pre-JITters work (IIRC it was Salamander software that has one out). But the ngen tool that comes with .NET is machine specific, in fact the pre-JITted assemblies get placed in the GAC to curb people from trying to copy them around.
Rob Graham wrote:
Also there are "Obfuscators" available that can scramble the IL so it can't be decompiled
There are different levels of obfuscators that are on the market now, there are some like Dotfuscator Community Edition[^] which renames objects; or if you move up to their profession version will do much more. Dotfuscator Community Edition will be shipping with VS.NET 2003 (aka Everett)
Another obfuscator is Wise Owl's Demeanor[^].
After being on various .NET mailing lists[^] (hosted by DevelopMentor), I've come to respect Brent Rector's knowledge of the .NET Framework and how it works so with the two products almost evenly priced I would give Brent the advantage if I were to purchase one of them. This is just my personal opinion, others may place more value in being able to try the product out first with less features.
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
James T. Johnson wrote:
Rob Graham wrote:
Also there are "Obfuscators" available that can scramble the IL so it can't be decompiled
So do these obfuscators impact any efficency of the code or allow for any optimizations?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Nitron wrote:
So do these obfuscators impact any efficency of the code or allow for any optimizations?
That depends on which one you use and the options you enable. I think the high versions of both obfuscators I linked to claim to provide optimizations by altering control flow.
Both of them make the resulting assembly smaller (even the free version of the one) because all identifiers get reduced to small strings.
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Hi,
I'd like to programatically display a dropdown menu from a toolbar. To be specific, I'm developing an Explorer bar, and I'd like to give it a menu. As far as I know, the only way to do that is to use a toolbar. So I have a couple buttons (File, Edit), and they both have dropdown menus. When a user clicks on the File button, I want it to popup the File dropdown menu, just as it might if the user clicked on the dropdown arrow.
I don't see a natural way to do it within the API yet. I tried using Show(), but the only problem is that I'd need to calculate the correct location for the dropdown menu to popup. Any better solutions?
Thanks,
Arun
|
|
|
|
|
Hi, I am new to .NET. I know C/C++ and use VS6.0
Nowadays I get touch with C# and its more easy to develop windows programs with it. I install VS7.0. But I can only run my programs in my computer. What is the minimum requirement to execute any program ,that creat by VS7.0, to run a computer.
Does it run in windows 95/98/me/XP...
I heard about CLR, JIT and pre-JIT.
I think the new .NET Framework much like java and today most of the computers have JVM to run java programs. What is JVM equal in .NET Framework and how to get it.
If the answers of this questions is long please refer me an URL to read more...
thankx
karanba
|
|
|
|
|
karanba wrote:
VS7.0
That's not meaning much. You've got to tell us whether you are using VC++.NET, VC#.NET, ...
And even if you use VC++.NET, you may quite well not use managed C++ at all, thus remain with WIN32/MFC/ATL/STL libs. managed C++ uses the .NET framework to compile and run, while standard C++ does not.
karanba wrote:
Does it run in windows 95/98/me/XP...
The .NET run-time runs on 98 oses+. The light .NET run-time known as the compact framework runs on pocket PCs.
karanba wrote:
I think the new .NET Framework much like java and today most of the computers have JVM to run java programs. What is JVM equal in .NET Framework and how to get it.
The .NET framework is a commercial name for the .NET virtual machine, also known as the CLR. It directly competes with the JVM, so much that MS even provides a bridge to translate java code to .NET compliant code.
Often, people use the .NET framework words to refer to the FCL (framework class library).
If you build an app with C#, VB.NET, managed C++, or other .NET languages, you need to distribute the .NET run-time as well. Which is 22MB. Lookup MSDN or google with that keyword : dotnetfx.exe
A few terms :
- .NET framework : core .NET package
- CLR : common language runtime ( = .NET run-time )
- CLI : common language infrastructure (design)
- CTS : common type system (string, int, ...)
- FCL : framework class library
- VisualStudio 7 : latest MS IDE (used for ASP.NET as well)
- VisualStudio 7.1 (codename Everett) : in beta until feb (I believe)
- .NET run-time 1.0 : Feb2002 RTM run-time
- .NET run-time 1.1 : beta run-time for .NET (along with Everett)
(embeds the compact framework)
- Visual Studio .NET = Visual Studio 7.x
|
|
|
|
|
thanks
I get the answers as well.
I want to ask a few
*Does a user need dotnetfx.exe to see pages that writen in ASP.NET?
*And for big programs doesn't it slow the copile time with JIT.
*On a coputer does a C# program need to be copile just only for first time or every time with JIT.
*So on is there any big program like AutoCAD, any office program or another gave up a release that use .NET framework.
karanba
|
|
|
|
|
karanba wrote:
Does a user need dotnetfx.exe to see pages that writen in ASP.NET?
Yes. ASP.NET uses classes from it.
karanba wrote:
And for big programs doesn't it slow the copile time with JIT.
It's compiled once only, the first time you execute the app. The .exe native image is automatically placed in a folder called the Global Assembly Cache, and then launched from there.
Well, yes, compilation takes time. I have yet to hear figures about huge .NET projects, however. So I guess pretty much nobody knows what are the figures for a 500,000+ lines of code app.
karanba wrote:
On a coputer does a C# program need to be copile just only for first time or every time with JIT.
Anytime the native image is not in the GAC. Typically, it's once time after each reboot.
Pay caution to the fact the GAC can be programmatically reached, made expired, and even purged. After such thing from another app, which you can't control, your app needs to be JIT-compiled again.
karanba wrote:
So on is there any big program like AutoCAD, any office program or another gave up a release that use .NET framework.
Apps that require brutal force will continue to live with C/C++ for the foreseeable future. Memory consumption (lack of control over the garbage collector), startup time, ..., are good reasons why.
And of course, .NET is really young and still unproven a platform.
|
|
|
|
|
karanba wrote:
Does a user need dotnetfx.exe to see pages that writen in ASP.NET?
The end-user doesn't need the .NET framework installed to view an ASP.NET page. The server that is producing ASP.NET content needs to have the .NET framework installed.
karanba wrote:
And for big programs doesn't it slow the copile time with JIT.
S.Rod was misleading in his answer. What he said is true if you run the ngen tool on the assemblies that make up the big program. It also doesn't apply if the assemblies are used in an ASP.NET application.
In all other cases, methods are JITted when they are first run, then the native code is kept around until the application (maybe even the AppDomain) unloads or the underlying IL is marked as dirty. The next time the application is loaded all the methods need to be JITted again.
If you don't understand this right away; don't worry, its a confusing topic.
karanba wrote:
On a coputer does a C# program need to be copile just only for first time or every time with JIT.
This ties in above, but to re-answer. In most cases the program will be JITted every time it is run. Only ngen can change that, and it has no effect on ASP.NET applications.
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
.thanx for all answers but I am not sure that get the subject. Please confirm me tha tif I understand truely.
(what is ngen?)
---------------------------------------------------
1. I wrote a program with some methods. Then when I built it with Visual studio.NET (or csc) all the things I wrote and other methods (like Console.write...) turned to MSIL. MSIL like something assembly (also this IL language could write directly by developer), so I get an .exe file.
2. When I clicked this .exe file anywhere (if .NET Framework is installed on the system) turned to native code by JIT (specific for the systems and for CPU) and runs. And this may done every time.
3. Only ngen can change that! what is ngen. How to use it.
4. One more... Doesn't it get security problems that MSIL can seen by using disassembler.
karanba
|
|
|
|
|
You must install .NET framework on a computer to run
.NET based applications on it. You can download .Net
Framework from Microsoft
|
|
|
|
|
Hi there,
I have a smart client that uses remoting via http channel and binary formatter. It is hosted in IIS.
Sending and receiving data works fine, except if a large amount of data is involved. Then I get the following error:
An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll
Additional information: BinaryFormatter Version incompatibility. Expected Version 1.0. Received Version 1008738336.1684104552.
In web.config and client configuration file I specified the following:
<channels>
<channel ref="http">
<clientProviders>
<formatter ref="binary" />
</clientProviders>
<serverProviders>
<formatter ref="binary" />
<provider ref="wsdl"/>
</serverProviders>
</channel>
</channels>
Does anyone know why this error occurs and how I can solve it in order to be able to work with larger amounts of data?
Thanks!
Ludwig
|
|
|
|
|
I'm not sure how you're transfering the data. If your sending a huge array of bytes, try sending a reference to the stream instead. Just have your remoted object return a stream object instead of the bytes.
Hope this helps
-Steve
|
|
|
|
|
I'm attaching the dataset to a container object, that is sent to the client. At the client, it then becomes the datasource of a datagrid. I need the data to be at client side completely, because data can be grouped and if not all data is present, inaccurate results are shown.
So I think a reference to the data is not an option here?
Anyway, I changed the configuration files. The web.config now looks like this:
<channels>
<channel ref="http">
<serverProviders>
<formatter ref="binary" />
<provider ref="wsdl"/>
</serverProviders>
</channel>
</channels>
and the client configuration file looks like this:
<channels>
<channel ref="http">
<clientProviders>
<formatter ref="binary" /> </clientProviders>
</channel>
</channels>
No I don't get the error anymore, instead I now get an 'out-of-memory' error!
Ludwig
|
|
|
|
|
Well, I probably found out the reason for this behaviour. In the event log I found the message:
"aspnet_wp.exe (PID: 1836) was recycled because memory consumption exceeded the 153 MB (60 percent of available RAM)."
The question is... how can I avoid my dataset being filled with too much data?
|
|
|
|
|
Sorry, I don't know. I'd really need a closer look at your code to understand what you're doing. Hopefully, someone else can give it a shot.
|
|
|
|
|
|
We ran into a similar issue with remoting large datasets, and came to the conclusion that if the dataset was large enough there were either memory leaks or at least garbage that was not reclaimed by GC in a timely fasion. There is an MSDN Mag article[^] that sheds some additional light on the issues. We ended up serializing the datasets ourselves, (basically into a collection of arraylists) and then reconstructing the dataset at the client from our custom object. This resulted in 30% less network bandwidth usage and a 100% speed increase. The fundamental problem seems to be that the contents of the dataset (datatables and datarelations) get seialized to XML even if the containing dataset is using a binary serializer, and in some cases this fails and some memory seems not to get reclaimed. Also, if the datasets are large, they get allocated on the large object heap which is not GC'd with the same frequency as other garbage (large objects are 'presumed' to have a longer lifetime... .
Some ideas are so stupid that only an intellectual could have thought of them - George Orwell
|
|
|
|
|
I am writing POP3 client in C#, i dont know how to get attchments from a mail. i am using Sockets to connect to a POP server. Any one know a generic way of seperating attachments from Mail contents. Any pointer?
Cheers,
Venkatraman Kalyanam
Chennai - India
"Being Excellent is not a skill, it is an attitude"
|
|
|
|
|
E-mail attachments are encoded using MIME, which is convoluted and ugly. I don't know of any free sources for decoding it. If your app will be GPL'd then you could gank some code from some *nix pop3 clients
I believe, the MIME 'standard' is documented as an RFC document.
FWIW, this is where I stopped writing my POP3 client as well
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
|
Hey guys
Are any of you famaliar with how to dock windows to the side of the screen, like the Taskbar does and programs such as ICQ and AOL Instant Messenger. If anyone has done this or knows where I can find information I'd appreciate it if you could send me in the right direction
I'm using C# / .NET, by the way.
Thanks
Dan
|
|
|
|
|
CP Clickety[^]
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|