CrmSvcUtil.exe Getting Error - dynamics-crm-2011

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

Related

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

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?

setting and reading environment variables in IIS 10

I can not figure out how to set and read environment variables in Microsoft Internet Information Services (IIS) version 10. I have a Fast CGI app that requires environment variables. In previous versions of IIS I just set system-wide variables in the Windows "System Properties". However in IIS 10 my FCGI app isn't reading them. So my first question is if there are steps that need to be taken so that the IIS process can read system variables?
Alternatively, how do I set environment variables within IIS 10? This Microsoft site explains it but not in enough detail for me to get it working. Specifically, in what file and in which section do you put the <environmentVariables> section? The example XML and the command line example have name="Contoso" (see below) but what is that - the name of the application pool, or my FCGI app, or something else?
<applicationPools>
<add name="Contoso" managedRuntimeVersion="v4.0" managedPipelineMode="Classic">
<environmentVariables>
<add name="foo" value="bar" />
</environmentVariables>
</add>
</applicationPools>
Edit in response to Jokies Ding:
MAP22 and PROJ_LIB are the two environment variables that I need. In C:\Windows\System32\inetsrv\Config\applicationHost.config
I have:
<applicationPools>
<add name="DefaultAppPool" />
<add name=".NET v4.5 Classic" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" />
<add name=".NET v4.5" managedRuntimeVersion="v4.0" />
<add name="ASP.NET v4.0" autoStart="true" managedRuntimeVersion="v4.0" />
<applicationPoolDefaults managedRuntimeVersion="v4.0">
<processModel identityType="ApplicationPoolIdentity" />
<environmentVariables>
<add name="PROJ_LIB" value="/gdal/bin/proj6/SHARE" />
<add name="MAP22" value="/tetonwy/mapserv/main.map" />
</environmentVariables>
</applicationPoolDefaults>
</applicationPools>
and
<fastCgi>
<application fullPath="C:\gdal\bin\ms\apps\mapserv.exe">
<environmentVariables>
<environmentVariable name="MAP22" value="C:\tetonwy\mapserv\main.map" />
<environmentVariable name="PROJ_LIB" value="C:\gdal\bin\proj6\SHARE" />
</environmentVariables>
</application>
</fastCgi>
and in a cmd window the environment variables are visible
C:\>set MAP22
MAP22=C:\tetonwy\mapserv\main.map
C:\>set PROJ_LIB
PROJ_LIB=C:\gdal\bin\proj6\SHARE
So it seems like I've got the variables set all over the place but the app isn't seeing them. C:\gdal\bin\ms\apps\mapserv.exe is the FastCGI app that isn't seeing the environment variables. It's a compiled C program that I have used in previous versions of IIS.
There is an issue with MapServer not reading environment variables on Windows when used through FastCGI.
This is resolved by applying https://github.com/MapServer/MapServer/pull/6304 which will be backported to the 7.x MapServer releases.
See Environment variables ignored using FastCGI and IIS #6289 for more details.
<environmentVariables> section is displayed as a collection under specific application pool.
You could find it in IIS global configuration file C:\Windows\System32\inetsrv\config\applicationhost.config.
"Contoso" is the name of application pool.
I think read system-wide variable is still supported in IIS 10 and PHP FAST-CGI. I can get these configuration by running commandline SET in IIS PHP-CGI.
Could you post the code that you used to read the variable?
In some condition, Your application code require elevated permission. You could try to change application pool identity to local system and set Anonymous authenticated user to Application pool identity

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

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.

Glimpse works locally but not on Azure

I'm running the latest version of Glimpse and running the site locally shows the Glimpse bar bottom right but not when hosted on Azure.
I've done everything in this post which says to add the following to the web.config:
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
<inspectors>
<ignoredTypes>
<add type="Glimpse.Mvc.Inspector.DependencyInjectionInspector, Glimpse.Mvc4"/>
</ignoredTypes>
</inspectors>
<runtimePolicies>
<ignoredTypes>
<add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"/>
</ignoredTypes>
</runtimePolicies>
</glimpse>
The official docs don't mention the inspectors node but it doesn't work when I try without it either.
I tried adding:
<logging level="Trace" />
but can't see where that would be output.
When I go to glimpse.axd it correctly hides the warning message that I see on local:
Glimpse.AspNet.Policy.LocalPolicy *This policy means that Glimpse won't run remotely.*
Any ideas on a solution?
As I was on MVC and Azure I needed to do both steps listed here.
Then in views/web.config add:
<add namespace="Glimpse.Mvc.Html" />
In your Web.config add the runtimePolicy as below.
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd" >
<runtimePolicies>
<ignoredTypes>
<add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"/>
</ignoredTypes>
</runtimePolicies>
</glimpse>
And then add #Html.GlimpseClient() to the end of your Layout page.
No idea why this second part is necessary for remote and not local, but it worked for me.

Resources