[英]Create an EVENT SOURCE using web setup project
I am developing a website using MVC 3, 我正在使用MVC 3开发网站,
I have a web setup project for installing it to my localhost. 我有一个Web安装项目,用于将其安装到本地主机。
Now what I want is to create an EVENT SOURCE ( where I will later on log using my website ) using this very setup. 现在,我想要的是使用此设置创建一个事件源(稍后将在其上使用我的网站进行记录)。
Is this possible? 这可能吗?
I have been following this link: http://msdn.microsoft.com/en-us/library/ms998320.aspx#paght000015%5Feventlogaccess 我一直在关注此链接: http : //msdn.microsoft.com/zh-cn/library/ms998320.aspx#paght000015%5Feventlogaccess
I earlier tried creating an EVENT SOURCE programmatically, but my web app threw security exceptions, similar to the error the user in this post was getting: System.Security.SecurityException when writing to Event Log 我之前曾尝试以编程方式创建EVENT SOURCE,但是我的Web应用引发了安全异常,类似于本文中用户遇到的错误: 写入事件日志时出现System.Security.SecurityException
Thanks in advance Yasser 在此先感谢Yasser
After a lot of struggle I myslef managed to answer my question 经过多番努力,我myslef设法回答了我的问题
I first had to create a seperate installer class, which had code to install an event source. 我首先必须创建一个单独的安装程序类,该类具有用于安装事件源的代码。
Next in my web setup project, under custom action in INSTALL, I simply added the output of the above project which was a single dll. 接下来,在我的Web安装项目中,在INSTALL中的自定义操作下,我仅添加了上述项目的输出,即单个dll。
and thats it! 就是这样!
Now whenever my web setup runs, the installer dll is also activated and run and my event source gets created. 现在,每当我的Web安装程序运行时,安装程序dll也会被激活并运行,并创建事件源。
Now that was not too difficult was it ? 现在那不是很困难吗? ;) ;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.