I'm having issues using postsharp 5.0.31 and .net core 1.1 on macOS Sierra, I'm getting a build error - visual-studio-code

I'm trying to build a .netcore 1.1 console project using postsharp 5.0.31 on macOS Sierra, but when I run the command line:
dotnet build
The build fail and show the next output;
MacBook-Pro:PostsharpSample userx$ dotnet build
Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
PostsharpSample -> /Users/userx/Documents/VSCode/netcore/PostsharpSample/bin/Debug/netcoreapp1.1/PostsharpSample.dll/Users/userx/.nuget/packages/postsharp/5.0.31/build/PostSharp.targets(564,5): error MSB4062:
The "PostSharp.MSBuild.PostSharp30ChangeAppConfig" task could not be loaded from the assembly /Users/userx/.nuget/packages/postsharp/5.0.31/build/PostSharp.MSBuild.v5.0.31.Release.dll.
Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
The system cannot find the file specified. [/Users/userx/Documents/VSCode/netcore/PostsharpSample/PostsharpSample.csproj]/Users/userx/.nuget/packages/postsharp/5.0.31/build/PostSharp.targets(564,5):
error MSB4062: Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [/Users/userx/Documents/VSCode/netcore/PostsharpSample/PostsharpSample.csproj]
It is possible to use .netcore and Postsharp on macOS Sierra?
I need specific configuration?

As of version 5.0, PostSharp does not support building under any OS other the Windows. .NET Core is supported only as a target framework for your projects.
Please refer to http://doc.postsharp.net/requirements for latest information on compatibility.
You can also vote for adding support for .NET Core as a build platform on this UserVoice page: Support for CoreCLR as a build platform (including Linux, iOS).

Related

Azure DevOps Pipelene doesn't compile .netstandard 2.0 projects

I'm stuck in a rut with this proble. After converting some solution projects in .netstandard 2.0 the pipeline doesn't compile. Other are .NET Framework 4.8 projects.
Here the errors
Installed SDKs: No .NET SDKs were found.
Install the [6.0.400] .NET SDK or update
[E:\myApplicationFolder\global.json] to match an installed SDK.
Download a .NET SDK: https://aka.ms/dotnet-download
I tried the following steps:
installed VS 2022 and tells to the pipeline to use VS 2022 msbuild
installed the .NET sdk
created the global.json choerent with the solution
checked the environment variables (they point to C:\Program Files\dotnet)
checked the version of .NET SDK
This is the global.json
{
"sdk": {
"version": "6.0.400"
}
}
There are the configuration on the pipeline
I don't have any troubles building the solution with msbuild from powershell.
Any other suggestions? Thanks
Many problems, Azure DevOps isn't updated to the latest version and can't manage .NET 6.0 solutions. I had to specify the msbuild of VS 2022 also to restore nuget packages

Cannot Add a Migration using EF Core 6

I have installed Visual Code 2022 preview (17.1). I have created a simple console app following https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli
When I try to add a migration I get the following error
> dotnet ef migrations add One
Build started...
Build succeeded.
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.0.0' (x64) was not found.
- The following frameworks were found:
5.0.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
6.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=win10-x64
Why would it want dot net 2.0?
Add the package Microsoft.EntityFrameworkCore.Design to your main project. if that doesn't work, add to your Data Access layer (project).

Azure devops not running xunit tests

In test run log I have Run UnitTests step, which uses Visual Studio Test. However I see log message:
No test is available in C:\stuff\Debug\x64\bin\x86\ilc\MyApp.Test.dll some_other_dlls Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Test are visible in visual studio, and I can run all of them (I have over 50 tests).
I have xunit.runner.visualstudio package installed. What I am missing, why Azure ignores my tests?
**************** Starting test execution *********************
\vstest.console.exe "#C:\path\fadisfjla.tmp"
Microsoft (R) Test Execution Command Line Tool Version 16.4.0
Copyright (c) Microsoft Corporation. All rights reserved.
vstest.console.exe "C:\dir\Release\x64\bin\arm\MyApp.Test\testhost.dll"
"C:\dir\Release\x64\bin\arm\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll"
"C:\dir\Release\x64\bin\arm\ilc\MyApp.Test.dll"
"C:\dir\Release\x64\bin\x86\MyApp.Test\testhost.dll"
"C:\dir\Release\x64\bin\x86\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll"
"C:\dir\Release\x64\bin\x86\ilc\MyApp.Test.dll"
/Settings:"C:\tmp\fadslfj.tmp.runsettings"
/EnableCodeCoverage
/Logger:"trx"
/TestAdapterPath:"C:\dir\Release\x64"
Starting test execution, please wait...
Test run will use DLL(s) built for framework .NETFramework,Version=v4.0 and platform X86. Following DLL(s) do not match framework/platform settings.
testhost.dll is built for Framework .NETStandard,Version=v1.4 and Platform AnyCPU.
xunit.runner.visualstudio.uwp.testadapter.dll is built for Framework .NETCore,Version=v5.0 and Platform AnyCPU.
MyApp.Test.dll is built for Framework .NETFramework,Version=v4.0 and Platform ARM.
testhost.dll is built for Framework .NETStandard,Version=v1.4 and Platform AnyCPU.
xunit.runner.visualstudio.uwp.testadapter.dll is built for Framework .NETCore,Version=v5.0 and Platform AnyCPU.
Go to more details on managing these settings.
Microsoft (R) Coverage Collection Tool Version 16.0.30319.200
Copyright (c) Microsoft Corporation. All rights reserved.
1.5873
A total of 6 test files matched the specified pattern.
No test is available in C:\dir\Release\x64\bin\arm\MyApp.Test\testhost.dll C:\dir\Release\x64\bin\arm\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll C:\dir\Release\x64\bin\arm\ilc\MyApp.Test.dll C:\dir\Release\x64\bin\x86\MyApp.Test\testhost.dll C:\dir\Release\x64\bin\x86\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll C:\dir\Release\x64\bin\x86\ilc\MyApp.Test.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Microsoft (R) Coverage Collection Tool Version 16.0.30319.200
Copyright (c) Microsoft Corporation. All rights reserved.
Results File: C:\path\fdsfdsfd.trx
Attachments:
C:\path\file-dfsfdsfe.coverage
Vstest.console.exe exited with code 0.
In my project file
<PackageReference Include="xunit.runner.visualstudio">
<Version>2.4.1</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
First, make sure you have added the xunit.runner.visualstudio package. And then make sure you have pointed to your generated test assemblies under Test selection/Test filesin Visual Studio Test task, for example:
**\bin\$(BuildConfiguration)\**\*test*.dll
!**\obj\**
!**\xunit.runner.visualstudio.testadapter.dll
!**\xunit.runner.visualstudio.dotnetcore.testadapter.dll
Check the following link:
https://xunit.net/docs/getting-test-results-in-azure-devops
It turns out that if You have UWP project for Windows version 1803, and refrence it from test project in this version it ignores all tests in test project. I think this is issue in xunit or windows sdk. If just test project is updated to 1903 it works flawlessly.

