Showing posts with label Exceptions. Show all posts
Showing posts with label Exceptions. Show all posts

Tuesday, 30 March 2021

ORA-02291: integrity constraint (DESIGNATION_EMPLOYEE_FK) violated - parent key not found

 DesignationId column value of EMPLOYEE table should exists in DESIGNATION table while inserting the data in EMPLOYEE table

Sunday, 11 October 2020

Severity Code Description Project File Line Suppression State Error MSB3027 Could not copy "obj\Debug\netcoreapp2.1\KodingAttitudeApp.dll" to "bin\Debug\netcoreapp2.1\KodingAttitudeApp.dll". Exceeded retry count of 10. Failed. The file is locked by: ".NET Core Host (9280)" KodingAttittudeApp C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 4194

 Severity Code Description Project File Line Suppression State Error MSB3027   Could not copy "obj\Debug\netcoreapp2.1\KodingAttitudeApp.dll" to "bin\Debug\netcoreapp2.1\KodingAttitudeApp.dll". Exceeded retry count of 10. Failed. The file is locked by: ".NET Core Host (9280)" KodingAttittudeApp C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 4194


To resolve this issue 

1. Close the Visual Studio Application and 

2. Delete the obj and bin folders

if unable delete the bin folder and gets the error dialog box with Try again or Skip

"The action can't be completed because the file is open in dotnet.exe"

3. then go to Task Manager from the Task bar and select .NET Core Host and click on End task button. The the issue will be resolved



Saturday, 3 November 2018

A network-related or instance-specific error ocurred while establishing a connection to SQL Server. The server was not found or was not accessivle. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


A network-related or instance-specific error ocurred while establishing a connection to SQL Server. The server was not found or was not accessivle. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


                      If this error comes when trying to connect with Database from the Visual Studio Project through Entityframework , then open Control Panel and search for Services in Search bar and In the Administrative Tools click on View Local Services and find SQl Server Browser and the Startup Type may be disabled, then right click on it and select Properties in the displayed menu. And in the displayed SQL Server Browser Properties window, in General tab change the Startup type to Automatic and click on Ok button, Now again start to add ADO.NET Entity Data Model in your project, now it will works with out error., follow the steps shown in images :

Monday, 12 March 2018

Validation failed for one or more entities, See EntityValidationErrors property for more details

      To rectifiy this error, I had opened the EntityValidationError property above the Message property and in that System.Data.Entity.Validation.DbEntityValidationResult And in that ErrorValidations and in that ErrorMessage, the error message will display as below :

Thursday, 1 February 2018

Failed to load resource: the server responded with a status of 404 (Not Found) api/upload/fileupload

the server responded with a status of 404 when trying to upload images more than 2 mb

Failed to load resource: the server responded with a status of 404 (Not Found)      api/upload/fileupload

And If It is also

Failed to load resource: the server responded with a status of 500 (Internal Server Error)  api/upload/fileupload

Saturday, 13 January 2018

Project 'ProjecName' could not be opened because the Visual C# 2015 compiler could not be created. 'ProjectName' is already part of the workspace


To Resolve this issue set

<UseIIS>False</UseIIS> and
<UseIISExpress>true</UseIISExpress>


To do that we have to tick the Apply server settings to all users (store in project file)


Friday, 23 June 2017

Ananymous elements have same name in LINQ



This Exception came when  i try to query using LINQ to get the data in a variable as below :
var countryDetails = (from count in Supplier
                      where count.AddressInformation != null && count.AddressInformation.CountryInformation != null
                      select new
                      {
                          count.AddressInformation.CountryInformation.LongName,
                          count.AddressInformation.StateInformation.LongName

                      }).ToList();
To Resolve The Exception, We have to give Names to each variable in new object variable

i.e.,
var countryDetails = (from count in Supplier
                      where count.AddressInformation != null && count.AddressInformation.CountryInformation != null
                      select new
                      {
                          CountryName = count.AddressInformation.CountryInformation.LongName,
                          StateName = count.AddressInformation.StateInformation.LongName

                      }).ToList();

Saturday, 17 June 2017

NonUniqueObjectException was caught

NonUniqueObjectException was caught

