`dot net restore` fails due to corrupted package - nuget

I just installed the LTS version of the .NET Core SDK (1.0.0-preview2-003156). I created a new project by using
dotnet new
However, this fails because
Failed to create prime the NuGet cache. restore failed with 1.
I followed the directions in this post to clear my local package cache and I am left with this package:
System.Security.Cryptography.Algorithms
The 4.2.0\ref sub-directory gives me this error when I try to open it:
The file or directory is corrupted and unreadable.
How do I go about clearing this package out or at least getting to the point where the package restore will work again?

I ended up having to run chkdsk against my machine. Because the package directory was on my C:\ drive, I had to reboot for it to run the disk repair. After the chkdsk completed, I was able to delete the package.

Related

No Space On AWS Device Farm

I am recieving an error when installing my tgz npm file that there is no more space in the device and its the same across projects.
I tried multiple packages, and expected it to install like it had been and when performing an ls command I only see the tgz file.

Error when building flutter app for Linux snap package using snapcraft - CMake step failing

This question has been asked here and (erroneously) closed as a duplicate with a link to an old CMAKE question. Probably the closing person did not read the question properly. This has nothing to do with plain CMake configuration, unless you want to configure the CMake use in snapcraft source code.
Error when building flutter app for Linux snap package using snapcraft
The fact is that running snapcraft fails. Running it with --debug gives you a root console of the snapcraft / multipass filesystem, whoami says root, but you only see the snap things around (for instance, not your home). Anyways, the error says
CMake Error: The current CMakeCache.txt directory /root/parts/xxxxx/build/build/linux/release/CMakeCache.txt is different than the directory
/home/zolal/flutterapps/xxxxx/build/linux/release where CMakeCache.txt was created. This may result in binaries being created in the wrong
place. If you are not sure, reedit the CMakeCache.txt
(naturally, you cannot reedit the CMAKECache.txt, because this is created by snapcraft)
It seems that the cmake build starts outside of the snapcraft / multipass VM, and than moves to the multipass VM resulting in CMake error. Because the original question was asked a while ago, obviously this still does not work. Did anyone solve this problem alredy?
Update, purged multipass and tried with lxd:
snapcraft --use-lxd
Launching a container.
Waiting for container to be ready
Waiting for network to be ready...
snap "snapd" has no updates available
The flutter plugin is currently in beta, its API may break. Use at your own risk.
snapd is not logged in, snap install commands will use sudo
snap "core18" has no updates available
Skipping pull flutter-extension (already ran)
Skipping pull geraspine-outcome-pc (already ran)
Skipping pull gnome-3-28-extension (already ran)
Skipping build flutter-extension (already ran)
Building geraspine-outcome-pc
flutter pub get
Woah! You appear to be trying to run flutter as root.
We strongly recommend running the flutter tool without superuser privileges.
/
📎
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Failed to run 'flutter pub get' for 'geraspine-outcome-pc': Exited with code 1.
Verify that the part is using the correct parameters and try again.
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
Naturally, the pubspec.yaml is there, but the files are obviously not transferred to the VM.
The solution is to execute following command inside your flutter project root folder (where the build, lib, snap, etc. folders are contained):
snapcraft clean <project-name>
This deletes the build cache inside "/root/parts/>project-name>" folder.
Should that not be enough, you can clean the whole snapcraft parts folder with
snapcraft clean
but this includes all dependencies. This means that all dependencies must be downloaded again the next time you compile your project.
Then delete the whole folder of your_part_name under parts folder
This doesn't work because the "parts" folder is inside "/root" dir and we cannot access or delete the stuff inside manually.
But it would be nice if we can change the parts folder e.g. into our /home dir. But I haven't found any possibilities yet !
If you got any error when building this, just run snapcraft build --debug
Then delete the whole folder of your_part_name under parts folder
Delete build directory and build again.
src github-issue
For me it was important to delete the build directory in my local directory also:
rm -rf build && snapcraft clean <project> && snapcraft

postgres-decoderbufs-master -- centos7

