.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

Handling Type namespace/assembly change during serialization

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :.NET Framework
We needed to move a class from one assembly to another due to referencing issues.  However, we have Workflows in the field where this type is serialized into them and we get the Failed to load type error.  I was wondering if there was anything like AssemblyResolve for handling type load failures where we can correct the type and load the correct one?

View Complete Post

More Related Resource Links

Type or namespace error.


A couple of days ago I started getting an unusual behavior when compiling Website projects. I have referenced class libraries added to my bin folder that are also correctely referenced in using statements in my aspx.cs code behind. When I compile, I get the 

Error 4 The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Dev\Fiscal_Portal\Implementation\FMS Portal Site_new\App_Code\BLL\DataTables.cs 1 7 C:\...\FMS Portal Site_new\

The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?)

error message that would typically be received when the dll has not been added as a reference or added in a using statement.

I can eliminate the error by adding an


Bug: Does not change column type from nvarchar to ntext


Scenario: If you create a table with a column of type nvarchar, populate it with some content and try to modify it using the WebMatrix editor, from nvarchar to ntext, it does not display any error message or warning that this is not possible. It silently saves and reverts the change, back to nvarchar. Wasted some hours on this issue as I thought my column was ntext, but in fact was still nvarchar.

Expected behavior: It should change to ntext, or if SQL CE doesn't support that, it should notify the user that no change was applied.

The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must



This is frustrating, and I don't know how to solve it.

I have a strange problem. I am adding a LinqDatasource object, and set the context:

        protected void LinqDataSource_ContextCreating(object sender, LinqDataSourceContextEventArgs e)
            e.ObjectInstance = new KaruselaDataContext(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

Then I get this error:
The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.


On web.config I already have this:
<add assembly="System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

NOTE: The datacontext is in a different project (DLL proect) where I added a refernce to System.Data.Linq.

is there another way adding a refernce to a web project? or only though teh web.config?


XML in Yukon: New Version Showcases Native XML Type and Advanced Data Handling


The next version of Microsoft SQL Server, code-named "Yukon," represents quite a few steps forward in the evolution of XML integration. Yukon supports native storage of XML data using the XML data type, which makes it possible to run native queries on XML data using the emerging industry standard XQuery language. Data integrity of the XML data type can be enforced through schema validation and XML-based check constraints, and special indexes can be defined that help speed up queries. In addition, Yukon has the built-in ability to expose its data through Web services. This article discusses these and other XML features of Yukon.

Bob Beauchemin

MSDN Magazine February 2004

Fix: The type or namespace name 'EntityDataSource' does not exist

Today's stupid mistake had me going in circles in my Web application project. The error message was: The type or namespace name 'EntityDataSource' does not exist. As the rest of the error message suggests, I must be missing an assembly reference. Nope, I'd already added in the references to Entity : System.Data.Entity System.Data.Entity.Design After much frustration until after 1 a.m., I gave up and went to bed. This morning I realized that what it wanted was the WEB Entity! System. Web .Entity System...(read more)

The type 'DataGrid' was not found. Verify that you are not missing an assembly reference and that

Hi; I'm new to WPF and I was going through the ExpenseIt tutorial on MSDN's website. The tutorial was working fine until I added DataGrid. I got the error message: "The type 'DataGrid' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built."     I could not find a clear answer online of which assembly references to fix and how to fix them. Any help would be appreciated. Thanks!     Note: I'm running the following: Windows Vista 32-bit operating system Microsoft Visual Studio 2008 Version 9.0.30729.1 SP Microsoft .NET Framework Version 3.5 SP1

Cannot register a service type without attaching the source assembly to the host process

I'm wondering if there is any way I can register a service type without attaching the source assembly to the host process. When I register the service type, the source assembly (which has the type) cannot be written.   I appreciate your attention.. 

Help Troubleshoot "Could not find Type in assembly"

I am attempting to create a CLR Procedure.  I was able to create the assembly, but I am unable to create a procedure on the assembly.  This is the error I receive: Msg 6505, Level 16, State 1, Procedure DINEServiceProc, Line 2 Could not find Type 'DINEServiceProc' in assembly 'DINEService' Here is the VB code to create the class: <code> Imports System Imports System.Data Imports System.Data.Sql Imports System.Data.SqlClient Imports System.Data.SqlTypes Imports Microsoft.SqlServer.Server Partial Public Class DINEServiceProc <Microsoft.SqlServer.Server.SqlProcedure()> _ Public Shared Sub ServiceProc(ByVal iMsg As String, ByVal iMsgType As String) Dim conn As SqlConnection 'Create an in-process connection to the instance of SQL Server conn = New SqlConnection("Context Connection=True") Dim DINEService As New DINEService Try conn.Open() DINEService.ProcessStartRequest(iMsg, iMsgType) Catch sqe As SqlException 'Console.WriteLine(sqe.Message) Return Finally conn.Close() End Try End Sub End Class </code> And here is the code to create the assembly and the procedure: <code> USE [ServiceBrokerTest] GO /****** Object: SqlAssembly [DINEService] Script Date: 01/03/2006 10:38:00 ******/ CREATE ASSEMBLY [DINEServiceProc] AUTHORIZATION [dbo] FROM 'D:\EHIT\ServiceBroker\DINEService\DINEService\bin\Debug\DINEService.dll' WITH PERMISSION_SET = SAFE

Error Build: Type or namespace could not be found, when referencing a web service

Hello, I'm new in writing C# application in Visual Studio 2008. I'm currently writing a web application for CRM 4.0 Reporting Service rendering. I reference my web application to our Reporting Service web service http://reportservername /ReportServer/ReportExecution2005.asmx and name it 'RSWebReference'. Then I want to reference it in my code: Using RSWebReference; Not sure why, but I cannot build my solution, saying "The type or namespace name 'RSWebReference' could not be found (are you missing a using directive or an assembly reference?)". I read this thread in http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/74f70e30-83e8-4817-b5e0-7729450730a1 that the website probably is using .net 1.1, and I should change it to .net 2.0. However, I think the website is already using 2.0. Is it probably because I'm using VS 2008? How can I tell and change if the website is using 1.1 or 2.0? Or could I be doing something wrong? Thanks in advanced for your help! -Elizabeth K.

Is it possible to Register Assembly System.Runtime.Serialization.dll

I am trying to run a Virtual Earth web service call from SQL server, and need to registier the System.Runtime.Serialization.dll assembly in SQL.  Is this possible?ThanksJay

Assembly load error system.runtime.serialization

Hello ! I have a web project which i began there is some month, and compile perfectly until now. In fact, i have some compile error;   erreur 1 Could not load file or assembly 'System.Runtime.Serialization, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The module was expected to contain an assembly manifest.   on explorer :   The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) Description : Une exception non gérée s'est produite au moment de l'exécution de la demande Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code. Détails de l'exception: System.BadImageFormatException: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) Erreur source: Une exception non gérée s'est produite lors de l'exécution de la demande Web actuelle. Les informations relatives à l'origine et l'emplacement de l'exception peuvent être identifiées en utilisant la trace de la pile d'exception ci-dessous. Trace de la pile: [BadImageFormatException: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)] System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBa

