First time using the Azure Devops and the first pipeline I set up keeps on failing. I have a project created in VS 2019 to test the new Xero Oauth 2.0 implementation. I have installed the Xero.NetStandard nuget packages and all other nuget packages it requires. Everything is building fine on my work machine.
I then checked-in all my source code items in our Azure Devops, then created a pipeline to test if the solution will build.... guess what it failed.
I've got a whole heaps of warnings saying that the dlls for Xero, basically all dlls installed on my project when I installed Xero.NetStandard nuget packages cannot be resolved because they are not on the disk.
I was under the impression that the Nuget restore part of the pipeline is responsible for making sure all these nuget packages will be installed in the build agent. The nuget restore part of my pipeline says "All packages listed in packages.config are already installed."
So I am lost why these warnings are appearing. Am i missing a step in building the pipepline?
Would really appreciate any thoughts and help. Thank you.
These are some warnings I am receiving which in turns create errors on the build.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e7877f4675df049f, 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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "JsonSubTypes, Version=1.5.2.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "KellermanSoftware.Compare-NET-Objects, Version=4.57.0.0, Culture=neutral, PublicKeyToken=d970ace04cc85217, 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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Configuration, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Configuration.Abstractions, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Configuration.Binder, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.DependencyInjection, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Http, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Logging, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Logging.Abstractions, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Options, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Primitives, Version=3.1.8.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "RestSharp, Version=106.11.4.0, Culture=neutral, PublicKeyToken=598062e77f915f75, 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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, 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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, 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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, 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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Xero.NetStandard.OAuth2, Version=0.0.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Xero.NetStandard.OAuth2Client, Version=1.3.1.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\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.CodeDom.Providers.DotNetCompilerPlatform". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\8\s\$(SourceDir)\XeroIntegration\XeroIntegration\XeroIntegration.vbproj]
This is my Agent's job YAML
pool:
name: Azure Pipelines
demands:
- msbuild
- visualstudio
#Your build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references the ‘BuildPlatform’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘BuildPlatform’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references an undefined variable named ‘Parameters.ArtifactName’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
steps:
- task: NuGetToolInstaller#1
displayName: 'Use NuGet 5.8.1'
inputs:
versionSpec: 5.8.1
checkLatest: true
- task: NuGetCommand#2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
feedsToUse: config
nugetConfigPath: '$/XeroAppTest/XeroIntegration/nuget.config'
- task: VSBuild#1
displayName: 'Build solution'
inputs:
solution: '$(Parameters.solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
restoreNugetPackages: true
- task: VSTest#2
displayName: 'Test Assemblies'
inputs:
testAssemblyVer2: |
**\$(BuildConfiguration)\*test*.dll
!**\obj\**
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
enabled: false
- task: PublishSymbols#2
displayName: 'Publish symbols path'
inputs:
SearchPattern: '**\bin\**\*.pdb'
PublishSymbols: false
enabled: false
continueOnError: true
- task: PublishBuildArtifacts#1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(Parameters.ArtifactName)'
condition: succeededOrFailed()
Below is the packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CompareNETObjects" version="4.57.0" targetFramework="net472" />
<package id="IdentityModel" version="4.0.0" targetFramework="net472" />
<package id="JsonSubTypes" version="1.5.2" targetFramework="net472" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.1" targetFramework="net472" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net472" />
<package id="Microsoft.Extensions.Configuration" version="3.1.8" targetFramework="net472" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="3.1.8" targetFramework="net472" />
<package id="Microsoft.Extensions.Configuration.Binder" version="3.1.8" targetFramework="net472" />
<package id="Microsoft.Extensions.DependencyInjection" version="3.1.8" targetFramework="net472" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="3.1.8" targetFramework="net472" />
<package id="Microsoft.Extensions.Http" version="3.1.8" targetFramework="net472" />
<package id="Microsoft.Extensions.Logging" version="3.1.8" targetFramework="net472" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="3.1.8" targetFramework="net472" />
<package id="Microsoft.Extensions.Options" version="3.1.8" targetFramework="net472" />
<package id="Microsoft.Extensions.Primitives" version="3.1.8" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net472" />
<package id="RestSharp" version="106.11.4" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net472" />
<package id="System.Text.Encodings.Web" version="4.7.1" targetFramework="net472" />
<package id="System.Text.Json" version="4.7.2" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
<package id="Xero.NetStandard.OAuth2" version="3.16.1" targetFramework="net472" />
<package id="Xero.NetStandard.OAuth2Client" version="1.3.1" targetFramework="net472" />
</packages>
And finally, this is my nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="My Packages" value="https://dev.azure.com/mycompany/XeroAppTest/_versionControl?path=$/XeroAppTest/XeroIntegration/packages" />
<add key="NuGet official package source" value="https://nuget.org/api/v2/" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
For anyone, having the same issue like mine, I found an issue, rookie mistake. The reason mine is failing is because I also checked in the packages folder that is on my local machine. When I deleted the folder from my repo, the pipeline builds ok. Thank you everyone
I am using linux (Manjaro) and .NET Core 2.2.108 and seems the F# anonymous records are not supported while it is indicated that it is the case for example here
now available with .NET Core 2.2
I have the following F# dummy project:
ConsoleApp.fsproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs"/>
</ItemGroup>
</Project>
Containing this file:
Program.fs:
[<EntryPoint>]
let main argv =
let a = {| A = "Michelle" |}
0
dotnet information:
$ dotnet --version
2.2.108
$ dotnet --list-runtimes
Microsoft.NETCore.App 2.2.6 [/opt/dotnet/shared/Microsoft.NETCore.App]
$ dotnet --list-sdks
2.2.108 [/opt/dotnet/sdk]
The compilation gives me:
$ dotnet build
Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restoring packages for /home/perret/Desktop/ConsoleApp/ConsoleApp/ConsoleApp.fsproj...
Generating MSBuild file /home/perret/Desktop/ConsoleApp/ConsoleApp/obj/ConsoleApp.fsproj.nuget.g.props.
Restore completed in 172.04 ms for /home/perret/Desktop/ConsoleApp/ConsoleApp/ConsoleApp.fsproj.
/home/perret/Desktop/ConsoleApp/ConsoleApp/Program.fs(3,14): error FS0010: Unexpected symbol '|' in expression [/home/perret/Desktop/ConsoleApp/ConsoleApp/ConsoleApp.fsproj]
/home/perret/Desktop/ConsoleApp/ConsoleApp/Program.fs(3,13): error FS0604: Unmatched '{' [/home/perret/Desktop/ConsoleApp/ConsoleApp/ConsoleApp.fsproj]
Build FAILED.
/home/perret/Desktop/ConsoleApp/ConsoleApp/Program.fs(3,14): error FS0010: Unexpected symbol '|' in expression [/home/perret/Desktop/ConsoleApp/ConsoleApp/ConsoleApp.fsproj]
/home/perret/Desktop/ConsoleApp/ConsoleApp/Program.fs(3,13): error FS0604: Unmatched '{' [/home/perret/Desktop/ConsoleApp/ConsoleApp/ConsoleApp.fsproj]
0 Warning(s)
2 Error(s)
Is it normal?
[EDIT]
I thought Rider did update FSharp.Core from 4.5.2 to 4.7.0 but in fact, not really:
$ sudo dotnet add ConsoleApp.fsproj package FSharp.Core -v 4.7.0
Writing /tmp/tmpBQmP0N.tmp
info : Adding PackageReference for package 'FSharp.Core' into project 'ConsoleApp.fsproj'.
log : Restoring packages for /home/perret/Desktop/ConsoleApp/ConsoleApp/ConsoleApp.fsproj...
info : Package 'FSharp.Core' is compatible with all the specified frameworks in project 'ConsoleApp.fsproj'.
error: Error while performing Update for package 'FSharp.Core'. Cannot edit items in imported files -
error: Item 'PackageReference' for 'FSharp.Core' in Imported file '/opt/dotnet/sdk/2.2.108/FSharp/Microsoft.FSharp.NetSdk.props'.
The main issue: the .NET Core SDK Version
#EhouarnPerret if I test it with dotnet sdk version 2.2.2xx, 2.2.3xx, 2.2.4xx, it works fine for me. If I change the sdk to 2.2.1xx, I get the same error as yrs.
Was partially the key.
I basically had to setup the last version available in AUR:
aspnet-runtime-preview 3.0.0+100+preview.013656-2
dotnet-host-preview 3.0.0+100+preview.013656-2
dotnet-runtime-preview 3.0.0+100+preview.013656-2
dotnet-sdk-preview 3.0.0+100+preview.013656-2
Otherwise I was stuck with the version provided in the community packages which are:
aspnet-runtime 2.2.6+108-1
dotnet-host 2.2.6+108-1
dotnet-runtime 2.2.6+108-1
dotnet-sdk 2.2.6+108-1
And there is nothing available between those two out of the box.
I also would like to point out that the version of the package didn't match the version of the SDK:
Package dotnet-sdk 2.2.6+108-1 => Actual .NET Core SDK version 2.2.108 [/opt/dotnet/sdk]
About How to update the FSharp.Core version?
By the way the issue I had about updating the FSharp.Core package to the right version came from this: https://github.com/dotnet/fsharp/issues/3656
Basically the fsproj needs to see:
<FSharpCoreImplicitPackageVersion>4.7.0</FSharpCoreImplicitPackageVersion> in <PropertyGroup>.
(With whatever version you want to have)
Updating the FSharp.Core with nuget explicitly does not work.
[EDIT]
Actually it does, it just needs a little thing, see here
<PackageReference Update="FSharp.Core" Version="4.7.0"/> is what you need to add in *.fsproj, otherwise the build will be confused about which FSharp.Core to reference. This is by design w.r.t how the SDK works.
So basically if you are using the udpate attribute like this here <PackageReference Update="FSharp.Core" Version="4.7.0"/> in <ItemGroup> it's also working.
I believe, this is actually much cleaner and standard than the previous approach.
If you don't any of those above, the version that would be used is the one "assigned" by default with the .NET Core SDK version.
| Arch Package | Actual SDK Version | Default `FSharp.Core` version |
| -----------------------------| ---------------------------- | ----------------------------- |
| `2.2.6+108-1` | `2.2.108` | `4.5.2` |
| `3.0.0+100+preview.013656-2` | `3.0.100-preview8-013656` | `4.6.2` |
So even with the package dotnet-sdk 2.2.6+108-1 and with the version 4.7.0 setup properly for FSharp.Core the anonymous records won't compile since they are part of the 4.6 language version which is not carried by the version of the SDK in that particular package version.
Does the referenced version of FSharp.Core really matter?
In conclusion I just needed to have a more recent version of the .NET Core, the version of FSharp.Core didn't really matter. As a matter of fact:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="4.5.0"/>
</ItemGroup>
</Project>
and a Program.fs like below:
[<EntryPoint>]
let main argv =
let a = {| Diameter = 10; Area = 10; Circumference = 10 |}
0
Still compile while referencing the version 4.5.0 of FSharp.Core.
It seems a bit weird considering that the F# version required for anonymous records is 4.6.0: https://github.com/fsharp/fslang-design/blob/master/FSharp-4.6/FS-1030-anonymous-records.md
Now is F# language version and FSharp.Core relate to the same thing?
Not really.
I installed the free startup template of ASP.NET Boilerplate with the architecture Asp.Net Mvc5.x and Single Page Web Application Angular JS
and when I run the already added test to template as an example which is called Should_Get_Current_User_And_Tenant_When_Logged_In_As_Tenant() which is found in the project
SpecificDownloadedProjectName.Tests
I get the error
Could not load file or assembly 'Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
my current version of castle.core is v4.3.1
and of Abp 3.8.3
and these versions are the last latest available ones in NuGet packages
I tried to update Castle.core via NuGet Package Manager to be 4.0.0 as the exception message mentions but I couldn't with the following error
Severity Code Description Project File Line Suppression State
Error Unable to resolve dependencies. 'Castle.Core 4.0.0' is not compatible with 'Abp 3.8.3 constraint: Castle.Core (>= 4.3.1)', 'Castle.Core-log4net 4.3.1 constraint: Castle.Core (= 4.3.1)', 'Castle.DynamicProxy 2.2.0 constraint: Castle.Core (= 1.2.0)'. 0
what should I do in order to resolve this exception
This is the issue with the Nuget, it doesn't resolve it sometime, so you have to manually add the below lines in the web.config or app.config. You have to make sure the order of the lines also.
<dependentAssembly>
<assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.0.0.0" />
</dependentAssembly>
Note: You can set the oldVersion and newVersion values as per the requirement.
I've got a problem when launching a Canopy test in a Windows box:
Unhandled Exception: System.MissingMethodException: Method not found: 'Microsoft
.FSharp.Core.FSharpFunc`2<System.String,System.String> canopy.core.get_xpath()'.
at <StartupCode$UITest>.$Program.main#()
I guess this is because when compiling it, my Visual Studio 2012 restored Nuget packages and spitted this in the console output:
Consider app.config remapping of assembly "FSharp.Core, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.3.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\FSharp.Core.dll] to Version "4.4.0.0" [C:\Users\Andres\Documents\Code\endtoendtests\packages\FSharp.Core.4.0.0.1\lib\net40\FSharp.Core.dll] to solve conflict and get rid of warning.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0\fsc.exe -o:obj\x86\Debug\UITest.exe -g --noframework --define:DEBUG --optimize- --tailcalls- --platform:x86 -r:C:\Users\Andres\Documents\Code\endtoendtests\packages\canopy.0.9.52\lib\canopy.dll -r:C:\Users\Andres\Documents\Code\endtoendtests\packages\FSharp.Core.4.0.0.1\lib\net40\FSharp.Core.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Numerics.dll" -r:C:\Users\Andres\Documents\Code\endtoendtests\packages\Selenium.WebDriver.2.53.0\lib\net40\WebDriver.dll --target:exe --warnaserror:76 --vserrors --validate-type-providers --LCID:1033 --utf8output --fullpaths --flaterrors --highentropyva- "C:\Users\Andres\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.fs" AssemblyInfo.fs Program.fs
UITest -> C:\Users\Andres\Documents\Code\endtoendtests\UITest\bin\Debug\UITest.exe
How to exactly add this remapping to fix this problem?
Managed to get it to work with this App.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="4.3.0.0" newVersion="4.4.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
This must be because I've never installed F#, so that I'm using the version that comes with my VS2012 (v3.0). I know I know, I should upgrade to 3.1, or 4.0 even.
When I write a c++ program (such as B3DTest.exe) depend on a third party dll(such B3DViews.dll) (the vendor is small company). The program that I wrote is very simple just to test one function in the dll. When I start my program (the needed header file, .lib files and .dll file are linked). I come across the problem below.
The application failed to initialize properly (0xc0150002). Click on OK to terminate
the application.
I find out that the program exit before enter my main function. the out put of the vs2008 IDE is
LDR: LdrpWalkImportDescriptor() failed to probe e:\tlh1987\vs2008projects\B3DTest\Debug\B3DViews.dll
for its manifest, ntstatus 0xc0150002
I put the program and the dll in an other target computer and it works fine. So I think it must be something wrong with my computer. I searched the event log and it says below for three event
EventID: 32
Description: Dependent Assembly Microsoft.VC80.CRT could not be found and Last Error was The referenced
assembly is not installed on your system.
EventID: 59
Description: Resolve Partial Assembly failed for Microsoft.VC80.CRT. Reference error message: The
referenced assembly is not installed on your system.
EventID: 59
Description: Generate Activation Context failed for Generate Activation Context
E:\tlh1987\vs2008projects\B3DTest\Debug\B3DViews.dll. Reference error message: The operation completed
successfully.
I search The Internet to find out that someone fix a similar problem by installing Microsoft Visual C++ 2005 Redistributable Package and the Microsoft Visual C++ 2005 SP1 Redistributable Package (x86).
I download the two files and installed it. However, it couldn't work!
Another solution on the internet is Put the files of Microsoft.VC80.CRT folder which include 3 dll and Microsoft.VC80.MFC folder (also include 4 dll) and finally the correspond manifest files in the dir of B3DTest.exe (my program). However, It still didn't work! But something has changed the event log where there is only 1 event error which says below:
EventID: 59
Description: Generate Activation Context failed for Generate Activation Context
E:\tlh1987\vs2008projects\B3DTest\Debug\B3DViews.dll. Reference error message: The operation completed
successfully.
Somebody told me that may be the version of the VC80.CRT and the VC80.MFC in my computer didn't match the version number in the B3DViews.dll (which is distributed by the vendor). Then I open the B3DViews.dll with emacs.exe and search the manifest attached to the dll. It says below:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.6195"
processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.MFC" version="8.0.50727.6195"
processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0"
processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.MFC" version="8.0.50608.0"
processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>
the version number made me confused. How can it is 8.0.50727.6195 as well as 8.0.50608.0 It think it should be one version number (not two as showed above). I find the Microsoft.VC80.CRT dlls and the Microsoft.VC80.MFC dlls and also the correspond manifest files (all the version numbers is 8.0.50727.6195 in the C:\Windows\WinSxS and put it in the dir the same as B3DTest.exe (my program). It couldn't work either.
In order to figure out the problem. I used the Dependency Walker for Win32 (x86) to profile my program i.e. B3DTest.exe. It says below:
Started "B3DTEST.EXE" (process 0x680) at address 0x00400000. Successfully hooked module.
Loaded "NTDLL.DLL" at address 0x7C920000. Successfully hooked module.
Loaded "KERNEL32.DLL" at address 0x7C800000. Successfully hooked module.
DllMain(0x7C920000, DLL_PROCESS_ATTACH, 0x00000000) in "NTDLL.DLL" called.
DllMain(0x7C920000, DLL_PROCESS_ATTACH, 0x00000000) in "NTDLL.DLL" returned 1 (0x1).
DllMain(0x7C800000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL" called.
DllMain(0x7C800000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL" returned 1 (0x1).
Injected "DEPENDS.DLL" at address 0x08370000.
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL" called.
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL" returned 1 (0x1).
Loaded "B3DVIEWS.DLL" at address 0x10000000. Successfully hooked module.
LDR: LdrpWalkImportDescriptor() failed to probe e:\tlh1987\vs2008projects\b3dtest\debug\B3DViews.dll
for its manifest, ntstatus 0xc0150002
First chance exception 0xC0150002 (Unknown) occurred in "NTDLL.DLL" at address 0x7C9873BE.
**Second chance exception 0xC0150002 (Unknown) occurred in "NTDLL.DLL" at address 0x7C9873BE.**
Exited "B3DTEST.EXE" (process 0x680) with code -1072365566 (0xC0150002).
It drives me crazy. I wan't to figure it out. any help will appreciated!
This(http://www.codeguru.com/forum/showthread.php?t=408061) may help to the problem. But I can not figure it out by reading it.
my system is windows xp sp3 and I using VS2008. I didn't install VS2005.
I figure it out somehow. with the help of this Q&A
http://social.msdn.microsoft.com/Forums/nb-NO/vssetup/thread/fa559cb7-eabc-4f41-a3bc-84ed7ae089fc
first, I uninstalled all the Microsoft Visual C++ 2005 Redistributable Package
second, I installed Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) directly. It didn't work either, but when I installed
Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update
It just works. It seems that the Update del the old version of Microsoft Visual C++ 2005 Redistributable Package, then make the new one (the sp1 one) to work.
First, I uninstalled all the Microsoft Visual C++ 2005 Redistributable Package
second, I installed Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) directly. It didn't work either, but when I installed
Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update
It just works
0xC0150002L is STATUS_SXS_CANT_GEN_ACTCTX. The tool for debugging activation context issues is SxsTrace. Try this:
touch program.exe
SxsTrace Trace -logfile:SxsTrace.etl
[run program.exe]
SxsTrace Parse -logfile:SxsTrace.etl -outfile:SxsTrace.txt
SxsTrace.txt will contain the name of the assembly that is referenced and can't be found.