Build Windows IoT Core application based on .netcore.app 1.1.2

I'm testing the possibilities of a raspberry pi2 and .NET Core 1.1.
If I create an application with .NET Core 1.1 and try to build it to RID "Win10-arm", I receive following error:
Unable to resolve 'runtime.win8-arm.Microsoft.NETCore.Jit (>= 1.1.2)'
for '.NETCoreApp,Version=v1.1 (win10-arm)'.
Is this something that is not supported yet?
I think this issue is similar to https://github.com/dotnet/coreclr/issues/9694 but I couldn't find any reference which stated that.
Thank you for your answer!
can you try this?
I created an .NET Core Console App and published successfully with win10-arm
Get this Nuget Package:
Install-Package runtime.win8-arm.Microsoft.NETCore.Jit -Version 2.0.0-preview1-25301-02 -Pre
then you can build and publish.
:\Users\x\Documents\Visual Studio 2017\Projects\TestArm\TestArm>dotnet publish -c Release -r win10-arm
Microsoft (R) Build Engine version 15.3.117.23532
Copyright (C) Microsoft Corporation. All rights reserved.
TestArm -> C:\Users\x\Documents\Visual Studio 2017\Projects\TestArm\TestArm\bin\Release\netcoreapp1.1\win10-arm\TestArm.dll
TestArm -> C:\Users\x\Documents\Visual Studio 2017\Projects\TestArm\TestArm\bin\Release\netcoreapp1.1\win10-arm\publish\

Error DEP0700 0x80073cf3 during Windows 10 UWP application deployment with Visual Studio

I'm unable to deploy my UWP project anymore in the Release/x64 configuration with .NET Native.
It appears that it can't find the x86 version of the .NET Native Runtime package during deployment, while it has built a x64 package on the target platform that is really x64.
The error is below:
Error : DEP0700 : Registration of the app failed. Windows cannot install package XXXXXXXXX-d24ead15699e because this package depends on another package that couldn't be found.
This package requires minimum version 1.2.23231.0 of framework Microsoft.NET.Native.Runtime.1.2 published by CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US to install;
The frameworks with name Microsoft.NET.Native.Runtime.1.2 available to the user are Microsoft.NET.Native.Runtime.1.2_1.2.23231.0_x86__8wekyb3d8bbwe.
Provide the correct framework along with this package. (0x80073cf3)
In fact this problems appeared after trying to install the app package with the Powershell script instead of from Visual Studio (ie on the development computer where Visual Studio is installed and that is used for debugging).
I had generated an deployment application package for both x86 & x64 platform at the same time. it seems now that there is a conflict in Microsoft.NET.Native.Framework referencing or between different kinds of deployment (with VS2015 or with PowerShell) on the PC but I don't know why and how resolve it.
Any help would be greatly appreciate.
Thanks,
Thibault
I had to manually add this to my project to get the CoreRuntime appx to deploy as a dependency when debugging. I assume you can do something similar with the native runtime
<ItemGroup>
<SDKReference Include="Microsoft.NET.CoreRuntime, Version=1.0">
<Name>Microsoft .NET Core Runtime Package for Windows</Name>
</SDKReference>
</ItemGroup>
For me, changing the Guids in the Package.appmanifest file helped:
<Identity Name="04135591-f637-4b60-ac7d-aa2fda03651d" ... />
<mp:PhoneIdentity PhoneProductId="04135591-f637-4b60-ac7d-aa2fda03651d" ... />
Replace with a new Guid.
My problem is solved by modify vs 2017 installation, adding ".NET Core cross-platform development". Along with the installation, ".NET Core 2.0 development tools" is installed. I guess it is required by vs deployment.
The error I got before,
DEP0700: Registration of the app failed. [0x80073CF3]
Windows cannot install package d6ff9b9c-06f8-4ead-a5cb-9389bd79cb13_2.3.0.0_x86__5xzajrpst8fmr
because this package depends on a framework that could not be found. Provide the framework "Microsoft.NET.CoreRuntime.2.1"
published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x86 processor architecture and minimum version 10.0.16299.0,
along with this package to install. The frameworks with name "Microsoft.NET.CoreRuntime.2.1"
currently installed are: {Microsoft.NET.CoreRuntime.2.1_2.1.26124.5_x86__8wekyb3d8bbwe}