IIS Configuration :: Cannot Add Duplicate Collection Entry Of Type Add With Unique Key Attribute Name
Apr 21, 2014
when i hosted my page in a previously maintained project i got error like http error 500.19 the requested page cannot be accessed because the related configuration data for the page is invalid.config error:cannot add duplicate collection entry of type 'add' with unique key attribute 'name''
I am seeing Fire with this error, i tried to google and did my all but i failed to resolve it my self. i tried all the examples, used the remove on my web config to remove the so called duplicate key. I am using IIS 7 on Windows Server 2008 and when i run my app , i get the following Error and my webconfig looks like this [URL]
Server Error in '/' Application. --------------------------------------------------------------------------------
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2379; ASP.NET Version:1.1.4322.2379
I am trying to deploy my site from my computer to my server and I am getting the next error.
Server Error in '/Fleet' Application.
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. review the specific error details below and modify your configuration file appropriately.
I'm trying (SQL Server Compact) to add primary key constraint on existing table that has some rows in it. While adding primary key I'm getting the error:
"A duplicate key cannot be inserted into a unique index"
I have a collection of Contacts that inherits from CollectionBase:
public class ContactCollection : CollectionBase{ //... }
each contact in the collection has a unique ID:
public class Contact{ public int ContactID{ get; private set; } //... }
I think what I would like to do is something like the following:
// get the contact by their unique [Contact]ID Contact myPerson = Contact.GetContactById(15); // get all contacts for the customer ContactCollection contacts = customer.GetContacts(); // replaces the contact in the collection with the // myPerson contact with the same ContactID. contacts.ReplaceAt(myPerson); // saves the changes to the contacts and the customer // customer.Save();
Is it possible to setup the CreateUserWizard to check for a duplicate entry in the aspnet_profile table (for a custom field) before the new user is created? For example, if I added a phone number field and wanted to make sure nobody else could create an account using that same phone number if a user already has an account with that phone number in the aspnet_Profile table's PropertyValuesString row?
I'm creating a control based on ScriptControl, and I'm overriding the Render method like this:
protected override void Render(HtmlTextWriter writer) { RenderBeginTag(writer); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("This is a test."); writer.RenderEndTag(); RenderEndTag(writer); }
My question is, what if I want to assign the div an ID attribute and have it be unique on the page, even if there are mulitple instances of my control?
That will prevent naming conflicts between instances of my control, but what if I've already created a div elsewhere on the page that coincidentally has the same ID?
I've also heard about implementing INamingContainer. Would that apply here? How could I use it?
UPDATE:
I've worked around this by overriding CreateChildControls and adding actual controls, as opposed to rendering HTML directly. In that case INamingContainer does its job. However, I'm still curious if there's a way to solve my original problem (unique IDs for directly rendered elements).
Wat i did is in the first header of gridview dropdownlist i have binded the PO Item , so that user can select item n make invoice...
Here the problem is user will click addnewrow button to create new row second row , again user is able to select the same item what he selected in first row of gridview. here how to avoid duplication in the second row .
Say i have four PO item
Item1,Item2,Item3,item4
user may select Item1 in first row , after clicking addnewrow button user will get second row
here again user is able to select Item1 from dropdownlist ... how to avoid duplicate selection
coz the dropdownlist is binded from database using sqldatasource n filter based on user selected PO no.
Duplicate Item selection should be removed until all the four item is selected ...
i'm trying to host an .net framework4.0 application in IIS7. i got an error while clicking on the manage module in modules .like ("Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive. ") .I changed my application poll to .net4.0.I am able to browse my application
I installed Microsoft Visual Studio 2010 Ultimate Trial and converted existing asp.net 2.0 web application and I am getting this error: znrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive. It's coming from this section in the web.config which was auto-generated by VS2010 when I converted the project:
How can i add same fields for columns in a datatable. I wan to make a datatable which repeate column name of same type multiple times, but dot net dont allow me to add that, but i want to do that hw can i do that?
I developed a site for a client a couple of years ago. It uses the the standard ASP.NET Membership, authentication, etc. I just added the profile section with (2) fields: CustID AgntID. Now whenever I load the page with any Profile code in it I receive this error: Violation of UNIQUE KEY constraint 'IX_aspnet_Users'. Cannot insert duplicate key in object 'dbo.aspnet_Users'. The INSERT statement conflicted with the FOREIGN KEY constraint "FK__aspnet_Pr__UserI__3CA9F2BB". The conflict occurred in database "broo001", table "dbo.aspnet_Users", column 'UserId'. The statement has been terminated. The statement has been terminated. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'IX_aspnet_Users'. Cannot insert duplicate key in object 'dbo.aspnet_Users'. The INSERT statement conflicted with the FOREIGN KEY constraint "FK__aspnet_Pr__UserI__3CA9F2BB". The conflict occurred in database "broo001", table "dbo.aspnet_Users", column 'UserId'. The statement has been terminated. The statement has been terminated. Source Error:
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'hcgames.ObjectClasses.ShoppingCart.ShoppingCartCartAddon'. An explicit conversion exists (are you missing a cast?)
From this query
ShoppingCartItems items = Cart.GetAllItems(); ShoppingCartCartAddons addons = Cart.GetAllAddons(); var stuff = from x in items select new ShoppingCartItem() { ProductID = x.ProductID, Quantity = x.Quantity, Name = x.Name, Price = x.Price, Weight = x.Weight, Addons = (from y in addons where y.ShoppingCartItemID == x.ID select y) };
<NEWBIE to configuration> I attempted to update a .dll from a 1.1 project to a bin directory and received the following error
Dllname was loaded, but eh DllRegisterServer or DllUnregisterServer entry point was not found. Dllname may not be exported, or a corrupted version of Dllname may be in memory. Consider using Pview to detect the file and remove it.
I do not have the option of using Pview. I have attempted stopping iis then try remove and restarting server. What other options do I have to delete the dll, or reregister the new dll??
How can I create a UserControl with a collection-type property which has a collection editor?
I've a CompositeControl with an ArrayList-type property which has CollectionEditor-type designer. You can see this property on Properties window with a "..." button which launches a collection editor. This works fine and all but I want to apply the same to a UserControl and I've couldn't manage to pull it off so far. I've done the same thing what I've done with my CompositeControl but the property either doesn't even show on Properties window of the UserControl or shows as a single value property with no "..." editor button.
I have created a WCF Rest API Service using wcf rest starter kit preview 2 which automatically return JSON or XML data depending on the requested content type. everything is working fine but as my service methods return multiple data type some methods returns a object of a class or collection of class, bool, int or collection type. so I planed to return a same Response in all methods for this I Create a new class as following:
[DataContract(Namespace = "")] public class ServiceResponse { [DataMember] public bool IsError { get; set; } [DataMember] public string ResponseMessage { get; set; } [DataMember] public Object ResponseData { get; set; } }
and User class as following:
[DataContract(Namespace = "")] public class User { [DataMember] public string UserName { get; set; } [DataMember] public int UserID { get; set; } }
In ServiceResponse Class I have declared an Object Type property ResponseData and my all method has return type of ServiceResponse. My problem is that when I set any string,bool,int type as ResponseData it is serialized but when I set collection type or an object of another class which also has DataContarct attribute this class is not serialized see below code :
public ServiceResponse GetUser(int userID) { User user = getUser(userID); get user data from database ServiceResponse response=new ServiceResponse(); var response = new ServiceResponse { IsError = false, ResponseMessage = string.Empty, ResponseData = user; // Setting Result Data here }; return response; }
when I called above method(GetUser) I got Null response due to serialization problem, but following code works fine
public ServiceResponse TestMethod(string testMessage) { ServiceResponse response=new ServiceResponse(); var response = new ServiceResponse { IsError = false, ResponseMessage = string.Empty, ResponseData = testMessage; // Setting Result Data here }; return response; }
I've got a subweb as application. It's called ADMIN. It works fine when running locally but when deploying in the development web server, i got the error: Unable to cast object of type 'System.Web.HttpApplication' to type 'Microsoft.Practices.CompositeWeb.WebClientApplication'
I've got a App_global.asax.dll and App_global.asax.complied on the subweb folder Admin.
Specifically we're making our application compatible with the Out Of Process Session State server where all types saved in session must be serializable. Is there a way to see at compile time that any type put into HttpSessionState is marked with the Serializable attribute. Something along the lines of this 'non-valid' code
public static void Put<T>( string key, T value ) where T : IsMarkedWitheSerializableAttribute { HttpContext.Current.Session[key] = value; }
My Grid is bound to a collection type datasource. When I try to sort the Columns in the Grid I get Javascript error saying sorting event not implemented. Why is the default inbuilt sort functionality not working which worked fine when I directly used a sqlDataSource using smart tag. Do I have to write some code to achieve sorting ?