![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Adding Exception namespace to LINQ DAL 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 jialge@xxxxxx so that I can have a clearer picture. Have a good day! Thanks Jialiang Ge (jialge@xxxxxx, 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: msdnmg@xxxxxx. This posting is provided "AS IS" with no warranties, and confers no rights. ================================================= |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Adding Exception namespace to LINQ DAL 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: Quote: > 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 jialge@xxxxxx > so that I can have a clearer picture. > > Have a good day! > > Thanks > Jialiang Ge (jialge@xxxxxx, 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: > msdnmg@xxxxxx. > > This posting is provided "AS IS" with no warranties, and confers no rights. > ================================================= > > |
My System Specs![]() |
| | #4 (permalink) |
| | RE: Adding Exception namespace to LINQ DAL 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 (jialge@xxxxxx, 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: msdnmg@xxxxxx. This posting is provided "AS IS" with no warranties, and confers no rights. ================================================= |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| getting cr/lf out of xml with linq to xml? | .NET General | |||
| Linq to SQL | .NET General | |||
| namespace exception | PowerShell | |||
| Exception stack is corrupt when catching and storing the exception | .NET General | |||
| Vista Install Error: Exception Unknown Software Exception | Vista installation & setup | |||