Posts

Showing posts with the label nuget

.NET Core 2.1 - dotnet/exe on build, packages are missing

Image
Clash Royale CLAN TAG #URR8PPP .NET Core 2.1 - dotnet/exe on build, packages are missing I've been developing on one machine and recently tried to install my application on another PC. I think I've deduced to to the nuget packages not being found since in .NET Core, nuget puts the packages in the local 'Users' folder path. I initially added the <RunTimeIdentifier> tag to create an exe (which worked on my developer machine). When running the exe on a different machine, the console window will flash very quickly and application stops with no error output (even in Event Viewer). <RunTimeIdentifier> I also added this tag <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest in the *.csproj which did not make a difference. So I tried running dotnet project.dll which gave me this error on the other machine. dotnet project.dll An assembly s...

Append Build ID to nuget version specified in .csproj

Image
Append Build ID to nuget version specified in .csproj In this video from MSDN (https://channel9.msdn.com/Events/Build/2018/THR5057) at the 3:34 second mark, the presenter shows how to append the Build ID to a nuget's version. In the MSBuild arguments, he specifies: /t:pack /p:PackageVersion=1.0.$(Build.BuildId) So, when the project is built by VSTS, the nuget assembly's revision number is using the build id. I would like to do something similar. Instead of hard coding the 1.0 in the build definition, I'd like to retrieve that from .csproj file. I am using the new .csproj file which stores nuget information. For example, I'd like to specify in the csproj: 0.0.1-beta Then, VSTS would append the BuildID and generate the assembly version as 0.0.0.1-beta.49 (49 being the build id) 2 Answers 2 You can create a Power Shell script that retrieves the version from csproj file, then add the ver...