global.asax 和 Web 部署项目的编译器问题
我对一个使用 Web 部署项目进行部署的 Web 应用程序项目做了一场噩梦。
无论出于何种原因,如果我允许预编译 Global.asax (和 Global.asax.cs)文件,则事件永远不会触发。
因此,我将全局文件的构建操作设置为内容 - 始终复制。问题是当我尝试构建部署项目时,我收到一条错误消息:
可以加载类型“.Global”。
任何人都可以给我任何指示,这个问题已经困扰我们几个星期了 - 这看起来太荒谬了!
谢谢 铝
I'm having a nightmare with a Web Application project which I'm using a Web Deployment project to deploy.
For whatever reason, if I allow the Global.asax (and Global.asax.cs) file to be pre-compiled the events never fire.
So, I set the Build Action of the global files to Content - Copy always. The problem is when I try to build the deployment project I get an error message:
Could load type ".Global".
Can anyone give me any pointers, this problem has been killing us for weeks now - it seems so ridiculous!
Thanks
Al
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个 Webforms 应用程序还是一个 MVC 应用程序?
您是否尝试过使用 aspnet_compiler 工具来查看详细的输出?也许您可以在那里看到一些输出中未显示的内容。
以下链接可能对您有帮助: http://www.asp.net/web-forms/tutorials/deployment/deploying-web-site-projects/precompiling-your-website-cs
你可以吗尝试创建一个新的单独项目,并将 global.asax 和 global.asax.cs 文件添加到该新项目中,然后尝试发布它?如果有效,也许您的项目有问题?
最后但并非最不重要的一点是,您可以检查是否有多个名为 Global 的类,也许该网站没有验证这一点。
如果有效,请告诉我们。
Is this a webforms app or an mvc app?
Have you tried to use the aspnet_compiler tool to see the detailed output? Maybe you can see something there, that is not presented on the output.
Here is a link that might help you: http://www.asp.net/web-forms/tutorials/deployment/deploying-web-site-projects/precompiling-your-website-cs
Can you try to create a new separate project, and add the global.asax and global.asax.cs files to that new project, and try to publish it? If that works, maybe there is a problem with your project?
Last but not least, can you check if there are more than one class called Global, maybe the website is not validating that.
Please let us know if it works.