.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

ServiceKnownTypeAttribute doesn't work

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :WCF
[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple,IncludeExceptionDetailInFaults = true)]
public abstract class CommunicationService : ICommunicationServerSide


 static public IEnumerable<Type> GetKnownTypes(ICustomAttributeProvider provider)
 Type[] res = 
 return res;
 When I try to transmit types, listed in method "GetKnownTypes", service throws exception about serialization. What's wrong?

View Complete Post

More Related Resource Links

When I use 'publish', site doesn't work when i post data


Arrgghh, I am so tired of dealing with stuff like this

I've got a project, when I put up on another server I point two sites in IIS6 to it

i have

http://www.main.com  pointing to the folder the files are in


http://www.anotherofoursites.com/main pointing to that same folder in it's own "Virtual Application" or whatever IIS calls it when you put a folder into it's own 

If I just "Build" and push all the files up.. both work without issue and as expected...  but when I use "Publish" to precompile, the site works until I post, and then i get nailed with:

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.

Ajax Asyncfileupload doesn't work as soon as I put it in a control


Hi guys,

I can't get my <ajax:asyncfileupload> working and I don't see why...

When outside any panel or table it is working well, but as soon as I put it in a <asp:panel> or table I get a strange error which seems to be on client-side but I don't understand what's happen here. Here is the code and code-behind and Javascript.

Here's the error: 


Here's my front-code:

<%@ Page Language="VB" MasterPageFile="~/masterpages/mpSqueletton.master" AutoEventWireup="false" CodeFile="frmAdmGestSocietes.aspx.vb" Inherits="adm_frmAdmGestSocietes" title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
<script type="text/javascript" language="javascript">    
        function uploadError(sender,args)
          document.getElementById("<%= lblStatus.ClientID %>").innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMes

AsyncPostBackTrigger doesn't work on server..


 I am new to asp.net and ajax. I have a problem while using update panel.
I have a tabcontainer with 3-4 tab panels. Inside one tab panel there is a cancel button. What i want to do is to when i hit cancel button in code behind i change active tab index to 0 so that tabcontainer shows first tab panel. I have update panel around tab container. This works at my localhost. But on server its behavior is very random. Sometimes it works sometime it doesn't. Unfortunately I am not able to debug it also. I don't know how to debug code on server. As on localhost it works correctly so I am kind of stuck. 

Asyncfileupload doesn't work in webusercontrol

I'm having a problem with a Webusercontrol that has an asyncfileupload control. My websusercontrol is being loaded in a placeholder control that's wrapped by an updatepanel.Due to asyncpostback, I have to load and clear the placeholder's controls. The webusercontrol works flawlessly, except the asyncfileupload, which doesn't want to upload at all. I can assure that the code is without error, because I used to have the webusercontrol running as an *.aspx site. I guess that the problem is the fact that the control has to be cleared and reloaded with every asyncpostback ?

logoff doesn't work through windows service

Dear Friends, I am facing this problem on Windows 2003 and 2008 Server. On XP it works fine. I have written and Windows Service that takes receives the command and executes tasks such as Logoff, Shutdown, etc. All the commands except Logoff works fine. I tried following ways to perform the Logoff. However it didnt work. Try 1:                 Process.Start("shutdown", "-l"); Try 2:     [DllImport("user32.dll")]     public static extern int ExitWindowsEx(int uFlags, int dwReason);     ExitWindowsEx(0, 0); Try 3:     Process _currentProcess = new Process();                _currentProcess.StartInfo = new ProcessStartInfo("shutdown", "-l -f");                _currentProcess.StartInfo.UseShellExecute = false;                 _currentProcess.Start(); Try 4:     Process.Start("logoff.exe", null); If I write a simple C# based applicatin (not Service) it works fine for all the tries that I have made. I am facing this problem only when I put this code

doesn't work (using IIS 6.0)

