D
D
Dmitry Bashinsky2017-11-27 23:09:37
C++ / C#
Dmitry Bashinsky, 2017-11-27 23:09:37

Visual Studio how to do multiple projects?

Hello, there was a problem when creating individual program modules.
I have a WPF project that just has a view (I'm writing with the MVVM pattern).
There are also 2 projects DLL ViewModel and Model.
Every time I change something in the Model and assemble the project, it says that it was not possible to access the file because it is busy with another process, as I understand Visual Studio itself, and in order to get around this, I restart the studio after the changes in the Model (studio new 2017 reinstalled yesterday. There are no such problems with the ViewModel.
The dependencies are:
WPF - ViewModel, Model
ViewModel - Model (Object models with INotifyPropertyChanged and other classes with logic)
Model - By itself, no one is needed.
And in general, how to separate such things? I used to divide it into folders, not projects - there were no problems.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lam0x86, 2017-11-28
@lam0x86

As for the locked files, I will not tell you, I have never had such a problem. Try disabling all studio extensions. Are there any post-build steps? Maybe some process is locking the files there. To understand who is locking a file, you can use the ProcessExplorer utility .
And about the separation of View and ViewModel into separate assemblies - this is a clear over-engineering. It is enough, as you did before, to break the code into namespaces and folders.
UPD. found on the Internet: In Windows 7, if you try to delete a file that is locked, the error message will tell you which process has it locked.

E
eRKa, 2017-11-28
@kttotto

as I understand Visual Studio itself

We must not assume, but find out for sure. Maybe you are launching more processes inside your project that use this file and you have not defined a disposition on it with the closing of the process. Maybe somehow you use a custom orm, where when the project ends, the connection to the database is not closed.
I am inclined to believe that you have running processes in your project that you should close manually in the code before exiting the application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question