Wednesday, May 20, 2020
DevOps error: No element in the source document matches '/configuration/system.identityModel'
Unable to restore organization's internal nuget package in devops
My
company has its own nuget feed and we were facing issues while using packages
in the feed in other repositories.
To be
able to build such a project on devops, several configurations are required.
1. Nuget Feed Configurations
a. Allow collection scoped builds
for the project
i.
On the
project consuming the artifact, click the settings Gear in bottom-left of
screen, then click settings in the 'Pipelines' section
ii.
Ensure
that 'Limit Job authorization scope to current project' is turned off
b. Set the Pipeline's build job to
use a Project Collection scope
i.
Click
'Pipelines' under 'Pipelines' in the main Navigation on the left
ii.
Choose
your pipeline and click 'Edit'.
iii.
Click the
'Options' tab at the top then choose 'Project Collection' under 'Build job
authorization scope' on the right
c. Set permissions on the artifact
i.
Click on
the 'Artifacts' icon on the far left nav, choose your artifact in the dropdown,
then click the cog on the top-right
ii.
Click on
the permissions tab and ensure that 'Project Collection Build Service
(<project collection name>)' has appropriate permissions (mine are set at
'Contributor' and that seems to work)
2. Project configuration in visual
studio
a. Add nuget.config in the project
and add a package source to your organization's nuget feed
b. Add referenced dlls to source
control
i.
Click on
view all files in solution explorer
ii.
Nuget
restore on solution
iii.
Build solution
iv.
Expand bin/debug
or bin/release folder depending on the intended release configuration in devops
pipeline (better yet, both)
v.
Right click
on the referenced dll and click ‘Add ignored items to source control’ command
vi.
Check in
and sync the project with devops repo
3. Pipeline configurations in devops
a. Edit devops pipeline’s restore
nuget packages task
i.
Set ‘Feeds
to use’ setting to ‘Feeds in my nuget.config’
ii.
Select ‘Path
to nuget.config’ as the path to added nuget.config file
Use nuget.config in the project and add a package
source to your organization's nuget feed
In devops nuget restore taksk mention set 'Feeds to
Use' as 'Feeds in my nuget.config' and select the added nuget.config file
Friday, May 15, 2020
DevOps Visual Studio Build Could Not resolve reference
- Build the solution in laptop.
- Select the project which fails to build
- In the solution explorer click on show all files at the top.
- Then expand bin/debug or bin/release folders
- Right click on Newtonsoft.Json.dll and select 'Add Ignored File to Source Control' command.
- Right click again on the file and select 'Include in Project' command.
- Lastly check in the project and build on devops
Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.IdentityModel.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca' or one of its dependencies. The system cannot find the file specified.
Tuesday, May 12, 2020
Using parameters for different publish profiles in web deploy
Tuesday, May 5, 2020
Package 'AppForSharePoint16WebToolkit.4.0.0' is not found on source 'https://api.nuget.org/v3/index.json'.
c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch
If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...
-
SharePoint has a great feature to set terms which can be used to tag contents and enable terms based navigation and several other interesti...
-
Responsive design http://webdesignerwall.com/tutorials/5-useful-css-tricks-for-responsive-design http://palantir.net/blog/responsive-de...
-
Secure Microservices Using JWT With Ocelot in .NET Core (code-maze.com)