Deploy Windowsforms with bank . mdf

Asked

Viewed 167 times

1

I made a program in Windows Forms (C#) in layers.

  • Model
  • DAO
  • BLL
  • Interface

Create a Database (Generator.mdf) in the Model Project and its Context (edmx).

Now I want to publish, and how do I get the file . mdf to come along with Publish?

Note: If I put everything in one project, it works!

inserir a descrição da imagem aqui

1 answer

1

In the Generator.mdf file properties, select "Copy to Output Directory" or "Copy Always" for the file to always be copied to the output directory or "Copy if newer" to copy only if the file is newer than the one in the output directory.

  • Didn’t work!!

  • For now the only solution is to add the . mdf file as an item in the main project.

  • really don’t know how it didn’t work, you managed to change the property correctly ? if you changed search for that Generator.mdf file in the folder where you play the Publish files, I tested it here and it played the file to bin folder

Browser other questions tagged

You are not signed in. Login or sign up in order to post.