warning MSB3061: Unable to delete file ... #52

Closed
Bananas-Are-Yellow opened this Issue Oct 21, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@Bananas-Are-Yellow

I reported this in the WebSharper Forum. I can now reproduce it quite simply with a new Visual Studio solution and only two projects.

I'm using Visual Studio 2015, if that makes any difference, and .NET 4.6 with F# 4.0.

It seems I can't upload a ZIP file of the solution (file type not supported), so here's how to recreate it:

  1. Create a new solution.
  2. Create WebSharper Library project called Library.
  3. Create a Visual F# Library project called Core.
  4. Add a project reference from Library to Core.
  5. I am using .NET 4.6 with F# 4.0, and that's how Core was set up. So I had to change the project properties for the Library project to be the same (the WebSharper template created the project using F# 3.0).
  6. Add packages WebSharper and WebSharper.UI.Next to the Library project.
  7. Verify that you can build the solution.

To set up the conditions for the problem, do this:

  1. Clean the solution.
  2. Build the Core project only.
  3. Open the Main.fs source file from the Library project.

At this point, a security dialog will appear saying: You have opened a source code file in a project that references a type provider. It shows that the type provider assembly is WebSharper.UI.Next.Templating.dll. Press the Enable button.

To produce the problem:

  1. Close Visual Studio.
  2. Reopen the solution and wait 20 seconds.
  3. Clean the solution.

You will find that Core.dll is locked:

warning MSB3061: Unable to delete file "<path>\Core\bin\Debug\Core.dll". Access to the path '<path>\bin\Debug\Core.dll' is denied.

The problem only occurs if Main.fs is open, so if you close Main.fs and restart Visual Studio, you will now be able to clean the solution successfully.

Also, if you expand the project references for the Library project and remove the reference to WebSharper.UI.Next.Templating, the problem will not occur.

@Tarmil

This comment has been minimized.

Show comment
Hide comment
@Tarmil

Tarmil Oct 21, 2015

Member

Thanks for the detailed report! I can reproduce your steps. It looks like there is a problem with the way we load references in the templating type provider. I will look into it.

Member

Tarmil commented Oct 21, 2015

Thanks for the detailed report! I can reproduce your steps. It looks like there is a problem with the way we load references in the templating type provider. I will look into it.

@Tarmil Tarmil closed this in 8d566af Oct 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment