473,770 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding Exception namespace to LINQ DAL

I recently raninto major problems when I added the Exception namespace to the
Project which has my DBML file attached to it. Once I renamed all the
Exceptions instances to Syste.Exception the project would not recoginize any
assembly which had been added to the project, even know they were all there,
this happened to the designer.cs file that is attached to the dbml file. I
have no clue as to why this is the problem.

--
Alexander L. Wykel
AW Software Works

Jun 27 '08 #1
3 1323
Hello Alexander,

First off, I am sorry if these major problems turn out to be caused by
Microsoft products.

I am trying to reproduce the issue that the assemblies cannot be recognized
by Visual Studio even if they were all there. But I am stuck by the step
"adding the Exception namespace to the project". In .NET framework class
library, there is no System.Exceptio n namespace. Is the "Exception"
namespace defined by your own code? If that, when we change it to
System.Exceptio n, we may get an compilation error "'Excpetion ' is a
'namespace' but is used like a 'type'" from a code line like 'Exception e =
new Exception("");" . This is because "System.Excepti on" is a class and
"Exception" can also be regarded as a namespace in this case. The
resolution is to explicitly specify the namespace "System" when we use
"Exception" . For example, "System.Excepti on e = new System.Exceptio n("");
". If I misunderstand you question, please let me know more detailed
repro-steps or send an example project to my mailbox ji****@microsof t.com
so that I can have a clearer picture.

Have a good day!

Thanks
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== ====

Jun 27 '08 #2
Figured out the problem!

The problem is that I have a namespace root called NTKSDataLayer I have a
class Logger that is defined in ths name space With in this calss the
Exception class is refrenced mutiple times.

Here is the example:

using System;
using System.Collecti ons.Generic;
using System.Linq;
using System.Text;

//using Snippet.Excepti on;
namespace Snippet
{
public class Class1
{
public Class1()
{
try
{
if (1 != 2)
throw new System.Exceptio n("Whoops!");
}
catch (Exception ex) //This line won't compile
{

}
}
}
}

using System;
using System.Collecti ons.Generic;
using System.Linq;
using System.Text;

namespace Snippet.Excepti on
{
[global::System. Serializable]
public class DALException : ApplicationExce ption
{
//
// For guidelines regarding the creation of new exception types, see
//
http://msdn.microsoft.com/library/de...guidelines.asp
// and
//
http://msdn.microsoft.com/library/de...rp07192001.asp
//

public DALException() { }
public DALException( string message ) : base( message ) { }
public DALException( string message, System.Exceptio n inner ) : base(
message, inner ) { }
protected DALException(
System.Runtime. Serialization.S erializationInf o info,
System.Runtime. Serialization.S treamingContext context ) : base( info,
context ) { }
}
class Exception
{
}
}

--
Alexander L. Wykel
AW Software Works

"Jialiang Ge [MSFT]" wrote:
Hello Alexander,

First off, I am sorry if these major problems turn out to be caused by
Microsoft products.

I am trying to reproduce the issue that the assemblies cannot be recognized
by Visual Studio even if they were all there. But I am stuck by the step
"adding the Exception namespace to the project". In .NET framework class
library, there is no System.Exceptio n namespace. Is the "Exception"
namespace defined by your own code? If that, when we change it to
System.Exceptio n, we may get an compilation error "'Excpetion ' is a
'namespace' but is used like a 'type'" from a code line like 'Exception e =
new Exception("");" . This is because "System.Excepti on" is a class and
"Exception" can also be regarded as a namespace in this case. The
resolution is to explicitly specify the namespace "System" when we use
"Exception" . For example, "System.Excepti on e = new System.Exceptio n("");
". If I misunderstand you question, please let me know more detailed
repro-steps or send an example project to my mailbox ji****@microsof t.com
so that I can have a clearer picture.

Have a good day!

Thanks
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== ====

Jun 27 '08 #3
Hello Alexander,

Glad to see the issue was resolved with your own efforts. I am sorry that I
failed to provide constructive suggestions in my initial reply. Please feel
free to let me know if there's anything else I can help.

Regards,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== ====

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9309
by: Maersa | last post by:
hi, i'm trying to add "attributes" to some nodes and it works at design time but fails at runtime. XmlDocument doc = new XmlDocument(); XmlElement elem = doc.CreateElement( "root" ); elem.InnerXml = "<first>abcde</first><last>1234</last>";
9
10904
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent the wheel, right? Everything so far is working well with the Active Directory. The problem I am having is with adding File Permissions to a directory. I am currently using some code courtesy of "Willy Denoyette "
47
3369
by: Pierre Barbier de Reuille | last post by:
Please, note that I am entirely open for every points on this proposal (which I do not dare yet to call PEP). Abstract ======== This proposal suggests to add symbols into Python. Symbols are objects whose representation within the code is more important than their actual value. Two symbols needs only to be
2
3568
by: Flack | last post by:
Hey guys, I have a DataGrid and DataTable field in my class : private ImageDataGrid dataGrid1; //ImageDataGrid extends dataGrid and just overides OnMouseDown private DataTable dt = new DataTable("MyTable"); In the classes constructor, after InitializeComponent() I call the following
5
4603
by: Water Cooler v2 | last post by:
I know that we can add a single name value entry in app.config or web.config in the configuration/configSettings/appSettings section like so: <add key="key" value="value" /> Question: I want to add a dictionary of name-value pairs. In other words, instead of a single name-value, I want to add a name-value collection in there. I could do this:
0
2365
by: =?Utf-8?B?QW5keSBZdQ==?= | last post by:
Hi, I'm trying to return exceptions from a WCF Service using FaultExceptions. I got the service compiled and running. But I get an error while adding a service reference to it. The error reads: " Attempting to download metadata from 'http://localhost:4619/WCFService1/Service.svc' using WS-Metadata Exchange or DISCO. Error: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension:
0
2802
by: theonlydavewilliams | last post by:
Hi there I'm hoping there's an easy answer to a (hopefully) not too long-winded issue... I'm building a C# web client using a proxy wsdl.exe'd from a wsdl file and six schemas, each in a different namespace. Some schemas extend complex types in others. When i get a soap:Fault from my test server it could contain a serialized exception object (called fault) from one of two of these schemas (and different namespaces, call them xmlns:b0="ns1" and...
3
1936
by: plonk | last post by:
Hi I'm trying to learn sql by getting a database up and running on VB.net 2008 and SQL server express. I have the database connected correctly, (i think) but when i try to add a record using this code.. Dim db As New racedataDataContext Dim newmeeting As MeetingInfo = New MeetingInfo newmeeting.Date = Today db.MeetingInfos.add(newmeeting)
1
2049
by: =?Utf-8?B?QWxleGFuZGVyIFd5a2Vs?= | last post by:
Thank you Wen Yuan, This did answer my question, but it took a lot of work to implement. My original code did not use any namespace so I had to modify and test some 3000 lines of code to make sure this would work. I think it would be easier if there was some was you could subclass the XElement, provide your own namespace and then global search and replace would be much easier. Then you could do this:
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.