The type or namespace name 'Linq' does not exist in the namespace 'System'

Hi, I uploaded my website to the server, and I have there a working with wcf - it should be fw 3.5 I saw that fw 3.5 is installed on the server and also we have there fw 3.0 sp1. I run my website : www.qenglishcenter.com and I'm getting an error : The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) shouldn't System.linq be already existed ? Thanks for any reply.  

The type 'DropShadowEffect' was not found. Verify that you are not missing an assembly reference a

We created a grid in Expressions Blend but the DropShadowEffect caused an error for a developer who tried to build the solution and did not have Expressions Blend on his machine.  Had to replace with  <Border.BitmapEffect><DropShadowBitMapEffect ... Are there other incompatibilities between Expressions Blend and plain old Visual Studio 2008 development environs? <   UserControl   xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation   xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml   xmlns:d=http://schemas.microsoft.com/expression/blend/2008   xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006   mc:Ignorable="d"   xmlns:igRibbon=http://infragistics.com/Ribbon   x:Class="TestEditor.Ctrl_PR"   x:Name="UserControl"   MaxWidth="450"   d:DesignWidth="450" d:DesignHeight="125">     <Grid x:Name="LayoutRoot" RenderTransformOrigin="0.5,0.5" Width="450" Height="125">   <Border CornerRadius="8" BorderBrush="DarkSlateBlue" BorderThickness="0.5" HorizontalAlignment="Stretch" Grid.ColumnSpan="2">     <Border.Background>       <LinearGradientB

The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\

Dear, I have vs2005 and vs2008 in server machine. everything is fine. but when i want creating crystal report in vs2008 i got this problem. i have no CrystalDecisions.Web.dll in webs bin directory. and no multiple version in web.config file. how can i solve this. plz reply quick.   Jewel

The type or namespace name 'Portal' does not exist in the namespace 'Microsoft.SharePoint' (are

Hi, We are trying to migrate a console program (C#) from MOSS 2007 to SP 2010. Trying to build the program (Visual Studio 2008) results in this error message: "The type or namespace name 'Portal' does not exist in the namespace 'Microsoft.SharePoint' (are you missing an assembly reference?)" Then we tryed adding a reference for Microsoft.SharePoint.portal - but this class is not available in the dialog box 'Add reference'. Can anyone help - please.

Cannot create unknown type '{clr-namespace:Blog.LongRunningWorkflow.Example.Activities}WaitForReques

Hi, I am facing problem in loading XAML at runtime. Below is the code please help me. public void ProcessRequest(Request request) { // Get the workflow instance id to use Guid instanceId = this.requestToInstanceMapping[request.Id];         // Setup the arguments that are passed to the workflow          IDictionary<string, object> input = new Dictionary<string, object>();              input.Add("Request", request);            using (FileStream fs = new FileStream(@"ProcessRequest.xaml", FileMode.Open))          {             // Load the ProcessRequest workflow           Activity wf = ActivityXamlServices.Load(fs) as Activity;                            // Create the workflow instance specifying the arguments and instance id                      WorkflowApplication wapp = new WorkflowApplication(wf, input);          string persistenceConnectionString = "Data Source=Dev1;Initial Catalog=InstanceStore;User id=sa;password=xxxxxxx;Asynchronous Processing=True";          &nbs

Problem with AJAX - " Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'Syst

Hi., I'm using Visual Studio 2008 and i downloaded the toolkit from Codeplex, I downloaded the zip file which i've marked red in the below link.. This is my code, <form id="form1" runat="server"> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> <asp:Panel ID="Panel1" runat="server"> Hi Simbu AJAX Works Fine ! </asp:Panel> <asp:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID = "Panel1" Radius = "6" BorderColor = "#FBB117" Corners = "All" > </asp:RoundedCornersExtender> </form> & this is the error i get, " Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' " I saw this post, http://forums.asp.net/p/1273185/3439540.aspx and i changed my TOOLSCRIPTMANAGER into SCRIPTMANAGER & now i get this error ! and now c what this post says... http://forums.asp.net/t/1529516.aspx NOW WOT AM I SUPPOSE TO DO ??? PLZ GUIDE ME ! I'm struck up with this since 2 days....
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