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


Post New Web Links

'VisualBasicValue' is not of type 'Receive'. When loading this instance you must ensu

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :Windows Application
 

Hi,

When i make a call to a long running workflow service, in which service calls are within a TransactedReceiveScope activity, i sometimes get the following exception:

'VisualBasicValue<Exception>' is not of type 'Receive'. When loading this instance you must ensure that the activity with name 'VisualBasicValue<Exception>' implements 'Receive'.

Any pointers please.




View Complete Post


More Related Resource Links

AppDomain Type Loading Exception

  

Hi,

I have the following code :

public class Program

{

 static void Main()

        {

            AppDomain ad = null;

            ad = AppDomain.CreateDomain("AD #1", null, null);

            Assembly cur = Assembly.GetEntryAssembly();

            Foo f = (Foo)ad.CreateInstanceAndUnwrap(cur.FullName,"Foo");

        }

}

public class Foo : MarshalByRefObject

    {

        public Foo()

        {

            Console.WriteLine("Type : {0} ctor in {1} AppDomain",

                this.GetType(),

                AppDomain.CurrentDomain.FriendlyName);

        }

    }

 

witch produce the following exception :

Unhandled Exception: System.Typ

Activation error occured while trying to get instance of type Database, key "DBName"

  

Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<connectionStrings>
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"
providerName="System.Data.SqlClient

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />
</connectionStrings>


Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)


Database myDB=EnterpriseLibraryCo

VS2010 Silverlight 4 - Getting "Object reference not set to an instance of an object" when loading a

  
In Visual Studio 2010 I'm trying to use the Blacklight Controls (http://blacklight.codeplex.com/releases/view/37652) in my own project (and actually included the Blacklight.Controls project in my solution so that I could debug what was going on) and... after making all the XAML changes needed to incorporate the Blacklight navigation menu with my stuff in the innermost grid... everything compiled ok when doing a Build.  When I run it there's a reference to a resource dictionary in the XAML that fails with the object reference error above.  The XAML is as follows:       <UserControl.Resources>       <controls:ResourceDictionaryManager x:Key="ResourceDictionaryManager">       <controls:ResourceDictionaryManager.ResourceDictionaries>       <controls:ResourceDictionaryCollection>       <controls:ResourceDictionary Path="/Blacklight.Showcase;component/ResourceDictionaries/DavesGlossyControls.xaml">       <controls:ResourceDictionary.ResourceKeys>       <controls:ResourceKeyCollection>       <controls:ResourceKey ResourceName="GlossyBlackScrollViewer" />       </controls:ResourceKeyCollection>     &

VS 2010 XAML Design View Load always fail with a Type Load Exception

  
Create a new WPF project in VS and change nothing. The Design View will fail to load with the error below. Error    1    Could not load type 'Microsoft.Expression.DesignModel.Core.ISharedInstanceBuilder' from assembly 'Microsoft.Expression.DesignModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Microsoft.Expression.DesignModel is an assembly from Expression Blend. I ever installed Blend 4 RC and uninstall and install Blend 4. I Reflector the assembly I have under Blend 4 bin folder. And cannot find a interface named ISharedInstanceBuilder. But the WPF project is a Template project without any changes. How it get related with Blend 4? And how to fix it? Thanks.  

An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll

  
Additional information: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respondThis error occurs when i was executing a vc++.net program implementing ICMP....Error occurs when executing this statement... iRet=st->ReceiveFrom(RecvByte,RecvByte->Length,SocketFlags::None,&senderRemote);How to solve this problem????

A first chance exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll

  
I've read a bit about this error and maybe I have nothing to worry about.  BUT ... my simple little app gets 7 of these before it even gets to the first Dim statement in the Class Form1!  I found and followed instructions on how to have the Debugger intercept these exceptions but it seems that they are not being intercepted.  I only know that they have happened because of the messages in the Immediate Window.  In the Designer all I have is 5 Labels and 5 TextBoxes.   Any thoughts on how I could get to the cause of these messages? Thanks,  Bob

