Incomplete string version in DLL manifest - dll

Every time when I'm trying to load the .dll in my application, I'm getting an error.
I don't get any errors when I'm building it.
Here is a extracted manifest from my .dll, I don't see anything problematic here, except for the string version
Is this string version normal, if not how can I fix it?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50727.6195" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.DebugMFC" version="8.0.." processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>

version="8.0.."
No, that's not normal and most certainly will cause your program to fail to start. This string comes from vc\atlmfc\include\mfcassem.h, it probably got damaged. Do not edit the file to repair the damage, copy it from another machine. That way updates will still work properly.

Related

Reg-Free COM written in 1C language

I'm writting application in C which calls functions from a DCOM object.
The DCOM is stored in DLL written in 1C language.
My application is working fine when DCOM is registred in a system.
Is there is a way to call functions from the *.dll using Reg-Free (I mean: without registration the .dll in a system)?
I've tried many times to do so but I've failed.
I used mt (from Visual Studio) to embed a manifest xml to the dll but it doesn't work .
The .dll manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="Win32" name="DrvFR" version="1.0.0.0"/>
<file name="DrvFR.dll">
<comClass clsid="{E187099F-8C5C-4723-8866-D8DBB6353ADE}" threadingModel="Apartment"/>
</file>
</assembly>
My application manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="Win32" name="AutomaticCommPortDetector" version="1.0.0.0"/>
<dependency>
<dependentAssembly>
<assemblyIdentity type="Win32" name="DrvFR" version="1.0.0.0"/>
</dependentAssembly>
</dependency>
</assembly>

System.Net.Http.Formatting.dll in package Microsoft.AspNet.WebApi.Client 5.2.3. doesn't seem to work

