How to update assembly assembly references in a web site?
Asked Answered
C

3

0

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?

Candycandyce answered 15/10, 2010 at 17:43 Comment(3)
When you say "it fails" what exactly is the error you're getting?Makell
it could find dlls of assemblies that referencing at. But if I build it in VS it works alright, because VS updates references.Candycandyce
Related post - Update DLL referencePitiful
C
2

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.

Cohette answered 11/10, 2018 at 14:2 Comment(0)
F
1

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.

Faso answered 17/10, 2010 at 23:24 Comment(2)
It doesn't work for me... you have to define solution file for that. But It's just a web site's local copy. So, no solution file whatsoever. Sure I can create one. But then I have to store it in repository... that's the entirely different story...Candycandyce
Updated my answer - hope that helpsFaso
S
0

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

Suffix answered 20/3, 2013 at 15:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.