The damage caused to your BIN folder, on rebuilding!
I am trying to learning the ropes of Thunder, using Visual Studio 2010, and finding that Rebuilding the Sitefinity project totally destroyed a lot of the initially installed BIN files.
To show this, I set up a project, then backed up the BIN folder to a different folder, then Rebuilt the project. I then used Beyond Compare, to show the wreckage. The link below displays the screen shot of the differences:
http://tinyurl.com/azxek45
The image is 2.5Mb in size, as it's a whole screen image, apologies for the download size.
So what is going on here?
Why are so many files being removed with you use "Rebuild" as opposed to "Build"?
Do I have to now continually keep a backup of the BIN folder, just in case I click "Rebuild" by accident?
Would this thread over at stackoverflow be helpful?
Well that does give me a way to protect the files, but still curious as to why "Rebuild" has a propensity to delete a whole raft of files that Sitefinity needs.
Thanks for the link. I'll start marking all installed "DLL" files as read only and everything should be good.
Cheers.
Update: Now that I've done that, I see the following output when I rebuild. You can see a lot of files were saved from the "Rebuild", and the site is still working after the "Rebuild" is complete. So I would say, that as soon as you install Sitefinity, set ALL files in the "bin" folder to read only, to prevent this issue. :)
------ Rebuild All started: Project: SitefinityWebApp, Configuration: Debug Any CPU ------
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Microsoft.Http.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Microsoft.Http.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Sitefinity.Services.Statistics.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Sitefinity.Services.Statistics.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.FormatProviders.Rtf.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.FormatProviders.Rtf.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.FormatProviders.Html.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.FormatProviders.Html.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.Fixed.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.Fixed.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.FormatProviders.OpenXml.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Documents.FormatProviders.OpenXml.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Controls.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Controls.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Data.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Data.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Zip.dll". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Windows.Zip.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\DocumentFormat.OpenXml.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\DocumentFormat.OpenXml.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Microsoft.Practices.ServiceLocation.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Microsoft.Practices.ServiceLocation.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Microsoft.WindowsAzure.Diagnostics.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Microsoft.WindowsAzure.Diagnostics.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Microsoft.WindowsAzure.StorageClient.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Microsoft.WindowsAzure.StorageClient.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.OpenAccess.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.OpenAccess.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.OpenAccess.35.Extensions.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.OpenAccess.35.Extensions.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.OpenAccess.Web.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.OpenAccess.Web.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Reporting.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Reporting.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Reporting.OpenXmlRendering.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Reporting.OpenXmlRendering.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Reporting.XpsRendering.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Reporting.XpsRendering.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.ReportViewer.WebForms.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.ReportViewer.WebForms.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Sitefinity.Model.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Sitefinity.Model.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Sitefinity.Resources.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Sitefinity.Resources.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Web.UI.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Telerik.Web.UI.xml' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\PEC Website 5.4\PEC Sitefinity\bin\Twitterizer2.xml". Access to the path 'C:\PEC Website 5.4\PEC Sitefinity\bin\Twitterizer2.xml' is denied.
SitefinityWebApp -> C:\PEC Website 5.4\PEC Sitefinity\bin\SitefinityWebApp.dll
========== Rebuild All: 5 succeeded, 0 failed, 0 skipped ==========
Just for completeness if someone else stumbles upon this thread.
Please don't simply mark the files as read-only. Instead take 5mins extra and follow the other StackOverflow suggestion and create a libs folder where you reference them from...
Why?
Because some .dll files will get removed on rebuild, while others are not but it's easy to mistake them. Take for instance Telerik.Sitefinity.Thunder.Contracts.dll a dll file that comes out of the box, yet which gets updated if a newer version of Thunder gets installed.
Secondly, the 'read-only' file-attribute will get deployed as well (or uploaded through FTP) to the dev/test/staging/production server since its a file attribute.
Resulting in a nice bunch of errors you need to manually check one-by-one to see which version is the correct one (think 5.4.4000 then hotfix 5.4.4010 gets released).
---
A better approach would be to create a libs folder inside your solution, copy the entire /bin contents in there except SitefinityWebApp.dll (isn't there when you start fresh, only after you've build).
Remove the reference to all the .dll files that are in that new libs folder, then add the whole bunch again as references from the libs folder.
This way will ensure you've got all the files referenced, they'll always be updated with each build/publish and you won't run into any Thunder/Hotfix/NuGet issues.
Jochem
Hi Everyone,
It was announced today in the dev community group that this problem is being addressed in 6.0. Rebuilding your project will no longer remove those DLL files forcing you to add them back. In the meantime Arno and Jochem's suggestions are the ones to follow.
Well thanks to your little bit of advice, in moving the files from the "bin" folder, to an external one, I am getting a compile error:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
Every time I Build/Rebuild. I have remade the project over a dozen times, making sure I only copy the reference files I needed, and re-adding the references to fix the broken references once the files are copied.
So what am I doing wrong with the file copy?
@Lurch,
Ok if I'm to blame - lets see if we can resolve this... what you're doing wrong? Nothing at all.
First of all, you're getting a warning - not a compile error.
It builds perfectly but I can imagine the frustration. So let's see where it comes from.
When you're rebuilding, VisualStudio basically clears out your bin folder (because its meant as a target folder and not a source). Then it tries to resolve all your references and dll files it comes across.
One of the .dll's causing your warning is for instance system.web.mvc.dll, here's a detailed snippet of the full warning
There was a conflict between
"System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
and "System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
"System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
was chosen because it was primary and "System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
References which depend on "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
...
...
Hi all,
I just want to mention that we have resolved the problem with rebuilding for Sitefinity 6.0. From 6.0 moving forward assemblies from the stock SitefinityWebApp will not be cleared on rebuild.
Kind regards,Thanks for that, good to hear. Now I am having a problem with session variables being cleared between pages. How do I fix that? Or, does Sitefinity have their own version of session variables?
Hello,
Sitefinity does not use session state, so if you have use of session state please check its persistence mode. Probably there is something wrong with it. If you are not talking about session state please clarify your issue.
Greetings,We just upgraded to 6.3.5 and ran into this .dll hell again. The /bin folder is the target for build output, it should not contain dependencies. It should be safe to delete /bin and /obj folders and let Visual Studio recreate them. It's really annoying that Sitefinity gets this so wrong.
As Jochem mentions above. Place the Sitefinity dlls in a library and reference them from there. Mark all the Sitefinity references as Copy Local = True. This ensures that they are all copied during a publish. If you have another version of Telerik reporting installed it will be marked as false for example.
This is may general setup since 5.1 with out issue.
Build or rebuild or clean solution doesn't cause any issues.
We're doing that, my point is that we shouldn't have to. I don't know what happened during our upgrade to 6.3.5 since I didn't do it, but the references were changed to point to the /bin folder. Now I have to go through the exercise of pulling out the dlls again and editing the project file to point to their new locations. I've got much better things to do with my time.