HiI'm getting errors with an application on our test web server, which has .NET 4.0 installed, when I input HTML into a form.  I get the usual errors of:A potentially dangerous Request.Form value was detected from the clientThis is being caused by the change in .NET 4.0 that disables switching off automatic validation for HTML input.I can fix this on my local development machine by adding the <httpRuntime requestValidationMode="2.0" /> directive to the <system.web> section of my root web.config, and .NET then honours the <pages validateRequest="false" /> directive that's in the same root web.config.  Strangely, I needed to restart IIS on my local machine (which is version 5.1) for this change to work.When I deploy the root web.config to our test server however, I'm still getting the validation errors.  I've tried using run > iisreset, stopping and starting IIS (which is version 6.0 on the test server), and I've even restarted the server to fully clear out .NET.  My application is definitely picking up the new root web.config (I've tested this), however the <httpRuntime requestValidationMode="2.0" /> directive seems to just be ignored.My application is configured as a  .NET 4.0 application on both my local machine and on the test server.  I've tried rebuilding the a

Workflow doesn't work anymore after renaming list

Hi All, I have created a list with the name "helpdesk test". After testing this list i renamed the list to "helpdesk". I did the rename by the list settings.  To this list i attached some workflows, with Sharepoint designer,  that have to start when a new item is created. All worked fine but after the rename the workflows don't work anymore. When i start the workflows manually from the list all works fine. Is there a way to rename a list and let the workflows work as before? Thanks in advance. Laurens.      

WCF WebGet method doesn't work from browser

I'm trying to operate a WCF Method from the browser, i opened a basic WCF Project and added the Webget attribute, my interface is this: [ServiceContract] public interface IService1 { [WebGet(UriTemplate = "GetData?value={value}", BodyStyle = WebMessageBodyStyle.Bare)] [OperationContract] string GetData(int value); [OperationContract] CompositeType GetDataUsingDataContract(CompositeType composite); // TODO: Add your service operations here } and i'm inserting the following URL in the Browser: http://localhost:3122/Service1.svc/GetData?value=3 i get "The webpage cannot be found" there must be missing something in my configuration , what do i have to add ? this is my configuration : <?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing

Form in iframe doesn't work.

I have put a form into an iframe. It is sent from another website to the php page on the site which has the iframe. Upon clicking the submit button nothing happens. Just a quick flash of the green page load bar. Why is this happening? I have spend hours on this...<%@ Page Language="VB" AutoEventWireup="false" EnableEventValidation="true" CodeFile="adv_links_addbycustomer.aspx.vb" Inherits="users_adv_links_addbycustomer" title="" %> <html> <head runat="server"> <title></title> <script type="text/javascript"> function copy() { var sel = document.getElementById("DropDownList1"); var text = sel.options[sel.selectedIndex].value; // Assigning selected value of DropDownList to a hidden TextArea holdtext.innerText = text; // Creating text range from hidden TextArea's content CopiedTxt = holdtext.createTextRange(); // Copying the text range to clipboard CopiedTxt.execCommand("Copy"); // out = parent.document.getElementById("web_recip"); out = document.getElementById("Textbox6"); out.value = text + "

Redirecting a view doesn't work

I have the following class that I have all my controllers inherit from:  using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Security.Principal; using System.Web; using System.Web.Mvc; using System.Web.Routing; using System.Web.Security; using LMWebUI.Models; using LMWebUI.Components; namespace LMWebUI.Controllers { public class BaseController : Controller { private UserSettings _currentUser = null; private HttpContextBase _currentContext = null; public UserSettings CurrentUser { get { if (_currentUser == null) _currentUser = UserHelper.GetUser(_currentContext); return _currentUser; } } public string CurrentController { get { return Utility.LastSplit(ToString(), '.'); } } public void SaveUser() { UserHelper.SaveSettings(this.HttpContext, CurrentUser); } protected override void Execute(RequestContext requestContext) { _currentContext = requestContext.HttpContext; if (Utility.FixNull(requestContext.HttpContext.Request.QueryString["noScript"], "") == "true") { CurrentUser.ScriptingMode = UserSettings.ScriptMode.NoScript; } else { if (CurrentUser.ScriptingMode == UserSettings.ScriptMode.ScriptDetection && Utility.ReadCookie(requestContext.HttpContext.Request.Cookies, "HasScri

Following instructions to bootstrap .NET 3.5 SP1 doesn't work

I'm trying to use msbuild GenerateBootstrapper task to distribute a .net application with the framework, without the need of internet connection to install it.  I've found many posts that all lead to the same instructions in here: Enable Samesite for the .NET Framework 3.5 SP1 bootstrapper After following the instructions, I still cannot generate the bootstrapper. The more obvious issue I can see is that extracting the files from dotNetFx35.exe does not extract the same list of files and folders than shown on the readme file (for example TOOLS folders are not there). What am I doing wrong? Am I following old instructions?

Type icon doesn't work on SP 2010

Hi guys, as reported in other threads, Type icon in SP 2010 document library doesn't work. I mean that in MOSS 2007 doc library the Type column displays the icon of the document linked to the document itself, so that you can click on it to open the document. Otherwise, in MOSS 2010, the icon doesn't contain any link at all. This is true only for documents, while it works for folders. This behaviour is in MOSS 2010 RTM. Does anyone know any info about this problem? Thank you in advance.  

Default value NEWSEQUENTIALID() doesn't work in VS

I have a column in my .mdf file with the 'uniqueidentifier' datatype. I would like to have it set by SQL Server Express automatically. There are articles on the web that recommend using one of the following commands as the default value:NEWID()NEWSEQUENTIALID()I put this in VS 2010 column properties of my table, in Default Value or Binding. The first command works fine but the second turns out showing an error message 'error validating the default for column xxxx'Any advice on this? I'm I missing much using the first command?Amin

creating a new cpp file doesn't work when start debugging

Why is it that when i add a new cpp file in my project and then run it, the file doesn't work...what i see is the output of the main cpp file...any help re this will be very very much apppreciated, coz i am really a beginner in Visual C++ Programming.  By the way, I am using Express edition 2008.

Windows explorer view doesn't work on Windows 7

We are running Office SharePoint 2007 with SP2 on windows 2003 server. All windows 7 with IE 8 gets this message: " Please wait while Explorer View is loaded. If Explorer View does not appear, your browser may not support it". when click Windows Explorer in View. All Vista and XP work fine. I have tried these: 1. Added the SharePoint site on a Trusted Site. 2. Web Client is set to Automatically start, and that it is started. 3. We have Office 2003 installed on all computers. 4. We also tried to enable Comtability View. Is there a fix?Bob Lin, MS-MVP Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net How to Setup Windows, Network, VPN & Remote Access on http://www.howtonetworking.com

Custom field type - set value doesn't work when field is hidden

Hi, I have a simple custom field type which gets a value from the Property Bag and sets that value to a label. This works fine as long as the field is set to Optional (the field is a site column and is part of a site content type), but if I set it to Hidden, the value doesn't get set. public override void UpdateFieldValueInItem()         {             this.EnsureChildControls();               if (this.ControlMode == SPControlMode.New)             {                 this.Value = GetChosenConsole();             }         }   Does anyone know why this is and what I need to do in order for it to work even though it's hidden? Thanks!

SPD Workflows - Assembly redirection doesn't work

Hi, I'm migrating a solution from MOSS2007 to SharePoint 2010. I have, among others, custom workflow actions in a DLL deployed to the GAC (e.g. MyWorkflows.dll version My new solution contains new workflow actions that target the SharePoint 2010 API (e.g. MyWorkflows.dll version So what I'm doing is: - Creating a workflow in SPD in a MOSS2007 environment. Such workflow contains one of my custom actions. - Upgrading the environment to SharePoint 2010. - Removing the WSP package containing my files/DLLs that targeted MOSS2007 and deploying a new WSP containing the solution files that target SharePoint 2010. - Add assembly redirection entries in the web.config file of my web application, so that calls to MyWorkflows.dll get redirected to MyWorkflows.dll version (I also add other redirection entries regarding other stuff - for example, webparts). - Reset IIS and OWSTIMER.   After that I can see that the old webparts work fine (the assembly redirection seems to work for them). However, when I try to run a workflow (manually, from the browser) it doesn't work. I get the following error in the ULS log: Microsoft.SharePoint.SPException: <Error><CompilerError Line="15" Column="3" Text="Could not deserialize object. The type 'MyWorkflows.MyActivity' could not be resolved." /></Error>   &nbs
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