Daniel Gackle wrote:
Will Whidbey will include the ability to put inline assembler into C#
code?
I found a previous thread in which it was implied that a future
version of .NET would support this.
(http://groups.google.com/groups?hl=e...%40tkmsftngp02)
My team is working on a program for defining and executing complex
economic calculations. We love C# but there are a number of
performance-critical sections that we would write in assembler if we
could.
I haven't heard any rumors of inline asm being added to C#, and I'd be
surprised if it ever did get added. I'm not sure I'd read into Eric
Gunnerson's response the idea that it's planned (and the other response
in that thread was from someone who has no ties to Microsoft as far as I
can tell).
However, you can use the C++ compiler to build a managed assembly that
also contains unmanaged native code. In general, the managed code can
call the unmanaged code and vice-versa (you may see this called
"It-Just-Works" or IJW). So, you could use Managed C++ to compile a
module or assembly that contained a function that had inline asm, and
call it from your C# code.
Of course, this will mean that your application needs to be run in a
security context that allows unsafe code, so you need to understand what
that will do to your installation/deployment scenario.
--
mikeb