Azure Git Deployment Could not find file [Project].dll.licenses failure - c#

We have an ASP.NET web application project in BitBucket which has a reference to a Class Library using Telerik Reporting. Telerik Reporting has a license associated (licenses.licx file).
Azure deployment fails with the message:
CSC : error CS1566: Error reading resource '[Project].dll.licenses' -- 'Could not find file 'D:\home\site\repository\src\[Project]\obj\Release\[Project].dll.licenses'.'
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\Home\[PathTo].csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d2bd89fc1c1e79";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="D:\home\[PathTo]\"
This existing question *.dll.licenses file in obj directory not created with msbuild in TeamCity and linked MSDN forum post seem to resolve this by installing extra tools - but I don't believe that would be an option in Azure?
The licenses.licx file in the class library is also set as an Embedded Resource which apparantly trips it up if not set correctly.

We were able to resolve the problem by removing the licenses.licx file from the repository (and ignoring it).

Related

Encountering a error while building .NET web api

While trying to run a .net project i encounter the following error
C:\Users\h.kuhar\source\repos\Vacation2.0\VacationApi\VacationApi\VacationApi.csproj(425,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\6.0.400\Microsoft\VisualStudio\v17.0\WebApplications
\Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\6.0.400\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication
.targets" is correct, and that the file exists on disk.
The project was downloaded of a git repo and the author is currently unavailable for support on the matter

Application is getting crashed with "Component identity found in manifest does not match the identity of the component requested"

My application is getting crash with following error after installing it ,
Activation context generation failed for "C:\Program Files (x86)\ABC\CD\ABC.Y.Services.Host.exe.Manifest".Error in manifest or policy file "C:\Program Files (x86)\ABC\CD\Native.ABC.Y.P.PS.MANIFEST" on line 3. Component identity found in manifest does not match the identity of the component requested. Reference is Native.ABC.Y.P.PS.MANIFEST, type="win32",version="10.1.0.187". Definition is Native.ABC.Y.P.PS.MANIFEST, type="win32",version="13.1.0.45". Please use sxstrace.exe for detailed diagnosis.
However we do not generate ABC.Y.Services.Host.exe.Manifest from csproj file anymore since 2018.
I would like to understand how and where this manifest file coming from?
Deleting this manifest file resolving the issue.
And it is only happening after installing the application.
EDIT1-this is not happening in development phase .this issue only observed on some machine after install it from release branch.

msbuild throwing error for added link for resource in c# project

I want to create a common Version.cs which has copyright and assembly version infromation. I want same file to be refered by 2 projects using Add Link feature. So whenver there is new release I just want to make changes in Version.cs file. My both the prjected located in below location.
Below two projects are generated from
Project 1
C:\remote\local\Sources\myproj-template-archetype\target\test-classes\projects\snap_proj\project\snap_proj\MyLibrary_1
Project 2
C:\remote\local\Sources\myproj-template-archetype\target\test-classes\projects\snap_proj\project\snap_proj\MyLibrary_2
My Version.cs is located in C:\remote\local\Version.cs
Now when I try to build these project using mvn clean install. I am getting error for Version.cs. Error is
[INFO] [exec] CSC : error CS1566: Error reading resource
'Com.org.snap_proj.MyLibrary_1.Com.org.snap_proj.MyLibrary_1.Version.cs'
-- 'Could not find a part of the path 'C:\remote\local\Sources\myproj-template-archetype\target\test-classes\projects\snap_proj\project\snap_proj\MyLibrary_1\Com.org.snap_proj.MyLibrary_1\Version.cs'.'
[C:\remote\local\Sources\myproj-template-archetype\target\test-classes\projects\snap_proj\project\snap_proj\MyLibrary_1.csproj]

How to embed or-tools in a C# application?

I'm trying to follow the instructions at https://developers.google.com/optimization/introduction/installing.html#windows_binary so that I can use or-tools inside my C# application.
I'm stuck on the make all step. I am in the Developer Command Prompt, but this command says:
'make' is not recognized as an internal or external command,
operable program or batch file.
I tried downloading GNU make, but that fails also. make install says "no target", and a bare make says:
process_begin: CreateProcess(NULL, cl /EHsc /MD /nologo /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -nologo /O2 -DNDEBUG -DUSE_CBC -DUSE_CLP /D__WIN32__ /Iinclude\src\windows /DGFLAGS_DLL_DECL= /DGFLAGS_DLL_DECLARE_FLAG= /DGFLAGS_DLL_DEFINE_FLAG= /Iinclude /Iexamples -DUSE_GLOP -DUSE_BOP -c examples\cpp\costas_array.cc /Foobjs\costas_array.obj, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [objs\\costas_array.obj] Error 2
I also tried copying the DLLs from the bin folder directly into my project. I was able to compile against them by doing this, but when I tried to run it I got an error:
System.BadImageFormatException: 'Could not load file or assembly 'Google.OrTools, Version=5.1.6235.37215, Culture=neutral, PublicKeyToken=7a052e3db761d3be' or one of its dependencies. An attempt was made to load a program with an incorrect format.'
What am I missing?
Regarding the System.BadImageFormatException:
The OrTools binary format is provided in a 64bit dll.
Make sure, that your project is set to 64bit:
In Visual Studio you can check it out by right clicking on the Project --> Properties --> Build, Platform Target: This should be set to x64.
In case you have the same issue with web application, just enable 64 bits on IIS Express using Tools -> Options -> Projects and Solutions -> Web Projects -> Use the 64-bit version on IIS Express for web sites and projects
I was having this issue when using OR-Tools in a Web Application (it worked fine in a console application). I was getting:
System.BadImageFormatException HResult=0x8007000B Message=Could not load file or assembly 'Google.OrTools' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Using x64 didn't help, and Octopus was not building the project correctly either. The solution that worked for me was specifying which ASPNETCOMPILER to use (x64) in the project's .csproj :
<Project .... >
<PropertyGroup>
<AspNetToolPath>$(windir)\Microsoft.NET\Framework64\v4.0.30319</AspNetToolPath>
</PropertyGroup>

WebKit.NET with C# Project Runtime Exception

I have downloaded WebKit.NET 0.5-bin-cairo to work with an existing C# Project. I've included WebKitBrowser.dll and WebKit.Interop.dll as a reference to the module that requires it, as well as playing them directly in the debug/bin folder as directly by this tutorial.
I do not get any errors until I run the project and get an exception on this line in InitializeComponent() of the designer class.
this.webKitBrowser1 = new WebKit.WebKitBrowser();
The exception:
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in WebKitBrowser.dll
Additional information: Failed to initialize activation context
I am building all the modules as 86x debug and my computer is 64 bit.
Any suggestions are appreciated as I've been playing around with this for multiple days.
I had encountered same issue. Three things were missing in my scenario.
manifest files: must be placed as all dlls are dynamically linked
VC++ must be installed on machine: In my case I used vc++2005 redistributable sp1.
Not only dlls/pdb/manifest you need to copy all the folders to root directory of executable
There is no correct packaging available yet for all files/folders of webkit.NET
And obviously project architecture should be x86 for all projects referencing webkit dlls
Have you tried:
WebKit.Net and OpenWebKitSharp Error: Failed to initialize activation context ? Namely to copy all the files from Core(not just the dlls) into your project /bin/release/ or /bin/debug/ folder?
quoted from the tutorial you followed:
Before we can run the application, WebKit.dll and it's dependencies must be present in the output directory. In Windows Explorer (or otherwise), copy all of the files from the WebKit .NET 'bin' directory to your project's output directory. For example, here is the listing of my output directory after copying:
D:\webkitdotnet\WebKitTest\WebKitTest\bin\Debug>ls
CFLite.dll icudt40.dll
JavaScriptCore.dll icuin40.dll
JavaScriptCore.resources icuuc40.dll
SQLite3.dll libcurl.dll
WebKit.Interop.dll libcurl.dll.manifest
WebKit.dll libeay32.dll
WebKit.resources libeay32.dll.manifest
WebKitBrowser.dll libpng13.dll
WebKitBrowser.dll.manifest libxml2.dll
WebKitBrowser.pdb libxslt.dll
WebKitTest.exe pthreadVC2.dll
WebKitTest.pdb ssleay32.dll
WebKitTest.vshost.exe ssleay32.dll.manifest
WebKitTest.vshost.exe.manifest zlib1.dll
curl.exe.manifest
You mentioned you only copied WebKitBrowser.dll and WebKit.Interop.dll over

Categories