Visual Studio-DevExpress Click-Once dll's dependancy error - visual-studio-2010

I have developed the Windows application.
I have used devexpress tool in that app.
I have used click once to publish the application to publish it.
while publishing first time, it I have added almost all devexpress dll's while publishing it.
Now, I am publishing next version and I have removed some dll's which are not req. and I am trying to publish it.
But It gives below error.
System.IO.FileNotFoundException: Could not load file or assembly
'DevExpress.XtraTreeList.v12.2, Version=12.2.5.0, Culture=neutral,
PublicKeyToken=b88d1754d700e49a' or one of its dependencies. The
system cannot find the file specified. File name:
'DevExpress.XtraTreeList.v12.2, Version=12.2.5.0, Culture=neutral,
PublicKeyToken=b88d1754d700e49a'
The error is because of earlier I have published with all dlls and now I am publishing with fewer dlls by removing/excluding unnecessary dll files from application Files.
So it showing dependency error.
How to solve this ?

It seems that in your application you are using the XtraTreeList control or controls which depends on it. If so the DevExpress.XtraTreeList.v12.2.dll assembly should be deployed.
You can check the lists of the assemblies required for deployment based on the product(s) you're using.
For example, if you are using reports? please check the Assemblies Deployed with Windows Forms Reporting Applications article.
There is an easy way to collect the DevExpress assemblies required for distribution of application - A tool for collecting the required DevExpress assemblies for further application deployment
To add required assemblies based on products you're using, in DevExpress Assembly Deployment Tool choose the By Products tag page and check the corresponding (XtraTreeList) item.

Related

Visual Studio Installer Project packaging DotNetCore instead of Framework

I've been going circles on this one for over a day now. I have a WPF project that is making use of sqlite-net-pcl.
I'm ready to package this project up into an MSI for distribution (x64). The first hitch was that I need to directly add the nuget for the dependency (SQLitePCLRaw.bundle_green). I've come across this before when a nuget package contains content files that need to find their way into the final release. Smooth sailing.
At this point, the bin/x64/release is good and runs fine. However, when I build an installer and run the installed version I get the following exception:
System.BadImageFormatException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058) ---> System.BadImageFormatException: Cannot load a reference assembly for execution.
Doing a file compare between my release folder and the application install folder I find the following:
Binary Difference: System.Buffers.dll
Binary Difference: System.Numerics.Vectors.dll
Binary Difference: System.Runtime.CompilerServices.Unsafe.dll
Installer Only: netstandard.dll
Installer Only: System.Diagnostics.Tracing.dll
Installer Only: System.IO.Compression.dll
Installer Only: System.IO.Compression.FileSystem.dll
Installer Only: System.Net.Http.dll
After inspecting further and digging in to the DLLs, I find if I overwrite System.Runtime.CompilerServices.Unsafe.dll with the binary from my release folder everything works.
Digging in even further and inspecting the installer version of CompilerServices.Unsafe I realize that the installer is grabbing the dotnet core version of the DLL.
I've isolated this down to a single console app with a fresh installer project and only adding the content and output to the installer.
Why is the installer insisting that the dependency is a dotnet core version?
I'd like to find a real solution, but in the meantime I found some confirmation and a dirty workaround in this thread: https://developercommunity.visualstudio.com/content/problem/810090/visual-studio-installer-projects-extensions-incorr.html
Workaround option 1: In addition to adding the “Primary Output” of the project containing the package reference also add “Locally-Copied Items” for that project. This will result in the lib version of the assembly overwriting the ref version, giving you the behavior you want. However, you’ll also get a warning about the duplicate file being added, since as I said the lib version will be overwriting the ref version. This also could bring in additional files like xml doc files that should have no impact at runtime but may increase the size of the installer. These can also be individually excluded from the setup project.

Mixed targets in VSTS build

We have an aspnet-core application which consists of several .net standard libraries, two aspnet-core mvc applications and, exceptionally, a .net framework console application.
These all build successfully, both in solution in Visual Studio, and also individually using msbuild/dotnet build commands.
We are now trying to implement continuous integration/build with VSTS.
We have found that the aspnet-core web applications build successfully, but the .net framework console application fails with multiple error messages like the following:
2017-12-24T07:20:26.4090447Z C:\Program
Files\dotnet\sdk\2.0.3\Microsoft.Common.CurrentVersion.targets(1988,5):
warning MSB3245: Could not resolve this reference. Could not locate the
assembly "Xxx.Core, Version=1.1.0.0, Culture=neutral,
processorArchitecture=MSIL". Check to make sure the assembly exists on disk.
If this reference is required by your code, you may get compilation errors.
[d:\a\1\s\WinApps\ListBuilder\ListBuilder.csproj]
C:\Program Files\dotnet\sdk\2.0.3\Microsoft.Common.CurrentVersion.targets(1988,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.EntityFrameworkCore, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\1\s\WinApps\TelemListBuilder\TelemListBuilder.csproj]
The console application follows the same folder structure as the web applications but seems unable to find any of the referenced packages.
Our Agent queue is Hosted VS2017.
We have two VSTS tasks: Restore and Build from the asp.net core build template.
If necessary we would be happy if we could exclude the console app from the build.
Since there are general .net framework project and .net core project and you want to build them together, you need to use Visual Studio Build task.
So, remove .Net Core Restore and .Net Core build tasks and add NuGet Tool Installer (4.3.0), Nuget restore and Visual Studio Build tasks (Visual Studio Version: Latest or Visual Studio 2017)
If you want to generate the deployment package during the build, you can specify MSBuild arguments like this:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)"

