0

I'm working in an ASP.NET Web Site project (as opposed to an Web Application project, meaning it doesn't have a .csproj file).

The solution is structured like this:

-Solution
   |-dlls
   |   |-AjaxControlToolkit.dll
   |-packages
   |   |-Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1
   |   |   |-(...)
   |   |-RestSharp.106.6.7
   |       |-(...)
   |-WebSiteProject
   |   |-Bin
   |   |   |-(.refresh files listed below)
   |   |-packages.config
   |   |-(other website files)

After a fresh checkout from source control, in the Bin folder I have these:

  • AjaxControlToolkit.dll.refresh:

    ..\dlls\AjaxControlToolkit.dll
    
  • Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll.refresh:

    ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
    
  • RestSharp.dll.refresh:

    ..\packages\RestSharp.106.6.9\lib\net452\RestSharp.dll
    
  • roslyn/csc.exe.refresh:

    ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\tools\roslynlatest\csc.exe
    

    ...and other files in the roslyn folder ending in .dll.refresh, all similar to csc.exe.refresh above.

Upon building the web site, these files appear in the Bin folder:

  • ajaxcontroltoolkit.dll
  • restsharp.dll
  • restsharp.dll.xml

But, Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll does not, and neither do any of the binary files in roslyn/. Thus, the site cannot validate/run.

I have three questions, all closely related:

  1. Is it correct to check-in to source control (TFS) only the files ending in .refresh and assume the binaries will be copied locally by the build process?

  2. How are ajaxcontroltoolkit.dll and restsharp.dll copied correctly (from Solution/dlls and Solution/packages/RestSharp.105.2.3, respectively), even though the relative paths are wrong?

  3. Why is the same magic not working for Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll and for all binaries in the roslyn directory?

Note: because this is a web site project, sure there are no pre- or post-build events.

Thanks.

P.S. the contents of WebSiteProject/packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net472" />
  <package id="RestSharp" version="106.6.9" targetFramework="net472" />
</packages>
Marc.2377
  • 5,840
  • 5
  • 43
  • 75

1 Answers1

1

Here's what I found.

  1. Is it correct to check-in to source control (TFS) only the files ending in .refresh and assume the binaries will be copied locally by the build process?

It is, not necessarily by the "build process" though (in quotes because there isn't actually a build per se). I found that simply clicking another project in the solution, then clicking the web site project again, will trigger the copy. Or also, clicking the Refresh button in the Solution Explorer's top bar (when the web site project has focus).

But there is a caveat: this only works for files directly in the Bin folder (not for those in Bin/roslyn for example), no matter if the paths are correct (I even tried absolute paths, which works in Bin, but not under Bin/subdir.

  1. How are ajaxcontroltoolkit.dll and restsharp.dll copied correctly (from Solution/dlls and Solution/packages/RestSharp.105.2.3, respectively), even though the relative paths are wrong?

After some testing I concluded that the paths are relative from the project directory (what would be $(ProjectPath) in a web application project).

  1. Why is the same magic not working for Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll and for all binaries in the roslyn directory?

It was in fact working for Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll.refresh. Regarding roslyn/*, see the caveat in question 1.

Marc.2377
  • 5,840
  • 5
  • 43
  • 75