2

I've a Visual Studio 2012 solution that consists of two projects: MVC Web App and Windows Application.

In the MVC Web App, users create some scheduler tasks, which are added to a database table. Because of security, I cannot run it as administrator (right-click VS 2012 and run as administrator).

In order to create the scheduler tasks in the Windows Task Scheduler, I created a second project (Windows Application) in the same solution. This app will create/update/delete scheduler tasks in the Windows Task Scheduler by getting the data from the MVC Web App.

Is there a way to run the second project, instead of the entire solution, as administrator? Or do I have to create the Windows Application or Windows Service in a separate solution? If so, what would be the best way to detect changes in the database table? SqlDependency, Change Data Capture, or something else?

Thanks for any pointers.

4

1 回答 1

1

您需要将所谓的 AppManifest 添加到项目中。您可以通过右键单击项目并选择“添加新项目”选项来执行此操作。弹出窗口到达后,选择“应用程序清单文件”。

一旦将其添加到项目中,您需要对其进行调整以具有以下行

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
于 2013-11-12T16:07:20.050 回答