编辑app.manifest以用于“即时”操作编译程序集 [英] Editing the app.manifest for an "on-the-fly" compiled assembly

查看:87
本文介绍了编辑app.manifest以用于“即时”操作编译程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,我从文本文件中获取代码,将其转换为VBCodeProvider类型,然后根据该代码编译程序集。



一切正常但我需要以管理员权限运行程序集。如果我在Visual Studio中编写应用程序,我可以通过app.manifest中的几行代码指示管理员权限。我不知道在哪里为集会指出这个我在编程我的程序虽然。你能帮帮我吗?



如果有帮助,我正在使用这个项目中演示的编译器代码的变体:

< a href =http://www.codeproject.com/Articles/12852/Compile-and-Run-VB-NET-Code-using-the-CodeDom>项目链接





谢谢,

Stephan

I''m working on a project where I take code from a text file, convert it to the type VBCodeProvider, and then compile an assembly based on that code.

Everything''s working fine but I need to have the assembly run with administrator privileges. If I were writing an app in Visual Studio I could indicate administrator privileges through a few lines of code in the app.manifest. I don''t know where to indicate this for the assembly I''m compiling in my program though. Can you help me?

If it helps, I''m using a variation on the compiler code demonstrated in this project:
Project Link


Thank you,
Stephan

推荐答案

你不能合法地修改它建成后的任何组装。为什么?如果组件已签名(强烈推荐)然后进行修改,则可以保证加载。这是一个重要的安全功能。



顺便说一下,有一些工具可以出于各种原因修改装配。据我所知,他们都反汇编代码,然后重新构建它。



-SA
You cannot legitimately modify any assembly after it was built. Why? And if an assembly was signed (highly recommended) and then modified, it is guaranteed from loading. This is an important safety feature.

By the way, there are some tools modifying assembly for various good reasons. To best of my knowledge, they all disassemble the code, and then re-build it.

—SA


这篇关于编辑app.manifest以用于“即时”操作编译程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