且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在具有多个项目解决方案的项目中添加ReportViewer控件

更新时间:2023-12-05 23:51:04

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.