澄清`.dll.refresh`文件,源代码控制和asp.net网站项目的构建 [英] Clarifying `.dll.refresh` files, source control, and build of an asp.net web site project
问题描述
我正在ASP.NET网站项目(而不是Web应用程序项目中工作 ,表示它没有.csproj
文件).
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).
解决方案的结构如下:
-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)
从源代码管理中重新签出后,在Bin
文件夹中,我有以下内容:
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
...以及roslyn
文件夹中以.dll.refresh
结尾的其他文件,都与上面的csc.exe.refresh
相似.
...and other files in the roslyn
folder ending in .dll.refresh
, all similar to csc.exe.refresh
above.
在建立网站时,这些文件显示在Bin
文件夹中:
Upon building the web site, these files appear in the Bin
folder:
- ajaxcontroltoolkit.dll
- restsharp.dll
- restsharp.dll.xml
但是,Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
不会,roslyn/
中的任何二进制文件也不会.因此,该站点无法验证/运行.
But, Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
does not, and neither do any of the binary files in roslyn/
. Thus, the site cannot validate/run.
我有三个密切相关的问题:
-
仅将以
.refresh
结尾的文件签入到源代码管理(TFS),并假定二进制文件将在构建过程中本地复制是否正确?
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?
即使相对路径错误,如何正确复制ajaxcontroltoolkit.dll
和restsharp.dll
(分别从Solution/dlls
和Solution/packages/RestSharp.105.2.3
)?
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?
为什么同一个魔术不适用于Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
和roslyn
目录中的所有二进制文件?
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.
谢谢.
P.S. 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>
推荐答案
这就是我发现的东西.
- 仅签入源代码管理(TFS)是否正确 以.refresh结尾的文件,并假设二进制文件将被复制 在构建过程中本地化吗?
- 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?
虽然不是,但不一定是构建过程"(用引号表示,因为实际上实际上不是 build ).我发现只需单击解决方案中的另一个项目,然后再次单击网站项目,就会触发复制.或者,也可以单击解决方案资源管理器"顶部栏中的刷新"按钮(当网站项目具有焦点时).
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).
但是有一个警告:这仅适用于直接位于Bin
文件夹中的文件(例如,不适用于Bin/roslyn
中的文件),无论路径是否正确(我什至尝试使用绝对路径,在Bin
,但不在Bin/subdir
下.
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
.
- 如何正确复制
ajaxcontroltoolkit.dll
和restsharp.dll
(从Solution/dlls
和Solution/dlls
Solution/packages/RestSharp.105.2.3
),即使 相对路径错误?
- How are
ajaxcontroltoolkit.dll
andrestsharp.dll
copied correctly (fromSolution/dlls
andSolution/packages/RestSharp.105.2.3
, respectively), even though the relative paths are wrong?
经过一些测试,我得出结论,路径是相对于项目目录的相对路径(在Web应用程序项目中为$(ProjectPath)
).
After some testing I concluded that the paths are relative from the project directory (what would be $(ProjectPath)
in a web application project).
- 为什么同一个魔术不适用于
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
和所有人roslyn
目录中的二进制文件?
- Why is the same magic not working for
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
and for all binaries in theroslyn
directory?
实际上 用于Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll.refresh
.关于roslyn/*
,请参阅问题1的警告.
It was in fact working for Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll.refresh
. Regarding roslyn/*
, see the caveat in question 1.
这篇关于澄清`.dll.refresh`文件,源代码控制和asp.net网站项目的构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!