a different object with the same identifier value was already associated with the session: 345, of entity: Kasani.RackApp.Model.Data.Domain.Employee

In The Below Code, The Above Exception Is Coming.

The Exception Came Because The Two Different Objects Having Same Id, Which The NHibernate Reads The Id To SaveOrUpdate The Data Accordingly Based On Id.

So To Resolve That, I Had Used

Session.Clear() and
Session.Flush() Before SaveOrUpdate() method...

Now It Works Fine.

public bool SaveEmployee(EmployeeInformation employeeInformation)
        {
         
                bool isEmployeeSaved = false;
         
                EmployeeTypeRepository employeeTypeRepository = new employeeTypeRepository();
                CompareDomainWithBusinessObjRepository cmpObjRepository = new CompareDomainWithBusinessObjRepository();
                List<AppDomain.Compare> cmpSaveEmp = cmpObjRepository.CompareNotifications(employeeInformation, (int)AppEnumeration.Notifications.Employee, employeeInformation.EmployeeId);
             
                var map = new AutoMap<EmployeeInformation, AppDomain.Employee>();
                AppDomain.Employee employee = map.Create(employeeInformation);
                employee.EmployeeType = employeeTypeRepository.FindById((int)employeeInformation.EmployeeTypeId);
           
             
                Session.Clear();
                Session.Flush();
                employee = SaveOrUpdate(employee);
           
                if (employee.EmployeeId > 0)
                {
                    isEmployeeSaved = true;
                }
               foreach (var item in cmpSaveEmp)
                    {
                        cmpObjRepository.SaveOrUpdate(item);
                    }
                return isEmployeeSaved;
       
   
        }

Sunday, 8 May 2016

identifier of an instance of Address was altered from 5 to 4 (org.hibernate.HibernateException:)

I Had Assigned The Value To The  Parent's Child Object Id as
Student studentObj=new Student();
StudentDAO daoStudent=new StudentDAO();

studentObj=daoStudent.LoadById(studentBE.StudentId);

studentObj.Address.AddressId=studentBE.AddressId;

Then I Had Got The Exception "Identifier Of An Instance Of Address Was Altered From 5 to 4".
An NHibernateException.


Solution:-
-----------

By Creating A New Object Of Address With The Given Id And Replacing The Address Object Associated With Object Student -- as below:

studentObj.Address=new Address(){AddressId=studentBE.AddressId};

Sunday, 10 April 2016

Unable to start debugging on the webserver. Could not start ASP.NET debugging. More information may be available by starting the project without debugging

When I Am Trying To Run The Application With Debug Mode It Is Showing The Dialog Box "Unable to start debugging on the webserver. Could not start ASP.NET debugging. More information may be available by starting the project without debugging"

And If I Run The Application Without Debug, Then It Is Showing HTTP:Error 503

To Rectify This ...

Open 'Run' window by clicking wnd+R

And Type 'inetmgr', then IIS will open.

In The Displayed window,

In "Edit Application Pool" Click On "View Applications" In right hand side, and in the middle it shows the "Applications"- in that

"Virtual Path" "Physical Path" "Site" "Application Pool" columns will display , and in that i had changed by clicking on the
the "Application Pool" from DefaultAppPool to ASP.NET V4.0 Integrated(v4.0).


Now the Application Is Running Well And Good.

Thursday, 18 February 2016

Property or indexer cannot be assigned to -- it is read only

Property or indexer 'Abc.Display' cannot be assigned to -- it is read only
==========================================================================

I get this Exception because in business class I had given only get accessor to the property of class as below:


class Abc
{
  public bool Display
  {
         get;         // i.e., it only can read the value, but cannot take any value
  }
}


now

Abc obj1= new Abc();
obj1.Display=true;   // here i am assinging value to the property as the property is read only

So that the error is coming and as in Business object we had given only 'get' accessor

now i had changed the property in Abc class as get and set as below :


class Abc
{
  public bool Display
  {
         get;         // i.e., it only can read the value, but cannot take any value
         set;
  }
}

now

Abc obj1= new Abc();
obj1.Display=true;

Now its well and good and not showing any error

Saturday, 12 December 2015

NonUniqueObjectException was caught - a different object with the same identifier value was already associated with the session: 345, of entity: Kasani.RackApp.Model.Data.Domain.Employee

