Error "Unable to load the service index for source" while trying to publish a NuGet package to gitlab.com - gitlab

I have a private C# project on the gitlab.com and want to create a NuGet package there.
I followed the instruction and created the following Nuget.config file on the solution level.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="gitlab" value="https://gitlab.com/api/v4/project/{my_project_numeric_id_here}/packages/nuget/index.json" />
</packageSources>
<packageSourceCredentials>
<gitlab>
<add key="Username" value="{my_username_in_gitlab}" />
<add key="ClearTextPassword" value="{my_personal_token_with_api_access_here}" />
</gitlab>
</packageSourceCredentials>
</configuration>
Then I used the Visual Studio Package Manager Console and ran the following command:
dotnet nuget push "C:\{path_to_the_package_here}\MyProject.1.0.0.nupkg" --source gitlab
and had the following error:
error: Unable to load the service index for source https://gitlab.com/api/v4/project/{my_project_numeric_id_here}/packages/nuget/index.json.
error: Response status code does not indicate success: 404 (Not Found).
MyProject.1.0.0.nupkg — exists.
Nuget.config — is seen by the command (reflects changes in the file).
Personal Token — I played with different permissions, at least api permission is granted, and all others too.
What is wrong in my actions and how to create a NuGet package from the C# project on GitLab.com?

Related

Azure Role Service can`t deploy - WaHostBootstrapper.exe.config missing

I`m trying to deploy New Azure Service (using SDK 2.9) and encounter the following error:
The file provided is not a valid service package.
Invalid application runtime - a runtime component is missing:/base/x64/WaHostBootstrapper.exe.config.
Screenshot of the error
What did I try:
Tried to package the service and saw "base/x64/WaHostBootstrapper.exe.config" exists and not missing. Screenshot of the Package Folder
Tried to deploy other service from different workload (also SDK 2.9) it works.
Tried to compare the content of WaHostBootstrapper.exe.config between the to mentioned sevices and it was identical
Attaching the contents of the file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727" />
</startup>
<runtime>
<NetFx40_LegacySecurityPolicy enabled="false" />
</runtime>
</configuration>
Any ideas what else can I check or try to do?
Thanks a lot for you help

How to deploy jHipster on Azure App Service, I got 500 request timed out

This guideline provided by Microsoft is for SpringBoot App
https://learn.microsoft.com/en-us/azure/app-service/app-service-deploy-spring-boot-web-app-on-azure
which is essentially:
Create an Azure web app for use with Java
Specify the Java version
Obtain FTP deployment credential
Upload your SpringBoot .JAR along with provided web.config
Restart the web app via Azure portal
The app works!
Instead of .jar, jHipster is producing .war file. Since it is essentially the same (i.e. it can be executed with java -jar), I was hoping the steps would also works for .war.
I've uploaded:
the .war file
the .war.original file
web.config
This is the aforementioned web.config. Please note I've renamed the -jar into -war
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -war "%HOME%\site\wwwroot\gmbgenpro-0.0.1-SNAPSHOT.war"">
</httpPlatform>
</system.webServer>
</configuration>
The app is loading so long that I got the 500 request timed out.
EDIT: I've enabled stdout in the web.config and I got the following from the log files:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unrecognized option: -war
So it seems I could not use the -war parameter, and I don't know what to do.
To deploy your JHipster project as a WAR file, make sure you build it with spring-boot.repackage.skip option enabled. This will skip building an executable WAR file and simply package the WAR file normally under ${finalName}.war. This way you can deploy your application to a web runtime on Azure automatically configured for you.
To proceed with the deployment, follow these steps:
Add the following Maven Plugin configuration to your main element of your pom.xml:
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<!-- check Maven Central for the latest version -->
<version>1.3.0</version>
<configuration>
<resourceGroup>your-resource-group</resourceGroup>
<appName>your-app-name</appName>
<linuxRuntime>tomcat 9.0-jre8</linuxRuntime>-->
</configuration>
</plugin>
Build your project with the following command, and adjust your profile accordingly:
./mvnw clean package -Pdev -Dspring-boot.repackage.skip=true
Deploy your application:
./mvnw azure-webapp:deploy
For up-to-date information about the Maven Plugin for Azure App Service, check the documentation.

How do I provide private NuGet feed credentials to an Azure Function?