COM Interop Error loading type library/DLL TYPE_E_CANTLOADLIBRARY error in Vista but not XP

  
I have created a .NET executable that is using a COM assembly that is located on a servers shared drive but am  having problems getting it to work on a number of machines. I have made sure to register the COM assembly using regsvr32 and doing that it works on the computer that I developed it on. From there I brought it over to a Windows XP computer where it didn't work. I received an error message saying "Error loading type library/DLL ... (TYPE_E_CANTLOADLIBRARY)", which was in reference to the COM assembly. After some trouble shooting I found that if I granted the executable FullTrust in the .NET security model the .NET executable was able to load the assembly and everything worked properly. From there I brought the executable to a Windows Vista computer, registered the COM assembly using regsvr32 and granted the .NET executable FullTrust in .NET but it doesn't work. I get the same error saying "Error loading type library/DLL ... (TYPE_E_CANTLOADLIBRARY)". Any idea why the same steps would work in XP but not in Vista? Am I missing something obvious? Any suggestions would be greatly appreciated.

Null Reference Exception was not handled by user Object Reference not set to instance of an object

  
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Security.Principal;using System.Data;using System.Data.SqlClient;using System.Windows;using System.Collections; public partial class Default2 : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {     }    private bool tableCopied = false;    private DataTable originalDataTable;     protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)    {         if (e.Row.RowType == DataControlRowType.DataRow)        {            //string sValue = e.Row.Cells[3].Text;             if (!tableCopied)            {                originalDataTable = ((System.Data.DataRowView)e.Row.DataItem).Row.Table.Copy();                ViewState["originalDataTable"] = originalDataTable;      &nbs

The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.

  
 Hi all,When i run my project on my own computer, it works fine. But when i deploy it to server, it gives me this error. I can run my other dts and sp, but i get this error on this.. The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. I googled it but could not find a solution. How can i solve this problem? 

the type initializer for 'system.runtime.remoting.identity' threw an exception.

  
HI, I am trying to implement kerberos delegation in Active Directory enviroment with windows 2003 servers SP2. I have Client, ProxyServer and RemoteServer application that are developed on .Net framework v3.5 using .Net Remoting "System.Runtime.Remoting". I am not using Microsoft.Samples.Security.SSPI &  Microsoft.Samples.Runtime.Remoting.Security directly. my code is based on "http://blogs.msdn.com/dotnetremoting/archive/2006/07/06/662599.aspx" Only change that I have done is put impersonate="true" in channel configuration of ProxyServer and RemoteServer, and of course changed the UPN and Port and IP address. The Client's credentials are successfully impersonated by ProxyServer, I can access the text file on ProxyServer on behalf of client. But when from ProxyServer I try to execute the method on RemoteServer it throws "the type initializer for 'system.runtime.remoting.identity' threw an exception." After looking at blog http://www.secnewsgroups.net/group/microsoft.public.dotnet.security/topic8251.aspx I did required changing under Local Security Settings -> Local Policies -> User Rights Assignments -> impersonate a client after authentication and Create Global Objects. I have added three domain user names in three machine under whose credentials corrosponding application is running. When i run three applications on their

Exception of type 'System.ExecutionEngineException' was thrown.

  
Hi,       I am showing a WPF Window as ShowDialog().  Before loading the window, we are showing a message box. Upon Pressing Cancel Button from the Message box, Application throws "Exception of type 'System.ExecutionEngineException' was thrown.".. While cancelling, Events are raised to close the Window.. If we comment that code, window will be in the open state, other wise will "Throw the error". Please help me!!!!!!!!!  

Feature Upgrade Functionality - Adding a new Content Type and List Instance

  
I've successfully used the upgrade functionality in SP 2010 to upgrade my list structures as needed. So far, these updates have been adding new fields to existing content types. Now, I have some new fields, content types and list instances to add, and am having trouble getting this accomplished. The scenario is this: - A new content type with a single custom field (also new), and a list instance for this new content type - A new field that is a lookup back to the new list instance defined above. This new field is added as an existing content type. - In my feature.xml, I have the Element Manifest specified with both new fields and an AddContentTypeField element for the new field being added to an existing content type:   <ApplyElementManifests> <ElementManifest Location="V1_04\Elements.xml"/> </ApplyElementManifests> <AddContentTypeField ContentTypeId="0x0100..." FieldId="{8028A1C8-1147-4DF7-B5C3-8A1F84A30360}" PushDown="TRUE"/> The result of running the update on this feature is: - My new field that is part of an existing content type is added - My new field that is part of a new content type/instance is added - My new content type and list instance is NOT created, therefore my lookup is broken Any idea why my new Content Type and List Instance is not being created? Do I need to specify there

Exception of type 'System.ServiceModel.FaultException`1' occurred in WCF library

  
Hi, While Throwing Custom Fault Exception, am getting the warning message as An exception of type 'System.ServiceModel.FaultException`1' occurred in IAuthentication.DLL but was not handled in user code But Fault Exception handled in Client Side Please let me know, How Can I suppress this warning? Regards, Ganesh

Feature Upgrade Functionality - Adding a new Content Type and List Instance

  
I've successfully used the upgrade functionality in SP 2010 to upgrade my list structures as needed. So far, these updates have been adding new fields to existing content types. Now, I have some new fields, content types and list instances to add, and am having trouble getting this accomplished. The scenario is this: - A new content type with a single custom field (also new), and a list instance for this new content type - A new field that is a lookup back to the new list instance defined above. This new field is added as an existing content type. - In my feature.xml, I have the Element Manifest specified with both new fields and an AddContentTypeField element for the new field being added to an existing content type:   <ApplyElementManifests> <ElementManifest Location="V1_04\Elements.xml"/> </ApplyElementManifests> <AddContentTypeField ContentTypeId="0x0100..." FieldId="{8028A1C8-1147-4DF7-B5C3-8A1F84A30360}" PushDown="TRUE"/> The result of running the update on this feature is: - My new field that is part of an existing content type is added - My new field that is part of a new content type/instance is added - My new content type and list instance is NOT created, therefore my lookup is broken Any idea why my new Content Type and List Instance is not being created? Do I need to specify there

Exception "The activity with display name 'Flowchart' has already been associated with an instance

  
Using VS 2010 RTM. I have rehosted the desginer and provided a "test" button which runs the WF shown in the desginer, the code for running the WF is simple:  void OnTestWorkflowCommandHandler(object parameter) { ActivityBuilder designerBuilder = (ActivityBuilder)WFDesinger.Context.Services.GetService<ModelTreeManager>().Root.GetCurrentValue(); WorkflowInvoker invoker = new WorkflowInvoker(designerBuilder.Implementation); var se = invoker.Invoke(); it works fine, BUTThe root activity is a flowchart , if I start messing with the desginer and adding sequences and going back and forth to child activities and try to test(run) the WF I get the exception:The activity with display name 'Flowchart' has already been associated with an instance.  Once associated with an instance an activity's metadata cannot be manipulated.  This error might also indicate that you are attempting to execute a workflow whose root activity is actually part of another workflow.

'schema.AllCategories' threw an exception of type 'System.UnauthorizedAccessException

  
We're porting a solution from 2007 to 2010 and we're having trouble accessing the CrawledProperties property from the Schema object. Other properties from the Schema object however are accessible (e.g. AllManagedProperties). It does not matter whether we use the obsolete SearchContext to create the Schema object, or the new SearchServiceApplication (Example code from Steve Curran here: http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/2550e6e8-34a6-4012-969f-9657dc526d74) Now what's interesting is that the SAME user (Farm administrator) can access the AllCategories using a Windows Forms application, but when using a SharePoint solution (Codebehind on an application page) it doesn't work. We have double-checked that the executing user is the same. The same user can also browse the CrawledProperties using the Central Admin UI. We're experiencing this on several server installations, one of which is the "Standalone" installation of Search Server Express 2010, whereas the same user was used to perform the installation. I'd appreciate any ideas you might have.

An unhandled exception of type 'System.Net.WebException' occurred in system.dll Additional inform

  
Hi , I am giving my functioon below. I am getting the error when  executing  "       streamInput = HTTPWebRequest.GetRequestStream                "   error is  An unhandled exception of type 'System.Net.WebException' occurred in system.dll  Additional information: The underlying connection was closed: Could not establish secure channel for SSL/TLS.  Sorry for my bad english  Private Function GetXMLMarkIntnlResponse(ByVal strRequest As String) As String         Dim HTTPWebRequest As HttpWebRequest         Dim HTTPWebResponse As HttpWebResponse         Dim Encoding As System.Text.UTF8Encoding         Dim byte1 As Byte()         Dim streamInput, streamOutPut As Stream         Dim strmReader As StreamReader         Dim strURL As String = "https://beta.triseptapi.com/9.0/vax.asmx"         HTTPWebRequest = CType(WebRequest.Create(strURL), HttpWebRequest)         HTTPWebRequest.Method = "Post"         HTTPWebRequest.ProtocolVersion = HttpVersion.Version11         HTTPWebRequest.C
Categories: 
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