Here's my setup. I have a classic .Net website, not web app. I have all my compiled objects in a self-hosted nuget repo. When I build in VS, it looks at my packages and copies the binaries to the bin folder but when I try and build in Azure DevOps it's not working. My Nugets restore just fine but I haven't hit on the right msbuild arguments to make it work. I know that .Net websites are not common these days. I found this (How to use NuGet packages with an ASP.NET Website on CI Server) which was a path I was considering (putting .refresh.dll files in source control) but it seems like there should be an easier way.
Asked
Active
Viewed 1,177 times
3
-
This is related to a related question I just asked: [Clarifying `.dll.refresh` files, source control, and build of an asp.net web site project](https://stackoverflow.com/q/55818553/3258851). – Marc.2377 Apr 23 '19 at 21:43
1 Answers
2
How do I get my nuget packages copied to bin during a build for a asp.net website (not web app)?
What you are considering (putting .refresh.dll files in source control) is the most appropriate way.
From here:
They are simple because if you view them in a text editor, you’ll see they contain nothing more than the full path to the dll.
Turns out, these dll.refresh files are an exception to the rule, and they should go into source control. Its the only way your web project will know where its references live.
For building and package restore to work, you can keep the bin folder and any .refresh
files. You can remove the other binaries from your version control system.
Hope this helps.

Leo Liu
- 71,098
- 10
- 114
- 135
-
Thanks. I'll try this and let you know. I'll mark it as the answer if it works. – Jay Dec 13 '18 at 19:00
-
I've included the refresh files into my repo but I'm still not building cleanly. It builds in VS 2017 but not Azure DevOps. It's giving me "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level." I've checked all my config files and all looks ok. Is it possible that a config generated during the build is causing this problem? Any easy way to debug this? The section it's complaining about is
but if I comment that out it just fails on another section. – Jay Dec 14 '18 at 21:05