I am trying to create an Azure function which has dependencies on NuGet packages hosted in a private NuGet feed.
This question describes using a nuget.config file which is uploaded to the app service which hosts the function - my nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="MyPrivateFeed" value="https://<url to feed>" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
My function is using this config file as expected, but it doesn't have the credentials it needs. The Azure function portal shows the following:
2016-10-04T09:00:55.442 Starting NuGet restore
2016-10-04T09:00:56.926 Restoring packages for D:\home\site\wwwroot\HttpTriggerSqlDb\project.json...
2016-10-04T09:00:58.267 Please provide credentials for: https://<url to feed>
2016-10-04T09:00:58.515 Unable to load the service index for source https://<url to feed>.
2016-10-04T09:00:58.515 Response status code does not indicate success: 401 (Unauthorized).
How do I provide credentials for the private feed?
You should be able to set up your credentials directly in the nuget config file: https://docs.nuget.org/ndocs/schema/nuget.config-file.md#packagesourcecredentials.

Error starting application in .netcore

I'm getting the following error when navigating to my IIS published .netcore application:
I have set up my web.config file as so:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\KritnerWebsite.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>
Not sure if this warning is relevant or just outdated:
Severity Code Description Project File Line Source Suppression State
Warning The element 'system.webServer' has invalid child element 'aspNetCore'. List of possible elements expected: 'asp, caching, cgi, defaultDocument, directoryBrowse, globalModules, handlers, httpCompression, webSocket, httpErrors, httpLogging, httpProtocol, httpRedirect, httpTracing, isapiFilters, modules, applicationInitialization, odbcLogging, security, serverRuntime, serverSideInclude, staticContent, tracing, urlCompression, validation, management, rewrite'. KritnerWebsite D:\gitWorkspace\KritnerWebsite\src\KritnerWebsite\web.config 12 Build
The line in the web.config was as per the template, I just changed "false" to "true" for stdoutLogEnabled.
I have also created an empty folder in the root directory "logs" - I wasn't sure if this should get created automatically or not. Either way, nothing is being written to the logs, so I am not sure what to try next.
I have opened the solution in VS2015 on my host, compiled it and ran it successfully through commandline/localhost with dotnet run. This is running it in the production configuration, so pulling from my environment variables for insights key, and connection string. So I'm not sure why the site would run successfully on my host through dotnet run but not when published to IIS
How do I get further information on what the error is?
I'm not sure what exactly caused the logs to start correctly recording in ./logs... but they did. With the exception now being recorded I could see that my connection string I had set up in my Environment Variables was off.
Still not sure what caused the logs to not write out in order for me to determine this faster.
After updating my environment variable and running iisreset as per https://serverfault.com/questions/193609/make-iis-see-updated-environment-path-variable my website is now being served properly.

CrmSvcUtil.exe Getting Error

I am new to Dynamics CRM. iam try to generate the data context class using CrmSvcUtil.exe
this is my command
CrmSvcUtil.exe /out:E:\OrgXrm.cs
/url:https://mdtestuser.api.crm5.dynamics.com/XRMServices/2011/Organization.svc
/username:MDTest#MDTestUser.onmicrosoft.com /password:Password
/deviceid:11bdver2vrqok88p7ek8r5umk0 /devicepassword:.devicepassword
but its giving an error ;
Exiting program with exception: An error occurred when verifying security for th
e message.
Enable tracing and view the trace files for more information.
CrmSvcUtil.exe Error: 0 : Exiting program with exit code 2 due to exception : Sy
stem.ServiceModel.FaultException: An error occurred when verifying security for
the message.
Did you try specifying the port in the end of the URL?
Also Verify the Time and Date settings (including timezones) are set correctly on both the server and your client machine.  It seems that if the two machines are out of sync by more than a minute or two it will cause this problem.
Refer the below link:
http://msdn.microsoft.com/en-in/library/gg327844.aspx
To fully understand your error, you should use config file with enable tracing, here is an example of config file:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="servicecontextname" value="XrmServiceContext"/>
<add key="codecustomization" value="Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"/>
<add key="username" value="domain\user"/>
<add key="password" value="password"/>
<add key="out" value="XrmEntitiesReference.cs" />
</appSettings>
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="configConsoleListener" type="System.Diagnostics.ConsoleTraceListener">
<filter type="System.Diagnostics.EventTypeFilter" initializeData="Error" />
</add>
</listeners>
</trace>
</system.diagnostics>
</configuration>
check out example from here:
http://www.resultondemand.nl/support/sdk/06abab26-40fc-4b85-9a2a-5e68903ea138.htm
Try it without:
/deviceid /devicepassword
Hi if you are having trouble executing your command try doing it through Visual Studio, the link below shows an excellent step-by-step guide how to use CrmSvcUtil:
http://mscrmshop.blogspot.co.uk/2012/03/how-to-use-crmsvcutil-improved-version.html

Resources