[Learn Note]Assembly Manifest

1 What is Assembly Manifest

Every assembly, whether static or dynamic, contains a collection of data that describes how the elements in the assembly relate to each other. The assembly manifest contains this assembly metadata. An assembly manifest contains all the metadata needed to specify the assembly's version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly manifest information.

Read http://msdn.microsoft.com/en-us/library/1w45z383.aspx for more information.

2 How to embed additional manifest in a c++ project within VS2010

In VS2010, you can embed an additional manifest file using the project's setting dialog.

vc-manifest-setting[4]

Read http://blogs.msdn.com/b/zakramer/archive/2006/05/22/603558.aspx to know "How does VS 2005 Embed Native Manifest Files"

3 How to embed additional manifest in a C# project within VS2010

A C# project is a msbuild project, and the output module is created by the Microsoft.CSharp.targets.

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

And in Microsoft.CSharp.targets, the manifest can be specified by the Win32Manifest varaiable.

<!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler -->
       <Csc  Condition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true' "
             AdditionalLibPaths="$(AdditionalLibPaths)"
             AddModules="@(AddModules)"
             AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
             ApplicationConfiguration="$(AppConfigForCompiler)"
             BaseAddress="$(BaseAddress)"
             CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
             CodePage="$(CodePage)"
             DebugType="$(DebugType)"
             DefineConstants="$(DefineConstants)"
             DelaySign="$(DelaySign)"
             DisabledWarnings="$(NoWarn)"
             DocumentationFile="@(DocFileItem)"
             EmitDebugInformation="$(DebugSymbols)"
             ErrorReport="$(ErrorReport)"
             FileAlignment="$(FileAlignment)"
             GenerateFullPaths="$(GenerateFullPaths)"
             KeyContainer="$(KeyContainerName)"
             KeyFile="$(KeyOriginatorFile)"
             LangVersion="$(LangVersion)"
             MainEntryPoint="$(StartupObject)"
             ModuleAssemblyName="$(ModuleAssemblyName)"
             NoConfig="true"
             NoLogo="$(NoLogo)"
             NoStandardLib="$(NoCompilerStandardLib)"
             NoWin32Manifest="$(NoWin32Manifest)"
             Optimize="$(Optimize)"
             OutputAssembly="@(IntermediateAssembly)"
             PdbFile="$(PdbFile)" 
             Platform="$(PlatformTarget)"
             References="@(ReferencePath)"
             Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile)"
             ResponseFiles="$(CompilerResponseFile)"
             Sources="@(Compile)"
             TargetType="$(OutputType)"
             ToolExe="$(CscToolExe)"
             ToolPath="$(CscToolPath)"
             TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
             UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
             Utf8Output="$(Utf8Output)"
             WarningLevel="$(WarningLevel)"
             WarningsAsErrors="$(WarningsAsErrors)"
             WarningsNotAsErrors="$(WarningsNotAsErrors)"
             Win32Icon="$(ApplicationIcon)"
             Win32Manifest="$(Win32Manifest)"
             Win32Resource="$(Win32Resource)"
             />

So to specify the manifest file, I change the project file as this:

csharp-manifest-setting[4]


Post by: Jalen Wang (转载请注明出处)

转载于:https://www.cnblogs.com/jalenwang/archive/2012/02/15/assembly-manifest.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值