I've recently added some custom Portable Class Library projects to an application that is built in an build server. The build was working fine, but after that it stopped working and shows me the following messages:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(983,
5): warning MSB3644: The reference assemblies for framework
".NETPortable,Version=v4.0,Profile=Profile136" were not found.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,
5): warning MSB3270: There was a mismatch between the processor
architecture of the project being built "MSIL" and the processor
architecture of the reference
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll",
"AMD64".
error CS0234: The type or namespace name 'Linq' does not exist in the
namespace 'System' (are you missing an assembly reference?)
The build server specs:
Windows Server 2008 R2 Standard
TeamCity 8.0.4
.NET 4.5
Portable Class Library Tools (as advised here)
Silverlight 5 SDK
The solution is a .NET 4.0 application and the portable projects target .NET4.0+ e Silverlight 5, only.
I have checked my development machine (Windows 8, Visual Studio 2012). There is indeed a folder "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.0\Profile\Profile136" (in fact, the profiles for .NET 4.0 go up to 158).
In the build machine, however, there are only folders for profiles up to 131.
Is Portable Class Library Tools up to date? It seems it miss installing profiles for the most recent platforms.
UPDATE
I copied the ".NETPortable\v4.0\Profile\Profile136" of my development machine to the build server, and now the application builds successfully. I still would like to know why installing the Portable Class Library Tools does not work out of the box.
A more general and elegant solution is to install the latest Microsoft .NET Portable Library Reference Assemblies. This will install profile138 among many others.
The standalone installer(s) can be found at:
4.6 (June 2014):
Copying the desired profile (it is explicit in the error message) from the dev machine to the build server, after installing Portable Class Library Tools, allowed my build to work.
Apparently the Portable Class Library, as it is now, does not include the most up to date portable profiles.
If anyone knows of a more up to date way to get portable profiles on a build server, other than installing VS or copying them manually, I really would like to know.
UPDATE
Path, on my dev machine, for the folder to be copied to the server machine (the path in the server was the same):
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.0\Profile\Profile136
Profile136 came with the version of the portable library targeting pack that was part of the Phone SDK 8.0 (or a later VS Update for VS 2012). The version of the targeting pack you were using is older.
Related
I've made a fresh Xamarin Forms Portable Project from the Cross Platform templates in Visual Studio 2015. Haven't touched or modified any of the project files. Then When I try to initially build it, I get the following build error:
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1098,5): error MSB3644: The reference assemblies for framework "MonoAndroid,Version=v6.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
My Project defaults are:
Looking at similar questions, it would seem that, indeed, that version of the framework is not installed. But it seems to be. Android SDK Manager shows the following:
What is going on here? How can I resolve this.
When you get these type of errors, that are really 'out there' and hint of system configuration problems, it's time to reinstall.
I had to completely remove all remnants of Visual Studio, SDKs and Xamarin. 'Modify' and 'Repair' didn't work.
After the complete fresh install of VS 2015 and Xamarin, things are back to normal.
I have a funny error where NuGet will not work in Portable Class Library projects. I have created a portable class library project and when I attempt to search (through the NuGet dialog) or install (through the console) I get the following error:
Specified argument was out of the range of valid values. Parameter
name: supportedFrameworks
I had this error with all projects (Class, etc.) in VS2012 but I followed this advice and it has fixed it except for PCL projects. In a class project the NuGet dialog will list packages and install them just not in PCLs.
What is wrong and how can I fix this?
Note: I am creating a Xamarin Cross Platform project in VS2012 (ie the project is a PCL solution). Maybe this is the cause error - Xamarin's VS Extensions? I am also using VS2012 Professional Trial version - could this be the issue?
Edit Maybe I dont have my PCL setup? For example I dont have the folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile.
As far as I know Visual Studio 2012 does not include any Portable Class Libraries. They are installed with Visual Studio 2013. Otherwise you will have to install them yourself which involves several steps.
Install the Portable Library Tools and the Portable Library Reference Assemblies 4.6.
Extract the PCLs from the .zip file that the Portable Library Reference Assemblies 4.6 installs into C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6.
Copy the PCLs extracted into C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable.
Repair the Xamarin install so it adds its PCL profile xml files to the new PCL directories.
I downloaded Xamarin Studio to build my first application, but I'm having some problems which I have not found a solution.
First of all I have created a new solution with the App Xamarin.Forms Blank template. When I have tried to build it, a few errors have appeared (I did not changed a single line from the template):
The type or namespace name 'Xamarin' could not be found (are you mission a using directive or an assembly reference?)
The type or namespace name 'Application' could not be found (are you mission a using directive or an assembly reference?)
Then I supposed that the Xamarin.Forms package was missing, so I clicked on Project > Add NuGet Packages... and I tried to install the Xamarin.Forms package. Here is where I get stuck, because a new error is displayed:
Could not install package 'Xamarin.Forms 1.3.3.6323'. You are trying to install this package into a project that targets 'portable-Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I would appreciate any help, because I have not found any solution.
The error message suggests that you do not have the Portable Class Libraries (PCLs) installed.
If you are on the Mac you can get these installed by installing the Mono Development Kit (MDK).
If you are on Windows the procedure is a bit more tricky. To install the Portable Class Libraries on Windows you have three options:
Install Visual Studio 2013 (full or Express version). Update 2 or above is required.
Install the Portable Library Tools and the Portable Library Reference Assemblies 4.6.
Install the Portable Library Tools and copy the .NETPortable directory from Mono over to Windows.
One problem with 2. is that installing the Portable Library Reference Assemblies 4.6 does not install them into the correct location but instead just installs a PortableReferenceAssemblies.zip file into the directory:
C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6
This PortableReferenceAssemblies.zip file contains three directories (4.0, 4.5 and 4.6) which need to be extracted and copied into the PCLs directory:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable
There is more detail in the Installing Portable Class Libraries for Xamarin Studio post but the above should give you an overview of what is required.
I have installed TeamCity Professional 8.1.3 (build 30101) onto a clean box and I am trying to run a new build. I have copied over the msbuild tools from my local dev machine to the new server and placed them in the x86 folder. I have also installed the IIS web role, .net feature, registered IIS from the cmd line, and installed MSBUILD tools 2013. For some reason, I still am unable to compile anything. I get the following error
SGEN An attempt was made to load an assembly with an incorrect format:
C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll.
Is anyone familiar with this error? I am trying to build an app in .NET v4 using msbuild tools v4.
I was getting this error building a project that targeted .NET Framework 4.5.1. I resolved the issue by installing Microsoft .NET Framework 4.5.1 Developer Pack
You can get the SDK (aka Targeting Pack, aks Developer Pack) for other versions you may want to target at .NET SDKs and Downloads
The solution was installing VS2012 on my build machine. This may not be the most efficient, but it beats installing small packages and chasing around things that need to be registers in the GAC.
When I run any project from Visual Studio, it works excellent (on Motorola MC 3190 - WinCE 6.0)
However, when I install and run the application on the device, I get this error:
No compatible FusionInterface dll found, Expected version is 4.1.0.1 or higher version having the format 4.x.x.x
What could be the problem?
In my case, deploying Symbol.Fusion.dll and FusionInterface.dll files in the same directory than my executable has resolved this error.
You must install the symbol.all.arm.cab file. If you are using Windows CE then you need the armv4 version. If you are using Windows Mobile, then you need the armv4i version.
Also, make sure there is no local copy of the DLLs in your application's directory; this could be possibly causing a version mismatch.
Adding a reference to Symbol.ResourceCoordination worked for me. Per the CS_FusionSample1 code example included with the Motorola EMDK v2.9, the relevant Symbol references are Symbol, Symbol.Fusion, and Symbol.ResourceCoordination.
Note, I'm building for a Motorola 9190 handheld under Windows CE 6.0.
Fusion Interface DLL Version Compatibility
EMDK for .NET access Fusion Public API via Fusion interface DLL as mentioned in the Overview section. There can be different versions of Fusion Public API and in return many versions of Fusion Interface DLLs.
Version Incompatibility Issue
If this DLL is incompatible with EMDK, an appropriate meaningful error message will be provided in the exception when trying to access Fusion. This occurs when creating Config and WLAN objects.
Possible Messages
Older and incompatible FusionInterface dll 1.0.0.1 found. Expected version is 2.0.0.3 or higher version having the format 2.x.x.x
Newer and incompatible FusionInterface dll 3.1.0.5 found. Expected version is 2.0.0.3 or higher version having the format 2.x.x.x
Solution
The DLL version incompatibility arises because of the two files (Fusion Interface DLL and the Fusion Assembly DLL) taken from different EMDK packages. To fix the issue,
Method 1:
Remove "Symbol Managed Class Libraries" using "Remove Programs" in the control panel of the device.
Check "\Windows" folder of the device for any existence of "FusionInterface.dll" and if so, delete it.
Take the "symbol.all.arm.cab" from EMDK installed location, copy to the device and run installation.
The typical location is the appropriate sub directory (wce400\armv4 or wce500\armv4i) of "\Program Files\Enterprise Mobility Developer Kit for .NET\v2.x\SDK\Smart Devices".
Run the application.
Method2:
Copy the appropriate DLL to the \Windows directory of the device.
Run the application
Note: This DLL is not separately available in the EMDK for .NET package.