First two columns are ID's of the cities, and the third is distance between the cities.
How I can do this in microsoft visual studio?
Thank you.
First two columns are ID's of the cities, and the third is distance between the cities.
How I can do this in microsoft visual studio?
Thank you.
While building solution which has VB.NET standard projects and Core 3.1 projects, I am getting following error for all new core projects: XXXXXX.csproj.metaproj: The project file "XXXX.csproj" is not supported by MSBuild and cannot be built.
I have the following settings but still getting error message:
- Build definition - Process - Advanced - Agent Settings - Tags Filter --- VS2019_4.8 is selected
- Tag Comparison Operator ---- MatchAtLeast
What should I do to build the solution for all projects ?
Thanks, AT
I have an imported .targets file which would run on every build of a .net core project and have a custom task in it.
.targets file have this:
And<LibFolderPart2 Condition="'$(MSBuildRuntimeType)' == 'Core'">netstandard2.1\Emailing.dll</LibFolderPart2>
<LibFolderPart2 Condition="'$(MSBuildRuntimeType)' != 'Core'">net472\Emailing.dll</LibFolderPart2>
<UsingTask TaskName="CustomlTask"
AssemblyFile="$(LibFolder)\$(LibFolderPart2)" />
In the project definition I have:
<PropertyGroup> <TargetFrameworks>netcoreapp3.1;netstandard2.0;netstandard2.1;netcoreapp3.0;net472</TargetFrameworks> </PropertyGroup>
When trying to use **Visual Studio build menu** it always goes for net472 though the project is a .net core project.
Can anyone explain why that happens and how can I force the build menu to build under .net core platform?
If I remove those first runtime conditions the `UsingTask` will never find the "Emailing.dll", cause it is trying to find a .net framework DLL.
I personally didn't want/need to implement net472 there, but seems I am forced to do so, if want to use the Visual studio build menu.
If needed can provide code in Github.Main strategy:
Here we have a library NugLibEnforceCore, which contains a
custom MSBuild task and we will put it in a folder: The solution folder\.libs
First step is to build this library and put it in the proper folder.
Then we may try to build the `Consumer` project, which has build.targets and will try to run that custom tasks.
Projects and tasks are the bare minimum needed things for what expected and they don't have anything special.
The .targets file in the Consumer project:
<PropertyGroup> <LibFolder>$(SolutionDir).libs</LibFolder> <!-- <LibFolderPart2 Condition="'$(MSBuildRuntimeType)' == 'Core'">netstandard2.1\NugLibEnforceCore.dll</LibFolderPart2> --> <LibFolderPart2 Condition="'$(MSBuildRuntimeType)' == 'Core'">NugLibEnforceCore.dll</LibFolderPart2> <LibFolderPart2 Condition="'$(MSBuildRuntimeType)' != 'Core'">net472\NugLibEnforceCore.dll</LibFolderPart2> </PropertyGroup> <UsingTask TaskName="TestTask" AssemblyFile="$(LibFolder)\$(LibFolderPart2)" /> <Target Name="DoTheTask" AfterTargets="Build"> <Message Text="=== Trying TestTask ===" Importance="high" /> <TestTask /> <Message Text=" == TestTask is finished" Importance="high" /> </Target>
Here I share the issues and some difficulties I experienced and the approaches I tried related to the topic.
Tried to reproduce an issue which was irritating and happened time to time for me.
I was able to use custom tasks, but want to find the reasons and solve this issue forever.
1. Approach 1: ALL based on .net core - Build via Visual Studio Build Menu
get this error:
Error MSB4062 The "TestTask" task could not be loaded from the assembly ...\MSBuild13 Enforce Core\.libs\net472\WeRTheBest.NugLibEnforceCore.dll. Could not load file or assembly 'file:///...\MSBuild13 Enforce Core\.libs\net472\WeRTheBest.NugLibEnforceCore.dll' or one of its dependencies. The system cannot find the file specified. 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. Consumer ...\MSBuild13 Enforce Core\Consumer\build\build.targets 27
---
**2. Approach 2:** ALL based on .net core - Build via dotnet msbuild command
dotnet msbuild NugLibEnforceCore\NugLibEnforceCore.csproj
get this error:
Error:
=== Trying TestTask === ...\MSBuild13 Enforce Core\Consumer\build\build.targets(27,5): error MSB4062: The "TestTask" task could not be loaded from the assembly ...\MSBuild13 Enforce Core\Consumer\build\.libs\netstandard2.1\NugLibEnforceCore.dll. Could not load file or assembly '...\MSBuild13 Enforce Core\Consumer\build\.libs\netstandard2.1\NugLibEnforceCore.dll'. The system cannot find the path specified. 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. ...\MSBuild13 Enforce Core\Consumer\Consumer.csproj]
3. Approach 3: Multi-target (.Net Core & .Net Framework) - Build via Visual Studio Build Menu:
will cause other difficulties, which I may bring more details on the next steps here if needed or as we continue this discussion.
The code is also provided here:
https://github.com/KKacer/MSBuild13-Enforce-Core
Brief:
In the first approach when the project is based on ".net standard" why `MSBuildRuntimeType` is trying to take net472 library?!
In the second approach, it can't understand the same path used in the first approach and is looking for:
...\[Solution]\Consumer\build\.libs\netstandard2.1\NugLibEnforceCore.dll
instead of
...\[Solution]\.libs\netstandard2.1\NugLibEnforceCore.dll
In the last build I commented/removed "netstandard2.1" for easier builds, cause it is currently a single-target assembly.
We know that the files are in the proper location, you can also put the library manually and take a test if needed, the only thing that matters is be able to run the consumer project's tasks without any issues and worry.
I can share videos about it if needed.
I'm just trying to build the stock .NET Core Console app in Visual Studio 2019 Enterprise; I'm using the latest version of VS.
ErrorMSB4018The "ResolvePackageAssets" task failed unexpectedly.
NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Program Files (x86)\Progress\ToolboxNugetPackages'.
at NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable`1 fallbackPackageFolders)
at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(IEnumerable`1 packageFolders)
at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(LockFile lockFile)
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task)
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAssets task, Byte[] settingsHash)
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task)
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups()
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()ConsoleApp1C:\Program Files\dotnet\sdk\3.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234
Tavi Truman
Ven
Hi all,
I've succesfully imported the package UnmanagedExports ver 1.27 via the NuGet package manager, in order to obtain a dll to be invoked from a JNA app from my already exist C# project.
My method has been beautifully 'annotated' with
[DllExport("listReaders", CallingConvention = CallingConvention.Cdecl)] public static bool ListReaders(out string[] sReaderName, out int iReadersFound) {...}
But when I try to compile what I get is:
The "RGiesecke.DllExport.MSBuild.DllExportAppDomainIsolatedTask" task could not be loaded from the assembly ${myprojectdir}\packages\UnmanagedExports.1.2.7\tools\RGiesecke.DllExport.MSBuild.dll. Could not load file or assembly 'Microsoft.Build.Utilities, Version=2.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
The IDE is a Microsoft Visual Studio Community 2019 Versione 16.6.0
Any help appreciated.
PS: here's a fragment of my .csproj file
<ItemGroup><Reference Include="RGiesecke.DllExport.Metadata, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8f52d83c1a22df51, processorArchitecture=MSIL"><HintPath>packages\UnmanagedExports.1.2.7\lib\net\RGiesecke.DllExport.Metadata.dll</HintPath><Private>False</Private></Reference><Reference Include="System" /><Reference Include="System.Core"><RequiredTargetFramework>3.5</RequiredTargetFramework></Reference><Reference Include="System.Windows.Forms" /><Reference Include="System.Xml.Linq"><RequiredTargetFramework>3.5</RequiredTargetFramework></Reference><Reference Include="System.Data.DataSetExtensions"><RequiredTargetFramework>3.5</RequiredTargetFramework></Reference><Reference Include="System.Data" /><Reference Include="System.Xml" /></ItemGroup>
what it seems strange is the 3.5 version in the RequiredTargetFramework tag (I think a legacy settings because the project has been created a long time ago.
SeverityCodeDescriptionProjectFileLineSuppression State
WarningCannot find wrapper assembly for type library "MSHTML". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the
COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit.Zombsroyale BR <g class="gr_ gr_8 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="8" id="8">Unoffical</g> App
It's a warning, it looks like <g class="gr_ gr_126 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" data-gr-id="126" id="126">that :</g>http://prntscr.com/mbs9i4
It always happens when I add the MSHTML library <g class="gr_ gr_164 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="164" id="164">refrence</g>.
I know this has been asked before long back (link below), but wondering if there is a solution at least now (since the below post was from 2006). Is it possible to use SignFile task in msbuild to sign multiple files at once?
Ven
Ven
I have a solution that I can build from Visual Studio. Configuration manager is set to build "QL Release | Win32". I saved all after building in Visual Studio 2013.
I tried a command line build:
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" /nologo /p:Configuration="QL Release" /verbosity:detailed /t:Rebuild /fileloggerparameters:LogFile="d:\myProduct\windows_build_logs\QL_out.txt" "d:\myProduct\mySolution\QL.sln"
The logfile references a non-existent ".metaproj" file:
Build started 5/7/2015 5:31:04 PM.
Project "d:\myProduct\mySolution\QL.sln" on node 1 (Rebuild target(s)).
Building with tools version "2.0".
Target "ValidateSolutionConfiguration" in file "d:\myProduct\mySolution\QL.sln.metaproj" from project "d:\myProduct\mySolution\QL.sln" (entry point):
Using "Error" task from assembly "Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Error"
d:\myProduct\mySolution\QL.sln.metaproj : error MSB4126: The specified solution configuration "QL Release|X64" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln
/p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [d:\myProduct\mySolution\QL.sln]
Done executing task "Error" -- FAILED.
Done building target "ValidateSolutionConfiguration" in project QL.sln" -- FAILED.
Done Building Project "d:\myProduct\mySolution\QL.sln" (Rebuild target(s)) -- FAILED.
Build FAILED.
"d:\myProduct\mySolution\QL.sln" (Rebuild target) (1) ->
(ValidateSolutionConfiguration target) ->
d:\myProduct\mySolution\QL.sln.metaproj : error MSB4126: The specified solution configuration "QL Release|X64" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln
/p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [d:\myProduct\mySolution\QL.sln]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.06
I don't know where it is getting the ".metaproj" file as there isn't one. I've done a clean, even removed the QL.sdf and QL.v12.suo files, but the command line build still wants to build a non-existent configuration. That configuration most likely came from some experimental work which has since been removed. The solution contains 10 projects. None of the project or solution files reference x64 so I can't tell where MSBUILD is getting this information.
I have a Windows 10 VM with VS 2019 installed. MSBuild version is 16.6. I am using the following from msbuild command in Developer Command Prompt and it works fine.
<SignFile CertificateThumbprint="$(CertThumbprint)" SigningTarget="%(DLLFiles.FullPath)" TargetFrameworkVersion="v4.5" />
I have a build machine which is Windows Server 2019 Standard. It has Visual Studio 2019 Build Tools installed (but no VS) and hence MSBuild version is 16.5. The above SignFile task throws an error in the build machine
"An error occurred while signing: SignTool.exe was not found at path <Location_of_Project_File>\signtool.exe"
Even in my Windows 10 machine, I don't have signtool.exe in the project file location. So, I am not sure why is this error occurring? Please help.
Ven
Terry Clancy
Hi,
I am trying to write a simple C++ code script on visual studio and it keeps getting detected as a Trojan:Win32/Ludicrouz.Z threat. Visual studio keeps timing out with the error that "operation did not complete successfully because the file contains a virus or potentially unwanted". I have reinstalled and installed VS2019 multiple times, and C++ works fine. I dont know what the issue is.
hi friend , vs has an error :
C:\Program Files (x86)\Microsoft VisualStudio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): error MSB3095: invalid parameter. path contains illegal character.
when i build my project by vs 2017
help me please
Hi
We have DevOps pipelines being run on self-hosted build servers, building a large solution (~50 projects, currently a mix of full framework and NetStandard) with a lot of nugets being referenced. Unfortunately the codebase is far too large to be pulled onto the standard azure build servers.
We use the nuget restore step (v4.9.1) against the standard nuget feed & a couple of secured customer devops feeds but the restore time has gone from ~2 mins to more than 10 minute. At the outset of this the nuget restore was failing completely, allegedly due to authentication timeout. We have managed to get it working again, but taking these much longer times using the following settings:
steps:
- task:NuGetCommand@2
displayName:'NuGet restore'
inputs:
restoreSolution: src/DesktopComponents.sln
feedsToUse: config
nugetConfigPath: nuget.config
disableParallelProcessing:true
restoreDirectory:.packages
Any assistance that anyone could offer would be much appreciated. If there are any logs/settings that would be useful please let me know
Thanks in advance
Mark Middlemist