Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6206173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:24:18+00:00 2026-05-24T05:24:18+00:00

I have two C# projects, Model and ModelTest. Model consists of ActiveRecord objects (wrapper

  • 0

I have two C# projects, Model and ModelTest. Model consists of ActiveRecord objects (wrapper around Hibernate). In ModelTest I created a simple unit test:

[TestClass]
public class UnitTest1
{
    [TestInitialize]
    public void Init()
    {
        Model.Init();
        Model.CreateSchema();
    }

    [TestMethod]
    public void TestMethod1()
    {
    }
}

Model.Init() registers all types of assembly Model with ActiveRecord.
Model.CreateSchema() wraps ActiveRecordStarter.CreateSchema(), which calls CreateSchema() of NHibernate.

This code works fine, if I run the unit test, but it fails if I “debug” the unit test. In debug mode, an exception occurs in CreateSchema():

NpgsqlException: 'ERROR: 42P01: table "user" does not exist'

The exception seems to be raised during the SQL call “drop table user cascade”, which obviously fails if the database is empty before running the test. I assume the drop is sent always before creating a new table.

Does Npgsql behave differently in debug mode, regarding the outcome of a drop query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:24:19+00:00Added an answer on May 24, 2026 at 5:24 am

    I had the exact same problem as Tarnschaf — SchemaUpdate.Create(...) would fail and the offending sql was drop table "tablename" cascade which resulted in the same “table does not exist” error mentioned above.

    It turns out that one of the projects had an reference to a Nhibernate-related assembly that was no longer in the same location. I’m not sure why this didn’t show up when the solution was cleaned & rebuilt. Removing all references from the project and re-adding them solved the problem (for me).

    Just posting this in case it helps someone else down the road. The Nhibernate exception was less than helpful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have two maven projects, project A contents some serializable model objects and project
I have two simple tables: Projects and SubProjects which I'd like to print every
Let's say I have two simple models project t.string :title vote t.references :project t.integer
I have two projects, a Cocoa iPhone application and a static library which it
I have two projects, the DLL project which has all my logic and data
I have two projects: A/B. Project A is the project that contains all of
I have two projects in the same server, their settings conflict in the session.auto_start,
I have two projects in my Solution. One implements my business logic and has
I have two projects in my solution   1- asp.net web project.   2-
We have two projects that are both class libraries. Project 1 is a VS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.