473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 1303
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.Exception namespace. Is the "Exception"
namespace defined by your own code? If that, when we change it to
System.Exception, 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.Exception" 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.Exception e = new System.Exception("");
". If I misunderstand you question, please let me know more detailed
repro-steps or send an example project to my mailbox ji****@microsoft.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****@microsoft.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.Collections.Generic;
using System.Linq;
using System.Text;

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

}
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Snippet.Exception
{
[global::System.Serializable]
public class DALException : ApplicationException
{
//
// 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.Exception inner ) : base(
message, inner ) { }
protected DALException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext 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.Exception namespace. Is the "Exception"
namespace defined by your own code? If that, when we change it to
System.Exception, 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.Exception" 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.Exception e = new System.Exception("");
". If I misunderstand you question, please let me know more detailed
repro-steps or send an example project to my mailbox ji****@microsoft.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****@microsoft.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****@microsoft.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
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" );...
9
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...
47
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...
2
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...
5
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...
0
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: "...
0
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...
3
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.