.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Assembly entries in Web.Config were adding automatically and now they are not?

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
Hi all,    A while ago when i started using VS 2005, i found that some assembly entries were automatically added to from web.configand i was getting annoying errors. later i found i have added unneccessary references in my application. And its a feature that assembly reference are automatically added to assembly tag in Web.config, So dev don't have to worry about it.    Recently i used Interop.OWC11.dll in my application. And ^&*# got the annoying "CS0234: The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)"error again.. Assembly entry was not added automatically. I checked same for existing references in my application, for them to automatic entries is not happening.... ? :(     I have to write is down in Web.config manually... I don't understand why?....Tried to find resources on net for this issue, didn't found any relevant ones.. Please can anyone explain me why this is hapennig?....

View Complete Post

More Related Resource Links

Sharepoint Site Web Config elements Gets Deleted automatically


see i used to have a security filter settings in web config
security><requestFiltering><requestLimits maxAllowedContentLength="104857600"/></requestFiltering></security>
 but it gets deleted automatically after  i dont know why 
we tried to install something in our server yesterday it didn't worked and reverted it back to yesterdays stage( But i had updated the config files 3 weeks ago) 
but today i check the config files  these elements are  not there.

My system is 64 bit windows server 2008 with IIS 7 and MOSS 2007 SP2

"Mixed mode assembly is built against version 'v2.0.50727'.... " issue and use custom config file

Hi, My Winform applilcation has used Microsoft.SqlServer.Management.Common namespace(assembly :Microsoft.Sqlserver.smo.dll/Microsoft.Sqlserver.ConnectionInfo.dll) and developed in .NET 4.0. Problem:Application is throw an exception when it tries to use above assembly reference methods. Full error text is shown below, "Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. " Error is resolved when we include "app.config" file with below code, <?xml version="1.0"?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> </configuration> But, I need to keep configuration file as "renamed.config" and not to include app.config file as of the project requirement.I have set configuration file as "renamed.config" file using below code, //AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "d:\\reanmed.config" ); I have also included <Startup> element in this "renamed.config" configuration file and removed the app.config file.But it raise me below error, it always expect app.config file with <Startup> element to resolve this iss

web.config - adding css friendly adapters to existing website

Hi Forum,  Please help me with the major headache I've wasted hours trying to figure out!  I have done everything explained in the tuturial to add css friendly adaters to an existing site and still no luck.  I am thinking that it has to do with modifying my current web.config file to use the css adapters.  Problem is, I can't find any specific instructions as to what I have to do to the current web.config file to make the site compatible with the css adapters!  I tried to modify the config file based on what on the example, but nothing seems to work.  Any help would be greatly appreciated!  Thanks, D

ApplyWebConfigModifications() adding old entries/caching

Hello,   I've searched the web high and low for an answer to this, but nothing. I have a simple Safecontrol being added to my web.cfg within a custom action in an MSI installer. The code to write the actual Safecontrol is now commented out and this problem i have is still happening. So it cant be anything to do with that section of code.   The only two lines remaining from the whole code is: <SPWebServiceObj>.Update(); <SpwebServiceObj>.ApplyWebConfigModifications();   In that order. When i began to build this section of code (the safe control entry), i used a 'test string' safe control entry (not the actual line i required for my assembly) '<Safecontrol Assembly="test, version=" namespace=test/>' - My problem is not with any Syntax. This is an example of a short test entry i was using.   After i ran this and the entry was added to the config, I then found all attribute values for my assembly entry and re-wrote the section of code accordinly.   Re-ran the code after resetting web.cfg file.  I was amazed to see my test string entry added again - ASWELL as my new assembly entry. It seems the ApplyWebConfigModification method is storing old values some how. When i run those two lines of code above, both my assembly and the test string are added to the web.cfg file.Even though my 'SPWebConfigModification' objec

studio 2008 adding classes missing assembly

Classes were copied into  to the project. The classes had already been written. Studio cannot find them. they are all (now) in the rrot of the project

.NET 3.5 built Mixed mode assembly unable to load in .NET 4 (even after using app config) without .N


I am trying to run a .NET 3.5 built mixed mode assembly in .NET 4. I was able to do that by adding an app config file with the following content:

<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
The problem is that I used an XP machine and installed .NET 4 on it (without any other previous versions of .NET). When I tried to run the same thing, it gives me an error saying it is unable to load the assembly in .NET 4.

Any idea why this is still depending on .NET 3.5?

"This assembly is too new"- WCF Service Config Editor


Hi Folks,

I'm trying to use the WCF Service Configuration Editor (SvcConfigEditor.exe) to setup my endpoints for a WCF service...
When I try to chose an assemblly in the editor (to setup the data contract) I get this error:

"This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."

My assemblies are built on the  .Net framework 4.0...
So I though that maybe i had a old version of this tool...and that it only recongnized .Net 3.5 assemblies...
So, I download the latest Windows windows SDK (Microsoft Windows SDK for Windows 7 and .NET Framework 4) and when I run the tool, I get the same error.....

Any ideas on what is causing this error, and how to overcome it?

(As an aside, why isn't the WCF Service Configuration Editor lauchable directly from Solution Explorer, by right cliking the Web.config file in an WCF Service Application Project.... It does for App.Config files in other WCF projects... this appears like an oversight by Microsoft...)

- Andy

apps automatically using machine.config


I have connection strings info in web.config.  I thought that if this were the case, machine.config would be ignored.  But, everytime the connection string in web.con is different than the connection string in maching.con, I get error......

The connection name 'aspnetdbConnectionString' was not found in the applications configuration or the connection string is empty.

Is there something I can check or change to get the app to ignore the machine.config when web.config connection string is listed.

Intellisense not working for assembly registered in global web.config


I made a custom server control library that all of our websites will be using. I have registered the dll in the global web.config of our production and development servers, and everything builds and runs fine. The only problem I have is Visual Studio/Intellisense not recognizing my control. I get the error message "Unknown server tag...", which in turn throws other validation warnings. Does anyone know how to tell Visual Studio to include dll's registered in this location?

Our sites are .net 4.0 and below is an excerpt from the web.config located in %SystemDrive%\Windows\Microsoft.NET\Framework\v4.0.30319\Config on the servers.



    <add assembly="[assembly info]" tagPrefix="irnrControls" namespace="IRNR.Controls"/>



It's not that big of a deal right now as I only have one control in the dll, but I would like to fix this before I add more controls. Thanks in advance.

Unable to remove web config entries when using Supplemental .config



I'm using  Supplemental .config for add an httpmodule to the web.config in Sharepoint 2010. I use a feature receiver to push the entry from   Supplemental .config to the web.config. 

But I couldn't figure it out how to remove the entry as otherwise it adds the entry over and over again when ever I deploy the feature. 

Here is the Supplemental .config.

<?xml version="1.0" encoding="utf-8" ?>


    <add path="configuration/system.webServer/modules">      

      <add name="ABC404HttpModule" type="ABC.Internet.Business.HttpModules.ABC404HttpModule, ABC.Internet.Business, Version=, Culture=neutral, PublicKeyToken=9e85b319f306f692" />



I tried to use remove node without any success. May be I don't know how to use it correctly.

Thanks in advance. 


Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Adding Rows in GridView without using a Database

This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

Adding Dynamic Rows in GridView with TextBoxes

I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Adding Dynamic Rows in GridView with TextBoxex in C#

I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend