+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / The damage caused to your BIN folder, on rebuilding!

The damage caused to your BIN folder, on rebuilding!

13 posts, 2 answered
  1. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    13 Mar 2013
    Link to this post
    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?



  2. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    13 Mar 2013
    Link to this post
    Would this thread over at stackoverflow be helpful?
    Answered
  3. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    13 Mar 2013 in reply to Arno
    Link to this post
    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 ==========
  4. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    13 Mar 2013 in reply to Lurch
    Link to this post
    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
    Answered
  5. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    14 Mar 2013
    Link to this post
    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.

    All the best,
    Patrick Dunn
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    15 Mar 2013 in reply to Jochem Bökkers
    Link to this post
    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?
  7. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    15 Mar 2013 in reply to Lurch
    Link to this post
    @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"
    ...
    ...

    and then it goes on for a while about each .dll that's referring to system.web.mvc.dll.

    So what's the issue here? 
    When VisualStudio tries to grab all the references and wants to copy back the .dll's into your bin folder, it checks both its .NET Framework folder ( C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0) and where you said the file would be. Visual Studio's simply telling us, "Hey we found MVC 4.0 (which is a .net framework dll) but we also found MVC 3.0 where you said we could find it. Just so you know, we're going to trust you and grab the MVC 3.0 file from your folder"

    ---
    When you're in VisualStudio, go to Tools>Options > Projects and Solutions > Build and Run and set the 'MSBuild verbosity to Detailed'. Rebuild your application and open the output from Build window. Do a ctrl-F for 'There was a conflict' and you'll see it's merely a bunch of version messages where your system (C:\Program Files\...) has newer versions than Sitefinity uses.

    ---
    So nothing is broken, not working or otherwise not in order - the message purely stems from the fact that Visual Studio knows that your system has newer .dll version than you're using.

    I over simplified it but hopefully you'll see its nothing to worry about.
    Jochem.
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    20 Mar 2013
    Link to this post
    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,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    20 Mar 2013 in reply to Radoslav Georgiev
    Link to this post
    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?
  10. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    21 Mar 2013
    Link to this post
    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,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  11. Jamie
    Jamie avatar
    25 posts
    Registered:
    07 Aug 2012
    07 Apr 2014
    Link to this post
    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.
  12. Darrin Robertson
    Darrin Robertson avatar
    105 posts
    Registered:
    18 Jul 2004
    08 Apr 2014 in reply to Jamie
    Link to this post

    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.

     

  13. Jamie
    Jamie avatar
    25 posts
    Registered:
    07 Aug 2012
    08 Apr 2014 in reply to Darrin Robertson
    Link to this post

    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.

13 posts, 2 answered