如何在网站上更新程序集程序集引用? [英] How to update assembly assembly references in a web site?

查看:115
本文介绍了如何在网站上更新程序集程序集引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用FinalBuilder Pro 7进行构建.

I'm making a build using FinalBuilder Pro 7.

我有一个ASP.NET网站,正在尝试使用FinalBuilder的"Precompile Asp.net 2.0 Application"操作.好吧,它失败了.

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.

要成功构建它,我需要运行Visual Studio,打开网站并从VS中手动构建它,或者手动更新所有引用.之后就可以了.

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.

现在的问题是:如何强制FinalBuilder更新这些引用?即使我创建与该网站关联的Web部署项目并尝试使用msbuild操作进行构建,也会由于相同的原因而失败.无论哪种方式,两个动作都不自动更新引用.

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.

更新:确定.也许我需要强制msbuild更新引用.怎么做? 我找到了一些可以在msbuild操作中更改的属性. 在名为ResolveAssemblyReferencesDependsOn的位置上,我尝试放置了value = true.没有帮助. 有什么想法吗?

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?

推荐答案

.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.

这篇关于如何在网站上更新程序集程序集引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