NonUniqueObjectException was caught            (NHibernate Exception)

a different object with the same identifier value was already associated with the session: 345, of entity: Kasani.RackApp.Model.Data.Domain.Employee


The Exception Came Because The Two Different Objects Having Same Id, Which The NHibernate Reads The Id To SaveOrUpdate The Data Accordingly Based On Id.

So To Resolve That, I Had Used

Session.Clear() and
Session.Flush() Before SaveOrUpdate() method...i.e.,

Session.Clear();
Session.Flush();
object1=SaveOrUpdate(object1);

foreach(var item in object2)
{
   otherObjectRepository.SaveOrUpdate(item);
}


Now It Works Fine.


Monday, 24 February 2014

HTTP could not register URL://+:80/8080/.Your process does not have access rights to this namespace



The Exception Occured Due To That The URL Is Being Created Is Blocked By Windows. 
To Rectify This:
Close The Visual Studio Application And Just Right Click On The Visual Studio Icon And Click On "Run As Administrator"

Wednesday, 25 December 2013

To prevent possible data loss before loading the designer, the following errors must be resolved




unable to copy file "obje\Debug\fileName.exe" to "bin\Debug\fileName.exe". The process cannot access the file 'bin/Debug/fileName.exe' because it is being used by another process.

unable to copy file "obje\Debug\fileName.exe" to "bin\Debug\fileName.exe". The process cannot access the file 'bin/Debug/fileName.exe' because it is being used by another process.

I got this error when i start to run the windows application, To rectify this Error , I Opened The "Windows Task Manager" By "Ctrl+Alt+Delete" And Opened The Tab "Processes" And Selected The .exe Of The Application And Click On "End Process" Button And Run The Application Again...It Runs Successfully.

Thursday, 29 August 2013

The database cannot be opened because it is version 661. This server supports version 612 and earlier. A downgrade path is not supported.

"The database cannot be opened because it is version 661. This server supports version 612 and earlier. A downgrade path is not supported."
This Error Occurred Because The Database Is Created In SQL Server 2008 And I Tried To Open The Database In SQL Server 2005...So Avoid Opening The SQL Server 2008 In SQL Server 2005


EndPointNotFoundException was unhandled

When I Am Running The WCF Application I Got The Exception "EndPointNotFoundException was unhandled" As Follows:


The Exception "EndPointNotFoundException was unhandled" Occured Because I Did Not Add The Service Reference To The WCF Application..After Adding The Service Reference By Right Click On The Project Name In Solution Explorer And  Paste The Service URL Address And Click On GO Button And Click Ok Button, Now The Service Reference Is Added To The Application. Now Click On Start Debugging, The Application Runs Successfully.


Monday, 19 August 2013

The type 'WcfServiceForInsert.Service1', provided as the Service attribute value in the ServiceHost directive could not be found.

Server Error in '/Rack' Application.

The type 'WCFService1.Service1', provided as the Service attribute value in the ServiceHost directive could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The type 'WcfServiceForInsert.Service1', provided as the Service attribute value in the ServiceHost directive could not be found.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Solution:-
               Check The Service1.svc file, The Service="WcfService1.Service1" Is Same As The Type Or Not. In The Above Error  The type 'WCFService1.Service1' not equal to Service="WcfService1.Service1". There Is A spell Mistake

<%@ ServiceHostLanguage="C#"Debug="true"Service="WcfService1.Service1"CodeBehind="Service1.svc.cs"%>

Service 'WCFService1.Service1' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.

Server Error in '/Rack' Application.


Service 'WCFService1.Service1' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Service 'WCFService1.Service1' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Solution:-
              Check The Name Of The behaviorConfiguration Of The <Service>tag In The Web.Config Is Same As The Project Name (i.e., Project Namespace) 

<services>
                  <service name="WcfService1.Service1" behaviorConfiguration="WcfService1.Service1Behavior">
                        <!-- Service Endpoints -->
                        <endpoint address="" binding="wsHttpBinding" contract="WcfService1.IService1">
                            
                              <identity>
                                    <dns value="localhost"/>
                              </identity>
                        </endpoint>
                        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
                  </service>

            </services>