I got these dlls in gac then why I got them in web.config as well,
<compilation debug="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=removedForPrivacyMyself"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=removedForPrivacyMyself"/>
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=removedForPrivacyMyself"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=removedForPrivacyMyself"/>
</assemblies>
</compilation>
My application seem to work fine when i remove this section
These are just stored in the config file by default. It also means that you do not need to provide a
using System.Web.Extensions;
etc. in every source file.
During compilation, the compiler will use the <assemblies> section to figure out which assemblies to add into the compilation process. If you do put usings everywhere then indeed this section adds nothing.
Your web application project properly using those assemblies in the reference definition.
You can remove them, but remember if you going to use one of those assemblies your web application won't work.
Usually the visual studio add them automatically your web.config
Related
I'm trying to convert my application from .NET 2.0 to 4.5.1 but I got the with the run time version of my application.
Could not load file or assembly '...dll' or one of its
dependencies.This assembly is built by a runtime newer than the
currently loaded runtime and cannot be loaded.
How can I can get rid off this?
Did I forgot something to add or modify on my Web.config?
The process of publishing the application is through local and the published files will be copy paste on the application server in Virtual Machine.
I just solved the issue by publishing the application locally in VS2013,get the published version and add & modified the web.config of the application server instance with the ff:
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="[myDllname].Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<system.web>
<globalization uiCulture="auto" culture="auto"/>
<customErrors mode="Off"/>
<pages validateRequest="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<controls>
<add tagPrefix="csla" namespace="Csla.Web" assembly="Csla, Version=3.0.3.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30"/>
</controls>
</pages>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" targetFramework="4.5.1">
<assemblies>
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
<identity impersonate="true"/>
<authentication mode="Windows"/>
</system.web>
Just make sure that the target framework is in compatible mode. In my case, I'm using old CSLA version.
I have a ASP MVC Project which I didn't make but I need to upload it on a IIS server. This works but when I upload it and visit the website I get this error:
Could not load file or assembly 'Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Everything works locally but not on the server. Things I tried already:
Repairing .NET Framework
Trying to remove 2 lines from .NET Framework webconfig (Located in: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config) file but can't because file is in use. Can't stop process because of Access Denied error
I found that removing these 2 lines might be a solution but I can't remove them:
<remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Is there something I am missing? Any help is much appreciated! Thx
Try adding just this line to your site web.config. The config files are inherited from the .NET base up to you site and then folders in your site. So Your site will override the .NET framework config.
<remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
EDIT
The line should go here...
<configuration>
<system.web>
<compilation>
<assemblies>
<remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
</system.web>
</configuration>
It should be noted that all that junk in the assembly attribute more than likely needs to be identical to the one that adds it in the .NET framework config.
The Razor intellisense stopped working in one MVC 4 project, and one project only on my pc. I use Visual Studio 2013 Professional. I know this is an issue that has happened to a lot of people before me. I've tried many possible solutions, but the one that works for me has not been there yet...
A list of what I tried so far:
Delete the temporary .suo file
In tools->options check Auto list members
Remove the project from the solution and add it back
Create a new Visual Studio MVC project and copy the web.config file
Delete old Visual Studio 2010 settings in AppData/Roaming/Windows/Visual Studio
Change MVC version in web.config file in Views folder
Clean the solution, exit VS, reopen it and rebuild entire solution
Unload and reload the project within the solution
and probably I tried more which I can't remember right now. Does anyone have another solution/tip to solve this?
Suggested answers for this post which didn't work either:
Repair Visual Studio and reinstall ASP .NET MVC
I've faced same kind of problem with different causes and solved as follow:
web.config in all views folders: I got a correct version of web.config creating a new Area in my project and using it in other view folders
Feature … cannot be used because it is not part of the ISO-2 C# language specification generally these kind of errors does not block compilation, but could be very annoying. To solve this error I've added this segment in web.config (or in app.config if your project is not a web project)
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<!-- ASP.NET 4.0 Assemblies -->
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
local assemblies: sometimes, when I've used external assemblies (for helpers e.g.) I've had to check for Copy Local = true in Project references.
In all cases It could be needed to close/reopen VS to get the modification applied.
hope it helps
I have a web project in visual studio 2012 that I am working with over an ftp connection. I am getting the error that the Linq does not exist in the namespace System.Data and Linq does not exist in the namespace System. Visual studio displays an error and will not give code suggestions, however, the code runs fine on the IIS server.
My web.config contents are below.
I have read over the many questions and articles on this problem and was still unable to find a working solution.
<system.web>
<compilation debug="true" strict="false" explicit="true" urlLinePragmas="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.Services.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Data.Linq"/>
<add namespace="System.Linq"/>
<add namespace="System.Xml.Linq"/>
</namespaces>
</pages>
Try to manually add the reference to System.Data.Linq in your project.This should hopefully resolve your problem.
Project -> References -> Add reference -> System.Data.Linq
This comes a little late, but in the interest of "giving back"..... When I had this issue (VS 2010 running website through IIS), I had to change the target framework to something else, save the changes, and then change it back to v 4.0 (the original my project was built with). (Right-click Project -> property pages -> Build -> "Target Framework"). That cleared up the issue. Not sure how or why. =)
In Visual Studio, check that the project is targetted to a version of the .NET framework that includes Linq. Right click on the project, then look for the Target Framework option. If this is set to v2, everything else that VS tells you will be based on v2 - the available assemblies, the versions of the base class library assemblies, etc.
This happens to me when I upgrade from VisualStudio 2013 to 2015.
I encounter to these errors while the Project build doesnot comes to the end and stops after some warnings. I resolve these warnings, and when I solve the last warning:
Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=11.0.0.0, . . .
the error:
the Linq does not exist in the namespace System
get solved.
I am building a dummy WCF REST service just for purposes of learning how it works (preparing for real service build). I have the REST service working and responding with both JSON and POX formatting. However, I cannot get the routing solution to work in order to eliminate the ".svc" file. I am using VS 2010, WCF 4.0 and IIS 7.5 on Win Server 2008 R2.
Right now the URL works as: "/api/rest/rest.svc/json/myMethod" but I want to just have "/api/rest/json/myMethod". I have found numerous articles here on SO and elsewhere which claims to remove the ".svc" file. I believe I have it setup as instructed, but the project will not build because of an error in the Global.asax file.
It says to add the following to the Application_Start function:
RouteTable.Routes.Add(new ServiceRoute("", new WebServiceHostFactory(),
typeof(RestService)));
I also added the following to the web.config:
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule"
type="System.Web.Routing.UrlRoutingModule,
System.Web.Routing, Version=4.0.0.0,
Culture=neutral,
PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<add name="UrlRoutingHandler"
preCondition="integratedMode"
verb="*" path="UrlRouting.axd"
type="System.Web.HttpForbiddenHandler,
System.Web, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
I also added the aspNetCompatibility lines to the web.config and above the class in the svc.cs file.
Th issue is that I can't even get the project to build. When I add the RouteTable.Routes.Add line to the global.asax and build it, I get the following errors:
The type
'System.ServiceModel.Activation.ServiceHostFactory'
is defined in an assembly that is not
referenced. You must add a reference
to assembly
'System.ServiceModel.Activation,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'.
The type or namespace name
'ServiceRoute' could not be found (are
you missing a using directive or an
assembly reference?)
Any ideas why this is failing?
make sure that "System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" is referenced in the project, if it is make sure to add this to the web.config file as well. – Joakim Mar 25 at 19:03