在具有多个项目解决方案的项目中添加ReportViewer控件 [英] Adding a ReportViewer control in a project with multiple project solutions

查看:74
本文介绍了在具有多个项目解决方案的项目中添加ReportViewer控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在VS2008中具有多个Web应用程序项目的解决方案.所有项目都使用一个位于主项目内部的web.config文件.我已将ReportViewer控件添加到项目中没有web.config文件的ASPX页面中.默认情况下,VS2008将一个新的web.config添加到该项目中.我不要这个web.config文件.我可以在主web.config文件中包含这些条目(用于ReportViewerWebControl.axd的HTTP处理程序),然后运行该应用程序.

即使我删除了这个新的web.config文件,VS2008项目仍将其重新添加回去.有没有解决此问题的方法?

对于Reportviewer控件,即使删除后web.config文件也不会消失.有没有一种方法可以配置不包含web.config文件的项目?

任何解决方案,代码或链接都将有所帮助....

谢谢,
Vijayraj

I have a solution with multiple web application projects in VS2008. All projects use a single web.config file which is inside the main project. I have added a ReportViewer control to an ASPX page inside a project that dose not have a web.config file. By default, VS2008 is adds a new web.config to this project. I don''t want this web.config file. I can include these entries (HTTP handler for ReportViewerWebControl.axd ...) inside my main web.config file and run the application.

Even though I am deleting this new web.config file, the VS2008 project is again adding it back. Is there a workaround to this issue ?

For the Reportviewer control, the web.config file is not going away even after deleting. Is there a way to configure a project not to include a web.config file?

Any solution, code, or link will be helpful....

Thanks,
Vijayraj

推荐答案

1.编译解决方案.
2.如果找到创建的Web.config文件,请手动将其删除.
3.运行该应用程序.

此外,这必须在开发/调试模式下发生.如果将其托管在IIS中,则不会发生这种情况.删除它后,便可以成功运行它.
1. Compile the solution.
2. if you find the Web.config file created then delete it manually.
3. Run the application.

Further, this must be happening while development/debug mode. If you host it in IIS then this would not happen. Once you remove it, you can run it successfully.


嘿,

如果使用相同的虚拟路径,则创建新应用程序没有任何意义.让我解释一下,

假设您有一个Web应用程序A,B和C.

您将它们全部放置在文件夹"Main"中,并将web.config放置在其中.

的确,如果未在其中定义任何web.config,则所有应用程序A,B和C都将使用此web.config,但这确实有意义.您可以创建1个单个Web应用程序,并将所有其他网站作为文件夹放置在同一文件夹中(如果您不想一次全部存储,也可以在编译时排除).

这将使您的工作更加轻松,因为Visual Studio能够自动将必需的配置节添加到web.config中.否则,发布时您需要自己正确地合并它们.

当所有应用程序都在相同的目录结构中并且使用相同的web.config时,创建单独的应用程序没有任何意义.我认为,仅当应用程序具有单独的设置和/或使用不同的应用程序池时,才是分离应用程序的理想选择.

无论如何,如果您仍然希望运行3个不同的应用程序,则需要在web.config的报告配置"部分中运行它.您可以将整个文件夹结构添加到Visual Studio解决方案中,并且您的Web应用程序将使用web.config父级.
Hey,

It is of no meaning of creating a new application, if you are using the same virtual path. Let me explain,

Say you have a web application A, B and C.

You place all of them in a folder "Main" and place your web.config there.

It is true, that all the applications A, B and C will be using this web.config if no web.config is defined within them, but does it makes any sense. You could have created 1 single Web Application and place all other web sites as folders within the same, (and also you can exclude while compiling, if you dont want all at a time)

This will make your work easier, as Visual Studio has the capability to add necessary config sections to web.config automatically. Otherwise you need to merge them properly yourself when you publish.

It doesnt make any sense to create separate applications when all of them is in the same directory structure and using same web.config. I think it is ideal to separate applications only when they are having separate settings and/or using different application pool.

Anyway, if you still like to run 3 different applications, you need the Reporting config section to your web.config to run it. You can add the whole folder structure to your visual studio solution, and your web applcation will use the web.config parent to it.


这篇关于在具有多个项目解决方案的项目中添加ReportViewer控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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