I have a vb.net class library project targeting .net 4.5.1 framework. I am using Visual Studio 2013 community edition.
The project is a library consuming a webapi 2 REST API.
As a guide I am using this example.
Project's packages.config is the following:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net451" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net451" />
</packages>
Project's assemblies references are:
Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL
System
System.Data
System.Net.Http
System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
<HintPath>..\..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
System.Xml
System.Core
System.Xml.Linq
System.Data.DataSetExtensions
app.config file is:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
</configuration>
The problem is that System.Net.Http.HttpClient extensions defined in Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll aren't loaded so functions like
System.Net.Http.HttpClientExtensions.PostAsJsonAsync(Of T)
and
System.Net.Http.HttpClientExtensions.PostAsXmlAsync(Of T)
aren't available.
In Object Browser System.Net.Http.HttpClientExtensions class defined in System.Net.Http.Formatting assembly under the System.Net.Http namespace are grayed out as you can see in the following screenshot:
I found several related questions like this one but the provided answers and suggestions in comments didn't work for me.
I tried several other recommendations from various internet sources, like for example replacing the reference of System.Net.Http.Formatting.dll found in Microsoft.AspNet.WebApi.Client package with the one found in the extensions assemblies area but didn't work either.
Now I am stuck and I don't know how to solve this. Any help will be highly appreciated.
EDIT
It appears that the grayed out classes in the object browser are just hidden classes (meaning they cannot be used directly in user's code) and have nothing to do with the problem described.

Using WiX to update manifest file

I have a manifest file for an application which looks something like this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="xxx.exe" version="1.1.0.0" type="win32" processorArchitecture="x86" />
<file name="xxxxxxxx.ocx" hashalg="SHA1">
<comClass clsid="{4xxxxxxx76-D693-4156-93BA-B938A56F15D3}" description="" threadingModel="apartment" />
<typelib tlbid="{8xxxxxx-3A75-4708-993D-6E0CD9564072}" version="1.0" helpdir="" flags="control,hasdiskimage" />
</file>
<dependency>
<dependentAssembly>
<assemblyIdentity name="Assembly numero uno" version="1.1.0.0" type="win32" publicKeyToken="7XXXXXXXXXXXD" />
</dependentAssembly>
</dependency>
</assembly>
I want to add a new <dependency> section right after the </dependency> tag. The new <dependency> should look like this:
<dependency>
<dependentAssembly>
<assemblyIdentity name="Assembly number two" version="1.1.0.0" type="win32" publicKeyToken="7XXXXXXXXXXXD" />
</dependentAssembly>
</dependency>
How can I achieve this with Wix?
First of all, consider modifying the manifest at build time. If that's possible, it is much more preferable - always choose build-time complexity over install-time complexity.
It might make sense to leave this for install time only in case <dependency> element contents depends on the user input or the target system state. In this case you should use one of the WiX options to modify XML, either XmlFile #OleksandrPshenychnyy mentioned, or XmlConfig. I used the latter one more often, as it seems to be more flexible.
If you decide to go for modifying the manifest at install-time, you can still make your life a bit easier. Add the XML pattern to the manifest at build-time, and only modify the parts dependent on the user input or system state at install time. Let's say it is assemblyIdentity/version attribute. Then the WiX snippet might look like this:
<util:XmlConfig Id="VersionChange" ElementPath="assembly/dependency/dependentAssembly/assemblyIdentity[\[]#name='Assembly number two'[\]]" File="$(var.Manifest)" Name="version" Action="create" Node="value" On="install" PreserveModifiedDate="yes" Value="1.1.0.0" />
Note the square brackets escaping technique.
You can use WisUtilExtention library with XmlFile Element to perform some manipulations with XML file. For more details visit this link

Could not load file or assembly Telerik.Sitefinity

having some issues upgrading my Sitefinity 4.1.1339.0 installation to 4.3 (and ultimately to Sitefinity 5). It is giving me the following error:
Could not load file or assembly 'Telerik.Sitefinity, Version=4.1.1339.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I was thinking it was the /bin/Telerik.Sitefinity.dll file but everything seems to be updated in there.
Any ideas?
Thanks!
I agree with #Josh, plus you might try looking through all your files in the App_Data\Sitefinity\Configuration folder. I had to update all of the references in those files manually for some reason to match the exact DLL version. Make sure you completely restart your cassini/IIS/sitefinity instance to pick up the changes.
If you are using 'assemblyBinding' in your Sitefinity web.config, you will need to update that section of the config to the latest dll versions. Assembly Binding is a common solution to map out of date third party Sitefinity modules/plugins to the current Sitefinity dlls.
The following are correct versions for Sitefinity 5.1.3210. Note that Telerik.Web.UI is a different version as it is from a different Telerik product line.
<!-- From web.config - not complete file -->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Telerik.Sitefinity" publicKeyToken="b28c218413bdf563" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="5.1.3210.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Telerik.Sitefinity.Model" publicKeyToken="b28c218413bdf563" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="5.1.3210.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2012.2.607.40"/>
</dependentAssembly>
</assemblyBinding>
If you will be upgrading through many versions 4.1 -> 4.4 -> 5.0 -> 5.1, you may wish to comment out this section of the config until you are complete with your upgrades, then add it back in. Otherwise, you'll have to edit these three lines after each upgrade.
Note: to get the dll version, browse to the bin folder. Right click dll file, click properties, then select the 'details' tab.

How to ship gdiplus.dll but not have Windows use it?

i have an application that has a dependancy on gdiplus. i need the application to also run on Windows 2000.
i want to include GDIPlus in the application directory, so that Windows 2000 computers will function, but if the machine is Windows XP, Windows Vista, Windows 7, etc, i want it to use the version of GDIPlus that ships, and is updated, with Windows.
Not possible?
From http://msdn.microsoft.com/en-us/library/ms997620.aspx Try adding the following to your manifest :-
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="x86"
name="Microsoft.Windows.mysampleapp" type="win32" />
<description>Your app description here</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.GdiPlus"
version="1.0.0.0" processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
Won't it be easier to do it from the installer ? IF you are installing on Windows 2000 copy Gdiplus to application directory otherwise skip it.
From the GDI+ page:
Run-time Requirements
Gdiplus.dll is included with Windows
XP. For information about which
operating systems are required to use
a particular class or method, see the
More Information section of the
documentation for the class or method.
GDI+ is available as a redistributable
for Windows NT 4.0 SP6, Windows 2000,
Windows 98, and Windows Me. To
download the latest redistributable,
see
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdkredist.htm.
First hit on Google for "win2000 gdiplus".