Why does the VS compiler complain that it did not detect the assembly when using the attached configuration files, but the ASP.NET mechanism in IIS has no problems?

I am looking at web.config right now in ASP.NET WebForms.NET 3.5, which has broken all the basic configuration files, for example:

<configuration> <system.web> <membership configSource="config\membership.config"/> <authentication configSource="config\authentication.config"/> <machineKey configSource="config\machineKey.config"/> <compilation debug="true"> <assemblies> <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> </assemblies> </compilation> <customErrors mode="Off"/> <authorization> <deny users="?"/> </authorization> <roleManager enabled="true" cacheRolesInCookie="true"/> <pages configSource="config\pages.config"/> <httpHandlers configSource="config\httpHandlers.config"/> <httpModules configSource="config\httpModules.config"/> <webServices> <protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols> </webServices> </system.web> </configuration> 

and if I compile the source in VS 2010, it complains that it could not find the .NET DataVisualization library ( Error 14 Could not load file or assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. sourcecodefile line ), and if I compile it using aspnet_compiler or just drop it in IIS, everything will be fine.

How can I stop this in VS?

Do I need to return these configuration settings to the web.config file?

Casini has no problems with this configuration or with the IIS dev server, and the file is NOT in the GAC (and not version 3.5, anyway, 4.0), and I won’t get it there for this one problem (I will transfer everything back to the web itself .config), and the dll file is in the bin folder.

+4
source share
1 answer

You need to add a reference to the System.Web.DataVisualization assembly in your Visual Studio project. Visual Studio does not compile for assemblies not listed in the Links folder.

In the solution explorer in your project, right-click on the Links folder and click on Add Link ...

enter image description here

Select and add the missing assembly.

enter image description here

The problem is resolved.

+1
source

Source: https://habr.com/ru/post/1392108/


All Articles