如何更新网站中的程序集程序集引用?
我正在使用 FinalBuilder Pro 7 进行构建。
我有一个 ASP.NET 网站,我正在尝试使用 FinalBuilder 的“预编译 Asp.net 2.0 应用程序”操作。好吧,它失败了。
为了成功构建它,我需要运行 Visual Studio,打开网站,然后从 VS 中手动构建它或手动更新所有引用。之后就可以了。
现在的问题是:如何强制 FinalBuilder 更新这些引用?即使我创建与网站关联的 Web 部署项目并尝试使用 msbuild 操作构建它,它也会因同样的原因而失败。不知何故,这两个操作都不会自动更新引用。
更新:好的。也许我需要强制 msbuild 更新引用。怎么做呢? 我发现了一些可以在 msbuild 操作中更改的属性。 在调用 ResolveAssemblyReferencesDependsOn
时,我尝试设置 value = true
。没有帮助。 有什么想法吗?
I'm making a build using FinalBuilder Pro 7.
I've an ASP.NET web site and I'm trying to use FinalBuilder's "Precompile Asp.net 2.0 Application" action. Well, It fails.
To build it successfully I need to run Visual Studio, open the web site and either build it manually from within VS or manually update all references. After that it works.
Now the question: How to force FinalBuilder to update those references? Even if I create web deployment project associated with the web site and try to build it with msbuild action it would fail for the same reason. Somehow neither action updates references automatically.
Update: OK. Maybe I need to force msbuild to update references. How to do that?
I found some properties that I can change at msbuild action.
On called ResolveAssemblyReferencesDependsOn
I tried to put the value = true
. Didn't help.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不能 100% 确定我理解这个问题,但我相信您需要能够自动更正程序集引用上的某些路径。
我创建了一个项目来处理这个问题(以及其他一些事情): refswap.codeplex.com
I'm not 100% sure I understand the problem, but I believe you need to be able to correct some pathing on an assembly reference automatically.
I created a project to handle this (along with some other things): refswap.codeplex.com
.NET 中有不同类型的项目,如库项目、网站项目、Web API 项目等。正如您在问题中提到的,它是一个网站项目,所以我将为您提供一个网站项目的解决方案。
您可以通过两种方式构建项目。您可以通过 Visual Studio 构建,也可以使用 MS Build 构建。如果您使用 VS 构建项目,则可以通过在包管理器控制台中执行命令“Update-Package -reinstall”来更新依赖项的引用。它将自动重新安装所有软件包。
请注意,您的所有依赖项都列在packages.config 文件中。
其次,如果您必须使用 cmd 提示符通过 MS Build 构建项目,以从 nuget 加载所有依赖项,则必须执行 nuget.exe。通过它,您的所有依赖项都将被加载,但它们的引用可能不会更新。因此,在网站项目中,您没有 .proj 文件。因此您无法访问依赖项的引用。现在的问题是如何修改依赖项引用?
在网站项目中,程序集的引用存在于其 .refresh 文件中。因此,您必须修改该 .refresh 文件以更新网站项目中程序集的引用。
There are different types of projects in .NET like library project, website project, web API project etc. As you mentioned in your question it is a website project, so I am going to give you a solution for website project.
You can build a project by two ways. Either you can build by visual studio or you can build by using MS Build. If you build your project by using VS, you can update references of your dependencies by executing the command "Update-Package -reinstall" in package manager console. It will reinstall all the packages automatically.
Please note that, all your dependencies are listed in packages.config file.
Secondly if you have to build your project by MS Build using cmd prompt, to load all the dependencies from nuget, you have to execute nuget.exe. By which all your dependencies will be loaded, but their references may not be updated. So in website project you do not have .proj file. So you can't have access to the references of your dependencies. Now problem is that how you can modify your dependencies references?
In website project reference of an assembly exists in its .refresh file. So you have to modify that .refresh file to update the reference of an assembly in website project.
您是否尝试过使用“构建 VS.NET 解决方案”或“MSBuild 项目”操作?两者都应该解析您的程序集引用,前提是将引用设置到正确的位置。这要求您至少有一个项目文件。
据我了解,预编译操作(使用 MS aspnet_compile.exe - 请参阅 http://msdn.microsoft.com/en-us/library/ms229863(VS.80).aspx) 旨在重新编译以前通过构建的 asp.net 应用程序VS 或 MSBuild。它要么进行就地编译以提高访问该站点的第一个用户的性能,要么创建可部署的应用程序(删除源代码等)。它并不是 VS/MSBuild 的替代品。
Have you tried using the 'Build VS.NET Solution' or 'MSBuild Project' actions? Both should resolve your assembly references, provided the reference is set to the right location. This requires that you at least have a project file.
As I understand it, the Precompile action (which uses the MS aspnet_compile.exe - see http://msdn.microsoft.com/en-us/library/ms229863(VS.80).aspx) is designed to re-compile an asp.net application which has previously been built via VS or MSBuild. It does either an in-place compile to improve performance for the first user that hits the site, or creates a deployable application (removing source code etc). It's not meant as an alternative to VS/MSBuild.