dotnet-samples | Contains samples and documentation for libraries and tools | SDK library
kandi X-RAY | dotnet-samples Summary
kandi X-RAY | dotnet-samples Summary
Contains samples and documentation for libraries and tools of the .NET framework. Pull requests welcome!
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dotnet-samples
dotnet-samples Key Features
dotnet-samples Examples and Code Snippets
Community Discussions
Trending Discussions on dotnet-samples
QUESTION
I am trying to get the list of users in ADO using .NET clients. I am referring to this git repository: https://github.com/microsoft/azure-devops-dotnet-samples/blob/master/ClientLibrary/Quickstarts/dotnet/GraphQuickStarts/Samples/EnumerateUsers.cs
I tried same thing but still the it shows error that GetUsersAsync needs assembly reference. I have used tried all the references. I am getting GetUserAsync but that is for one user. I need to fecth all the users. enter image description here
...ANSWER
Answered 2020-Jun-22 at 06:28Instead of using GetUsersAsync
, please use ListUsersAsync
:
QUESTION
I need to create a new user in azure devops using the python client library for Azure DevOps REST API.
I wrote the following code:
...ANSWER
Answered 2019-Jun-24 at 05:23Some of the classes like GraphUserPrincipalNameCreationContext
aren't currently available in the python client API. They are working on it. You can track the issue here in GitHub repo:
https://github.com/microsoft/azure-devops-python-api/issues/176
You can use User Entitlements - Add REST API for azure devops instead of it's Graph API. You can use the following python client for this purpose:
You can refer to the sample given in the following question to know about how to use the mentioned python client :
Unable to deserialize to object: type, KeyError: ' key: int; value: str '
QUESTION
I am writing a python script to add a user(an existing user from the AAD backed provider) to Azure DevOps. I am using python client library of Azure DevOps for this purpose. After authentication, I am able to fetch the users from azure devops as:
...ANSWER
Answered 2019-Jun-24 at 05:51GraphUserCreationContext
class from the python client for azure devops REST API accepts only one input parameter which is StorageKey
. Hence, whatever you provide as an input parameter to that function, be it a UPN or ID, it is set as a storage key.
If you print the addAADUserContext
object, you will get:
QUESTION
I am writing a program that would create iteration with its child nodes. It creates a parent node but none of the child nodes. Below is my sample code.
I took help from the link: https://github.com/microsoft/azure-devops-dotnet-samples/blob/master/ClientLibrary/Samples/WorkItemTracking/ClassificationNodesSample.cs
...ANSWER
Answered 2019-May-13 at 11:27You have to create each iteration (first parent then child). This is my function to create iteration:
QUESTION
I have trouble building working ASP .NET Core image for Raspberry Pi 3 Model B+. Whenever I try to run the app I get the error message:
standard_init_linux.go:190: exec user process caused "exec format error"
However, when I try a pre-built .NET Core Docker Image from Github (docker run --rm microsoft/dotnet-samples
) everything works fine.
When I've simply downloaded the same repo and built the same code with provided Dockerfile using docker build . -t aspnettest-f Dockerfile
pushed it to Raspberrry and got the same error as previously:
What am I doing wrong? I've tried building the sample code with different provided Dockerfiles like this one, but all results in the same error.
...ANSWER
Answered 2018-Sep-17 at 23:00In the Dockerfile you need to replace FROM microsoft/dotnet:2.1-runtime AS runtime
with FROM microsoft/dotnet:2.1-runtime-stretch-slim-arm32v7 AS runtime
if building the image under Windows.
When building an ASP.NET Core App, the runtime image for ARM32 is microsoft/dotnet:2.1-aspnetcore-runtime-stretch-slim-arm32v7
.
Building the image on the Raspberry should work fine.
This is because microsoft/dotnet:2.1-runtime
is multi-arch and docker build
choses the image that matches the current processor architecture. So, when building under Windows, the resulting image will be for amd64.
QUESTION
I have an on-prem TFS 2018 and trying to move a specific project from one project collection to another. As this is not supported by Microsoft (see User Voice suggestion here and StackOverflow thread here and here) and we need full control we decided to move the project programmatically using the REST API.
So I builded a small C#.NET application and included the Microsoft.TeamFoundationServer.Client NuGet package. Everything is working as expected and I'm able to replay the full history of the project in question to another project collection.
Unfortunately, I've problems to set changesets creation date and author. And I was not able to find a solution here or anywhere else.
When I set the CreationDate, the value will be overwritten with the current date by TFS:
...ANSWER
Answered 2018-Apr-03 at 10:18Sorry, it's not able to set/modify changeset author and date by REST API in TFS. It is also easy to understand. If a source control system is easily to change this area, it seems kind of violate the version control. And the changeset history will become no reference value, we do not know if the author and the date is the real one and time checked in.
This is also documented clearly in Microsoft Docs, please take a look at below part: Using public API-based tools for higher fidelity migration You are also using the API and kind of build your own tool.
Generally these tools can provide a higher fidelity migration than a manual copy of "tip" data, but they are still relatively low fidelity. For example:
- None of them will preserve the dates of TFVC changesets.
- Many of them will not preserve the changed dates of work item revisions.
- None of them will migrate all TFS artifacts.
QUESTION
We are unable to update CreatedBy(System.CreatedBy) workitem field in VSTS 2017 using rest API. The user has been added to "Project Collection Service Accounts" VSTS group in order to bypass the rules while updating the workitem.
...ANSWER
Answered 2017-Dec-14 at 09:13System.CreatedBy
field can only be modified on work item creation. If the work item has multiple revisions, System.CreatedBy
can not be changed by bypassing rule.
You can also find it in make an update bypassing rules:
NOTE: System.CreatedBy and System.CreatedDate can only be modified using bypass rules on work item creation, i.e. the first revision of a work item.
Since System.CreatedBy
and System.CreatedDate
record who and when did a work item created, it can only be updated when you create the work item.
QUESTION
I have a new Windows Server 2016, with all updates applied.
I followed the commands from the quick-start and all of them went fine.
Now when I run the command to Pull the image and run I got this:
...ANSWER
Answered 2017-Jul-03 at 15:18I have SEP 14 MP1 by default in my servers. Once I removed it, docker worked.
I tried to simply disable it, but still, SEP blocks somehow.
QUESTION
I am just discovering Docker - I am finding so much information, but I can't seem to get a straight answer on this option. If someone could give me a clear explanation based on my understanding I have of it so far it would be appreciated.
I am downloading a docker image locally - say the default one from Microsoft, using microsoft/dotnet-samples:dotnetapp-nanoserver
I am lost as to where this is downloaded to? Is this downloaded and installed as a program on the host machine, with a isolated script that controls the container? The download is about 1.3 gigs because it includes .Net Core
In another example, if I download apache2 to run as a web server, does it install it in the default paths on the host system, but every container I want to use taps into that - or does every container contain it's isolated version of apache2?
I ask this because I can't find files that mimic the file size of these programs.
I know they are not complete VM's but where can I find the files associated with a container?
I am using Windows Server 2016 and a Mac since I want to do some trials with containers.
...ANSWER
Answered 2017-Jan-12 at 21:43Docker images are encapsulated filesystems. The software and files inside are not being directly installed onto your system.
You can think of a Docker image sort of the way you think of a .zip file. You can download a .zip file from somewhere, and it is a single file. Contained inside it might be one file, or dozens of files, or a nested tree of directories and files. But on your disk, it exists as one file.
A Docker image is similar (conceptually, at least... the details are more complicated).
Image storageWhere images are stored varies by platform. On a Linux system, they are usually under /var/lib/docker
. I don't know where they are stored on Windows, but this is a more or less opaque store. Poking around inside will not reveal very much to you anyway.
To see what you have, you should use the docker images
command. It will show you the images you have stored locally.
Like I said earlier, each image may consist of multiple layers. By default, that command will only show you the top layer, which is the one you'll care about, to run containers from. Technically, there are other layers, and you can see all of them using docker images -a
.
When you download an Apache image, nothing is installed on your system at all. The image file(s) are downloaded and stored. Hiding inside is Apache and everything Apache needs in order to run, but Apache is not installed onto your Windows OS anywhere.
When you want to use Apache, you would run a container. Docker takes the Apache image and, using it as a starting template, creates a running process container, inside of which Apache is running. This is isolated from your operating system. Apache is only running inside of the container.
If you run a second container from the Apache image, you now have two completely separate Apache instances running, each in their own isolated filesystem environment.
Where can I find the files?If you just want to poke around in the container filesystem, you can start the container in interactive mode, and run a shell instead of whatever it normally runs (like Apache). For instance, if you have an image apache:latest
, you can do this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dotnet-samples
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page