Missing dll when deploying ClickOnce - reference

When I publish a ClickOnce application, one of the references that is included in one of my projects is missing.
If I go to my project's Properties -> Application Files, this missing reference is not even listed here.
My bin/Release folder has an .exe.manifest file, and I noticed it that it is also missing from here.
However, when I build the project, the DLL is in fact copied to my bin/Release folder.
How can I ensure it also deploys this required dependency?

I finally found a solution for this problem and I hope it will solve your problem to.
In my case, I'm editing an old application at work which have multiple projects, but the main project and it's back end project are the most important here.
The back end is added in the References section of the main project.
In the back end, a third party dll was imported, but this dll requires 2 other dlls.
So those 3 dlls were added in the References section of the back end project.
At that point, one of the 2 other dlls was not showing in the Application Files section for ClickOnce.
I've come up with a couple of ways of fixing it, but the most elegant one was to add this dll in the Reference section of the main project.

As stated in How to: Specify Which Files Are Published by ClickOnce, change the Copy Local property value on the reference to True.
References to assemblies (.dll files) are designated as follows when you add the reference: If Copy Local is False, it is marked by default as a prerequisite assembly (Prerequisite (Auto)) that must be present in the GAC before the application is installed. If Copy Local is True, the assembly is marked by default as an application assembly (Include (Auto)) and will be copied into the application folder at installation. A COM reference will appear in the Application Files dialog box (as an .ocx file) only if its Isolated property is set to True. By default, it will be included.

I know is this an old question, but for anybody having similar issues. I think this is a cleaner way around the problem.
I had a similar issue and everything I did to get ClickOnce to deploy with the offending .dll failed.
Eventually, I had to deploy manually.
See walk-through here.
That worked for perfectly for me. But, for the life of me, I still wonder why that process can't be added to VS (I'm using 2017 community).

Related

'URLHelper' is an ambiguous reference between 'CMS.Helpers.URLHelper' and 'CMS.GlobalHelper.URLHelper'

I upgraded Kentico to hotfix version 48 for CMS 8.2. Now I am getting this error
'URLHelper' is an ambiguous reference between 'CMS.Helpers.URLHelper' and 'CMS.GlobalHelper.URLHelper'
This was working perfectly before the upgrade. I get this error after I login from administrator interface.
CMS.GlobalHelper.dll was renamed to CMS.Helpers.dll (both DLL and namespace), so there shouldn't be both available. Check your project folder (Lib and Bin) and if there is a file CMS.GlobalHelper.dll), then delete it. Only CMS.Helpers should stay there.
Also check your project references and review complete content of those folders, you may have somehow corrupted installation. Ideally compare your project file system with a fresh installation.
In your web.config make sure there is only a reference to CMS.Helpers in the <system.web><namespace> node. Remove the reference to the CMS.GlobalHelpers namespace. Depending on your code, you could also add the full namespace to the code but if this is happening everywhere, then probably not a viable solution.

Building application in Visual Studio 2012 always generates unwanted dll

I am making changes to a web forms application in visual studio 2012 and part of that change is to remove reference to an old dll. The dll is responsible for handling authentication and I have written a new class library to handle this.
My problem is everytime I build my website in the solution, it always generates this old dll. I've annotated out all references to it in the entire application and it's not in the project dependencies of the solution.
If I exclude the unwanted dll, it just generates a new one. I am completely baffled by this. It's something I've not encountered before so I am not sure what else I can do.
I'm not sure what to post so if anyone can help then that would be great.
I had a similar problem (but it was with a persistent DB file being generated). I ended up having to go through the bin from the project file and editing it from there. Some files are 'hidden' from the project, and are either visible by
Make sure you are showing all files. There is a button at the top of
the Solution Explorer called "Show All Files". To see this button,
make sure that your project is selected in the solution explorer.
or by manually going through your project files.
EDIT
It can sometimes be hidden in the Global Assembly Cache (GAC) where it can reside indefinitely. http://msdn.microsoft.com/en-us/library/zykhfde0.aspx explains how to remove it (if it is indeed hiding there).
try this, remove the old project from your Solution.

