How can you control the content of the assembly manifest.

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

For example, how do I prevent the following function from appearing in the assembly manifest?

#pragma unmanaged
void Fn() {
int a = 1;
}

It is a large port, so transforming these global functions to statics of newly defined classes would be quit a effort.
 
That is not possible due to the current implementation of IJW. #pragma
unmanaged only controls wheteher the code is generated as native code or as
IL, it doesn't affect metadata emission or prevent emission of thunks that
enable calling from managed to unmanaged code and the other way around.

Ronald Laeremans
Visual C++ team

Jon said:
For example, how do I prevent the following function from appearing in the assembly manifest?

#pragma unmanaged
void Fn() {
int a = 1;
}

It is a large port, so transforming these global functions to statics of
newly defined classes would be quit a effort.
 
Thanks for the reply. I would not have guessed that you could not control whether items internal to the assembly are exposed in the
assembly manifest.
 
You can put them in a compiland that is compiled without the /CLR switch
altogether (instead of in a #pragma unmanaged block). That gets rid of the
meta data signature.

Note that in CLR terms these functions are not internal to the assembly. You
are seeing one of the side effects of combining a separate compilation
language with the CLR metadata model. At least a side effect of our current
implementation.

Ronald

Jon said:
Thanks for the reply. I would not have guessed that you could not control
whether items internal to the assembly are exposed in the
 
Thanks, compiling pure unmanaged units without the /CLR, greatly reduced the meta data pollution.
 
Hello Jon,

Thanks for posting in the group.

Do you have any more questions on this issue? If yes, please feel free to
post here.

If you have any feedback on Microsoft product, please feel free to submit
it at:
http://register.microsoft.com/mswish/suggestion.asp?&SD=GN&LN=EN-US&gssnb=1
We appreciate your input there, and look forward to building better
products with helpful ideas such as yours.

Thanks again for participating the community.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top