I am trying to CDC by debezium protobuf of postgres 9.6 and as per instruction i have downloaded source from git and trying to make then it have some problem and try to find out the solution on satckoverflow and other sites also then for ubuntu os many solution are available but for centosh 7 no solution found
The following error is coming when i fired make command
/usr/pgsql-9.6/lib/pgxs/src/makefiles/pgxs.mk:62: /usr/pgsql-9.6/lib/pgxs/src/makefiles/../../src/Makefile.global: No such file or directory
Package libprotobuf-c was not found in the pkg-config search path.
Perhaps you should add the directory containing `libprotobuf-c.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libprotobuf-c' found
/usr/pgsql-9.6/lib/pgxs/src/makefiles/pgxs.mk:105: /src/Makefile.shlib: No such file or directory
make: *** No rule to make target `/src/Makefile.shlib'. Stop.
if any help it will very useful for my project.
You need a protobuf-c-devel package installed. Also there is a problem with version. Check if your system has the correct version otherwise you'd need to install it from 3rd part RPM repository - https://groups.google.com/forum/?fromgroups=#!msg/debezium/v0s3tacOXeA/gVrdQAR2AgAJ;context-place=forum/debezium

Microsoft NuGet targets Error while building Project from Teamcity

I attempted in building the .NET Standard Library Project using .NET Framework 4.6.1 from Command prompt using MSBuild Commmand. I manage to succeed building the project from command prompt.
I tried the same MSBuild command to build the project from Teamcity Command line build step, but ended up getting the following error:
C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets(140,5): error : The package Microsoft.NETCore.Portable.Compatibility
with version 1.0.1 could not be found in C:\Windows\system32\config\systemprofile\.nuget\packages\. Run a NuGet package restore to download the package.
I tried Restoring nuget.exe restore mysolution.sln but noting works.
Please help me to compile the solution from Teamcity command line step. Its strange to get compiled from command prompt but not from teamcity command line.
Looks like there is a known issue in NuGet when restoring packages using the LocalSystem account wherein the packages cannot be accessed under the C:\Windows\system32\config\systemprofile\.nuget\packages folder, even though account permissions should allow it (see this GH issue). The current recommended workaround is to use the NUGET_PACKAGES environment variable to specify another location for the packages (e.g. C:\NuGet\packages).

Nuget Package Downloads But Isn't Installed On TFS Build

Title pretty much says it all. I have a project which uses some nuget packages. All are downloaded but two of them (HTMLAgilityPack and Newtonsoft) are never installed i.e. the .nupkg file is not extracted, thus, the required .dlls cannot be found and the build fails. Here's the part of the build log file showing when the packages are restored on the build server:
Target "RestorePackages: (TargetId:587)" in file "##\nuget.targets" from
project "##.csproj" (target "ResolveReferences" depends on it):
Task "Exec" skipped, due to false condition;
Task "Exec" (TaskId:360) Task Parameter:Command="##\nuget.exe" install
"##\packages.config"
-source "https://nuget.org/api/v2/" -RequireConsent -solutionDir
"##\Sources\" (TaskId:360) Task
Parameter:LogStandardErrorAsError=True (TaskId:360) "##\nuget.exe" install
"##\packages.config"
-source "https://nuget.org/api/v2/" -RequireConsent -solutionDir
"##\Sources\ " (TaskId:360)
Successfully installed '###.Utilities.Excel 1.0.0.0'. (TaskId:360)
Successfully installed '###.Utilities.FileIO 1.0.0.1'. (TaskId:360)
Successfully installed '###.Utilities.String 1.0.0.0'. (TaskId:360)
All packages listed in packages.config are already installed.
(TaskId:360) Done executing
task "Exec". (TaskId:360) Done building target "RestorePackages" in
project "##.csproj".: (TargetId:587)
As you can see, HTMLAgilityPack and Newtonsoft are not installed as part of the RestorePackages task. Why would TFS build download but not install these packages?
As you wrote, an old nuget.exe will do this.
What I do is take the "..nuget\nuget.exe" out of the equation.
I put nuget.exe on the build server.
I store them like this:
C:\MyProgFiles\NuGet\2.8.6\nuget.exe
C:\MyProgFiles\NuGet\3.3.0\nuget.exe
You might ask why I keep the olders. There are occasionally issues with the newest build.
Then on my builds, I setup the build server, I essentially run this:
"C:\MyProgFiles\NuGet\3.3.0\nuget.exe" restore c:\builds\1\SomeDirectory\MySolution.sln -NoCache
Obviously, you'll use macros instead of hard coded paths.
This will (obviously) restore the packages.
I use "NoCache" because occasionally our private nuget cache has things removed......which are cached on the build server. The nocache arg will find this issue sooner than later.
If anyone else comes across this it could be that the nuget.exe you're using to restore the packages is outdated. In my case the project I was working on was started by someone else 2 years ago, I added a relatively new nuget package and the old nuget.exe wasn't compatible with it. You can download the latest version of the nuget.exe here
.