Visual Studio: Automatic COM registration with dependant DLLs outside Debug/Release dirs

I've written some unmanaged C++ COM DLLs that rely on native C++ DLLs not in the system path. When I build the associated projects without copying the DLLs into the Debug/Release directories I get the infamous PRJ0050 compiler error.
Clearly I could copy required DLLs all around the solution, but I'd like to avoid this. I know I could set project properties Linker->"Register Output" to No and then run regsvr32 directly during a post build step.
My question is if there's a better way to do this. Is there a way to use the automatic "Register Output" option with a custom path controlled at the project level? What am I missing here?
Edit: Originally I'd been thinking "Register Output" did some magic like un-registering on a clean, but that isn't the case. The only thing special it seems to do is pick out the proper way to register different types of projects.
I am not sure what you are asking - but there are post build steps you can do. For example - if these are 3rd party libraries/DLLs you can have them located in a known relative path or in a directory named by an environment variable.
This is not an unusual scenario from what I can tell of your situation.
Can you add a DLL as part of the project (wherever it is located) and as the build step for that do the registration. Or you can make the build step for that a file copy and registration
Again - I am not exactly sure what you are asking and why your 2nd paragraph is not acceptable to you if it works

How to prevent VSeWSS 1.3 from adding assemblies to the solution manifest

I recently upgraded my SharePoint development machine to VSeWSS 1.3 and have noticed a behavior that I didn't think existed before. I have two custom web parts that use several common assemblies, and both will live in the same site. I'm trying to create a third 'common' web part that copies these files to the Bin folder and adds safe control entries to web.config so I can remove one of the web part solutions, if needed, without crippling the other one.
With the prior version of VSeWSS I thought it only included assemblies in the manifest if you included them in the given Visual Studio project. I've removed the common assemblies from the two web part projects, but entries for them still end up in their solution manifests. Obviously the extensions are looking at the references for the web part and going by that, even if the file are in another directory alltogether.
Is there any way to tell the extensions to not add assembly entries to the manifest even if they are referenced in the project? Or is there a better way to separate the common code from the web parts that use it?
Yes you could prevent VSeWSS from deploying assemblies. Just select the assembly in the list of referenced assemblies in you VS project and look at its properties. There you can find the option "LocalCopy", which you have set to false to prevent the assembly from being deployed.

TeamCity path to external reference assemblies

I have been working with setting up TeamCity, and I have almost everything working with the exception of being able to compile VS2005 solutions that have referenced assemblies that are outside of the solution path. I have our SVN repository structured as follows
Root
Libraries
Project 1
Trunk
Project 2
Trunk
Project 1 and Project 2 reference third party assemblies located in the Libraries. This works just fine from within the VS2005 IDE and when calling MSBuild on the solution files since the HintPath for all of the references look like this:
..\..\..\Libraries\ThirdParty.dll
The problem I have encountered is that when TeamCity dies the checkout from SVN for Project 1 or Project 2, it places everything into internal directories that don't match the structure of the relative path given by the HintPath.
How do I go about clearing this up, either through a TeamCity configuration or configuring my solutions/directory structure differently? Either one will work for my needs.
Thanks!
If you create a separate VCS root for Libraries, you can use checkout rules to control where the files are placed in the directory structure so that it matches the structure on your local machine.
We set up a network directory with all our third party dlls. Then we mapped the directory to a drive.
That way the dlls weren't a part of our solutions and all projects just call z:\3rdParty\example.dll to get the assemblies.
Someone else on my team actually set up our teamcity, so I could be completely mistaken about how the problem was actually fixed or if we even had that problem initially :)
What i have done is to set the VCS ROOT of the project to the top level directory ("Root" as per your project structure). And detached the default project vcs root created by teamcity. After this you can create a custom build step by specifying your solution here "Solution file path: *" in build type "Visual Studio (sln)". Now it properly handles library references.
There is a drawback here in that, since the vcs root is at the top level, even unrelated check ins could cause your project to build and that may not be suitable for time consuming builds. Don't have a workaround for that yet.

Resources