Visual Studio Redeploy feature for BizTalk solution does not work

My BizTalk solution has 10 BizTalk projects that are referenced between each other.
In each project's properties I have set redeploy feature to 'true' (it's by default).
But when I try to redeploy the whole solution from VS 2012, I get following errors for some projects in solution:
Error 201 Failed to add resource(s). Change requests failed for some
resources. BizTalkAssemblyResourceManager failed to complete end type
change request. Cannot update assembly "Project1, Version=1.0.0.0,
Culture=neutral" because it is used by assemblies which are not in the
set of assemblies to update. To update the assembly, remove the
following assemblies: Project2, Version=1.0.0.0, Culture=neutral
Project3, Version=1.0.0.0, Culture=neutral Project4, Version=1.0.0.0,
Culture=neutral Project5, Version=1.0.0.0, Culture=neutral Project6,
Version=1.0.0.0, Culture=neutral
As I read from this article:
http://blog.codit.eu/post/2013/07/30/Redeployment-notes-of-a-BizTalk-solution-from-Visual-studio.aspx
In the process of deploying a BizTalk assembly, you first needed to
manually stop, unenlist, and unbind artifacts contained in the
assembly in BizTalk Server and then remove the assembly from the
BizTalk Management (configuration) database before deployment. Visual
Studio will handle all those steps for you with this option Redeploy.
What could be the reason of my problem and possible solution?
Please check if you use subfolders in your solution.
I suggest to create new (additional) solution just for deployment purpose where you should avoid to use any solution subfolders
Andrei
You can try deleting the temp binding files at: C:\Users\%username%\AppData\Roaming\Microsoft\BizTalk Server\Deployment\BindingFiles
Then try again.
Check that one of the assemblies hasn't gone into the Default Application rather than the application you are deploying too. If you find one in the wrong place you can right click it and select Move to Application. (The other option is to remove it, but then quite often you have to remove all the dependent ones as well).
Check each project that the Application is set.
Then re-deploy.
This happens quite often, especially if you just got a project down from source control, as the Application is saved in the user file rather than the project file.
Edit: Also check your solution setting to make sure all projects have deploy ticked.
Check in the configuration manager for solution if any project is not marked for deployment. Right click on solution then select Configuration Manager and make sure all projects are selected for deploy,
Apparently there is some problem with BizTalk 2016 party export/import that prohibits re-import of bindings during deploy from Visual Studio.
My workaround is to export bindings manually before deploy, and manually import bindings after "successful" deploy (cited from the deploy log in visual studio ;).
Other reference:
https://social.msdn.microsoft.com/Forums/en-US/c49758c0-0465-4c13-97a3-300c05d00d3a/biztalk-2016-redeploy-and-orchestration-bindings?forum=biztalkgeneral&prof=required

"Could not load file or assembly 'XXX.dll' or one of its dependencies. The specified module could not be found

Path of the dlls are in the Path system environment variable.
It works in a C# windows console application and not in IIS 7.5
If I use dependency walker, it complains about some of the DLLS but how does it work in the console application and not in IIS 7.5
Like #Arran said you need to let us know what assembly or assemblies that are throwing the exception.
Since this is an MVC3 project did you make sure to add your deployable dependencies that MVC 3 requires before publishing?
See this article if you haven't Bin Deploy ASP.NET MVC3

Add Deployable Assemblies option missing from Visual Studio 2010

I've uploaded an MVC3 website and I'm getting this error:
Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file specified.
Having seen this before I know that it's an issue where the libraries I need aren't there. I have to bin deploy.
However I can't find the "Add Deployable Assemblies" option when I right click the project.
And according to this answer:
Starting with MVC 3 Tools Update we are now using Nuget package
references, which means that your project is automatically
bin-deployable. Since the tooling gesture is no longer necessary it
was removed from VS 11.
So why hasn't my application been "automatically bin-deployed" if this is the case?
Any suggestions?
Install Visual Studio 2010 Service Pack1 and you will get the option.
http://iwantmymvc.com/2011-03-23-bin-deploy-aspnet-mvc-3-visual-studio

Resources