Seems like I get this weird problem while running Xamarin.iOS on Visual studio.
This happened after I updated to the latest Xamarin (today).
I have connected to my Mac though. I tried to Google it, no answer...
"error MSB4057: The target "GetBuiltProjectOutputRecursive" does not exist in the project"
What is the problem? Before the update, it worked!
1>------ Build started: Project: GTS.Mobile.iOS, Configuration: Debug iPhoneSimulator ------
1> Generated session id: 04dbf5285bd918e0f3e1fc41e6f65f8c
1> Generated build app name: GTSMobileiOS
1> Connecting to Mac server 192.168.9.164...
1>C:\Users\kkh\Computas\CargoNet\GTS.Mobile\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets(243,5): warning : All projects referencing GTS.Mobile.csproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.
1> Consider app.config remapping of assembly "System.Runtime, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.11.0" [] to Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades\System.Runtime.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.IO, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.11.0" [] to Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades\System.IO.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Net.Http, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.0.0" [C:\Users\kkh\Computas\CargoNet\GTS.Mobile\GTS.Mobile\GTS.Mobile\bin\Debug\System.Net.Http.dll] to Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Xamarin.iOS\v1.0\System.Net.Http.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Threading.Tasks, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.11.0" [] to Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades\System.Threading.Tasks.dll] to solve conflict and get rid of warning.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
1> GTS.Mobile.iOS -> C:\Users\kkh\Computas\CargoNet\GTS.Mobile\GTS.Mobile.iOS\bin\iPhoneSimulator\Debug\GTSMobileiOS.exe
1>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.After.targets(59,36): error MSB4057: The target "GetBuiltProjectOutputRecursive" does not exist in the project.
I have solved the problem on my own installation.
Here is what i did:
Install the newest xamarin on both visual studio and mac.
Install xamarin studio (newest)
Remove all xamarin products including gtk.
Install xamarin newest(complete pack) with the installer
Reboot computer
Open solution and clean/build
Related
I have some libraries built on C# .NET Core 3.1.
When I execute the command
dotnet build "core\core.csproj"
I get the following error
C:\Users\christos.nuget\packages\visual-stylecop.msbuild\4.7.59\build\Visual-StyleCop.MSBuild.Targets(107,5): error MSB4062: The "StyleCopTask" task could not be loaded from the
assembly
C:\Users\christos.nuget\packages\visual-stylecop.msbuild\4.7.59\build..\tools\StyleCop.dll.
Could not load file or assembly 'System.Windows.Forms,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The system cannot find the file specified. Confirm that the
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.
But when I use msbuild
& 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe' "core\core.csproj"
it finishes without problems.
Any idea why?
thanks in advance for any help
Using Microsoft Visual Studio 2022 to build a C# Web API project with .NET 6 Framework, the project builds fine on one machine. I cloned the same source code repository into a different machine, but when building in the new machine I get the following error:
FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Microsoft.AspNetCore.Razor.Tasks.StaticWebAssetsManifest.ComputeManifestHash()
at Microsoft.AspNetCore.Razor.Tasks.StaticWebAssetsManifest.Create(String source, String basePath, String mode, String manifestType, ReferencedProjectConfiguration[] referencedProjectConfigurations, DiscoveryPattern[] discoveryPatterns, StaticWebAsset[] assets)
at Microsoft.AspNetCore.Razor.Tasks.GenerateStaticWebAssetsManifest.Execute()
ResultsMonitor.API C:\Program Files\dotnet\sdk\6.0.300\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets 411
Severity Code Description Project File Line Suppression State
Error FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Microsoft.AspNetCore.Razor.Tasks.StaticWebAssetsManifest.ComputeManifestHash()
at Microsoft.AspNetCore.Razor.Tasks.StaticWebAssetsManifest.Create(String source, String basePath, String mode, String manifestType, ReferencedProjectConfiguration[] referencedProjectConfigurations, DiscoveryPattern[] discoveryPatterns, StaticWebAsset[] assets)
at Microsoft.AspNetCore.Razor.Tasks.GenerateStaticWebAssetsManifest.Execute()
ResultsMonitor.API C:\Program Files\dotnet\sdk\6.0.300\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets 411
Furthermore, on the new machine:
If I use JetBrains Rider 2022.1.1 to open the same project, it just builds and runs fine.
If I do a "dotnet build" from the terminal, build also succeeds.
What is wrong with Visual Studio 2022? I even uninstalled and reinstalled Visual Studio 2022 and the .NET 6 SDK for Visual Studio
So the problem is, I have .NET 6. Then I do dotnet restore. After that, I want to do dotnet format -v diag --report ./editor-report.json --verify-no-changes example.sln.
But after formatting I got that error:
Analysis complete in 2554ms.
Unhandled exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Then I think maybe I can just install that dependencies. But I can't.
dotnet tool install --global Microsoft.CodeAnalysis
/tmp/sf1h1yl0.gli/restore.csproj : error NU1212: Invalid project-package combination for Microsoft.CodeAnalysis 4.1.0. DotnetToolReference project style can only contain references of the DotnetTool type
The tool package could not be restored.
How can I fix it? By the way the .NET 5 scan is doing well.
I've noticed this same issue in GitHub Actions, but wasn't able to reproduce locally.
It seems, according to this GitHub issue, that it's related to having the version 6.0.200 of the SDK installed on your machine. The suggestions in that thread are to either rename 6.0.200 or uninstall it entirely, but I haven't found another workaround.
I'm using Visual Studio 2017 (release) and I'm trying to build a new ASP.Net MVC Core project programmatically using Microsoft.Build version 15 (from NuGet).
I'm getting this error message:
ERROR C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\TypeScript\Microsoft.TypeScript.targets(164,5):
The "TypeScript.Tasks.FindConfigFiles" task could not be loaded from
the assembly C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\TypeScript\TypeScript.tasks.dll.
Could not load file or assembly 'Microsoft.Build.Framework,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
one of its dependencies. The system cannot find the file specified.
Confirm that the 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.
Skipping target "GenerateBuildDependencyFile" because all output files are up-to-date with respect to the input files.
The thread 0x430c has exited with code 0 (0x0).
: ERROR C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets(129,5):
The "GenerateRuntimeConfigurationFiles" task failed unexpectedly.
System.MissingMethodException: Method not found: 'Boolean NuGet.Frameworks.NuGetFramework.op_Equality(NuGet.Frameworks.NuGetFramework,
NuGet.Frameworks.NuGetFramework)'.
at Microsoft.NET.Build.Tasks.LockFileExtensions.CreateProjectContext(LockFile
lockFile, NuGetFramework framework, String runtime, String
platformLibraryName)
at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
So, Typescript.Tasks.dll could not load file or assembly 'Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'?
And error messages related to System.MissingMethodException: Method not found: 'Boolean NuGet.Frameworks.NuGetFramework.
I have added these NuGet packages:
Microsoft.Build version 15.1.0.0
Microsoft.Build.Framework, version 15.1.0.0
Microsoft.Build.Tasks.Core, version 15.1.0.0
Microsoft.Build.Utilities.Core, version 15.1.0.0
Microsoft.CodeAnalysis (and all associated packages), version 2.0.0.0
I'm loading the ASP.Net MVC Core project successfully with
workspace = MSBuildWorkspace.Create(new Dictionary<string, string>
{ { "Configuration", "Debug" } });
Then later I'm trying to build the project with
Microsoft.Build.Evaluation.ProjectCollection pc = new Microsoft.Build.Evaluation.ProjectCollection();
pc.DefaultToolsVersion = "15.0";
Dictionary<string, string> globalProperties = new Dictionary<string, string>();
globalProperties.Add("Configuration", "Debug");
globalProperties.Add("Platform", "Any CPU");
var targetsToBuild = new[] { "Build" };
BuildRequestData buildRequest = new BuildRequestData(projectFullPath, globalProperties, "15.0", targetsToBuild, null);
Does anybody know what the problem is?
I've added my source code to github using the plugin for visual studio and linked my AppHarbor account to the github.
It restores the nuget packages as shown below but fails when building. I can compile (and run) it without any problems on my own pc.
Does anyone have any ideas what could be causing this, or what I might be doing wrong?
Time Message
1/16/17 10:39 AM Received notification, queuing build
1/16/17 10:39 AM Downloading source
1/16/17 10:39 AM Downloaded source in 0.1 seconds
1/16/17 10:39 AM Starting NuGet package restore
1/16/17 10:39 AM NuGet package restore completed
1/16/17 10:39 AM Starting build
1/16/17 10:39 AM Build failed: An error occurred during the build
Build started 1/16/2017 9:39:42 AM.
1>Project "D:\temp\rp5gvmbn.own\input\DiscordBot.sln" on node 1 (default targets).
1>ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
1>Project "D:\temp\rp5gvmbn.own\input\DiscordBot.sln" (1) is building "D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj" (2) on node 1 (default targets).
2>PrepareForBuild:
Creating directory "obj\Release\".
2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3257: The primary reference "System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" could not be resolved because it has a higher version "4.1.2.0" than exists in the current target framework. The version found in the current target framework is "4.0.0.0". [D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj]
2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3257: The primary reference "System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has a higher version "4.1.1.0" than exists in the current target framework. The version found in the current target framework is "4.0.0.0". [D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj]
2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3257: The primary reference "System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has a higher version "4.1.0.0" than exists in the current target framework. The version found in the current target framework is "4.0.10.0". [D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj]
2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2482,5): error MSB3323: Unable to find manifest signing certificate in the certificate store. [D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj]
2>Done Building Project "D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj" (default targets) -- FAILED.
1>Done Building Project "D:\temp\rp5gvmbn.own\input\DiscordBot.sln" (default targets) -- FAILED.
Build FAILED.
"D:\temp\rp5gvmbn.own\input\DiscordBot.sln" (default target) (1) ->
"D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj" (default target) (2) ->
(ResolveAssemblyReferences target) ->
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3257: The primary reference "System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" could not be resolved because it has a higher version "4.1.2.0" than exists in the current target framework. The version found in the current target framework is "4.0.0.0". [D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3257: The primary reference "System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has a higher version "4.1.1.0" than exists in the current target framework. The version found in the current target framework is "4.0.0.0". [D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3257: The primary reference "System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has a higher version "4.1.0.0" than exists in the current target framework. The version found in the current target framework is "4.0.10.0". [D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj]
"D:\temp\rp5gvmbn.own\input\DiscordBot.sln" (default target) (1) ->
"D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj" (default target) (2) ->
(ResolveKeySource target) ->
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2482,5): error MSB3323: Unable to find manifest signing certificate in the certificate store. [D:\temp\rp5gvmbn.own\input\DiscordBot\DiscordBot.csproj]
3 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.70
In my case it was because of the old MSBuild version (supplied with .NET c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe).
When I installed Microsoft Build Tools 2015 and switched to it ("c:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe") everything went well.
Uninstall and install back your nuget packages for Discord. Make sure the versions of other packages matches for the one that discord required too as well as making sure that required packages are present.