dotnet / dotnet/wpf

Build issue with WPF

Open
#4,299 24 comments 8 reactions 1 assignee Claimed by @ryalanms View on GitHub
Investigate urgent
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

_Originally posted by @borisf-rnd in https://github.com/dotnet/roslyn/issues/23266#issuecomment-800875353_

Hi,
I am experiencing the exact same issue.
Sometimes second build helps, sometimes not. Sometimes it requires me to rebuild and then build few more times.
Sometimes the build fails with:

Error CS2001: Source file '...\obj\Debug\Views\....ToolBar.g.cs' could not be found.

Then, after rebuild:
Unable to delete file "obj\Debug\....dll". The process cannot access the file ...\obj\Debug\....dll' because it is being used by another process.

Or:

CSC(0,0): Error CS2012: Cannot open '...\obj\Debug\...Module.dll' for writing -- 'The process cannot access the file '...\obj\Debug\...Module.dll' because it is being used by another process.'

Additional info about the project:
* I am targeting net48 and net5.0-windows (sdk style project, multi target).
* Using prism with wpf
* One of the projects have a postbuild xcopy action (this project makes the most problems).
* This is a new solution, wasn't upgraded or something.

Must say that this makes it impossible to work, any change in code that requires a build, ends up with 10 min build/rebuild/build rebuild sequence.

Also, there is no issue in the code, it compiles and runs properly (after few attempts of build/rebuild).

Thanks for your help.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.