Client Version Error after installing Azure 1.8 - c#

I recently installed the Azure SDK 1.8 on my machine but am still using a project that is running version 1.7.1 (June 2012 SP1 for VS2012). Since I did this, every time I try to run my project I get the following error:
ErrorCode<ERRCA0019>:SubStatus<ES0001>:Check the client version. It should be within the allowed version range on the server. If necessary, upgrade the client to the allowed version.
[DataCacheException: ErrorCode<ERRCA0019>:SubStatus<ES0001>:Check the client version. It should be within the allowed version range on the server. If necessary, upgrade the client to the allowed version.]
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus errStatus, Guid trackingId, Exception responseException, Byte[][] payload, EndpointID destination) +767
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody, EndpointID destination) +149
Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable`1 servers, RequestBody request, Func`3 sendMessageDelegate, DataCacheReadyRetryPolicy retryPolicy) +967
Microsoft.ApplicationServer.Caching.WcfClientProtocol.Initialize(IEnumerable`1 servers) +606
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName, CreateNewCacheDelegate cacheCreationDelegate, DataCacheInitializationViaCopyDelegate initializeDelegate) +1103
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName) +131
Microsoft.Web.DistributedCache.DataCacheFactoryWrapper.CreateDataCacheFromFactory(DataCacheFactory factory, String cacheName) +63
Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler`1 fetchingHandler, EventHandler`1 fetchedHandler) +356
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateInternalProvider(IHttpRuntime httpRuntime, SessionInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler`1 cacheFetching, EventHandler`1 cacheFetched) +447
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetInternalProvider() +315
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.ResetItemTimeout(HttpContext context, String id) +59
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +707
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +12600474
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
I have not had much luck finding a solution. Some forums have mentioned using a different AppFabric version, but they all seem to be referring to running it in the actual Azure cloud service and I can't even get it to run on my local machine.
Any thoughts?

I ran into a similar problem while upgrading to the October 2012 release. I resolved it by removing all the caching references in my project, and then installing the Windows Azure Shared Caching package from NuGet.
I'm not sure if the resulting project will still run with the June 2012 SDK. But it's worth a try.

Related

Issue accessing GCP secrets manager using dotnet 5

I am using Google.Cloud.SecretManager.V1 in my .NET 5 aspnet core application. I am containerizing application to run as linux container on GCP Cloud run. I get following exception while creating SecretManagerServiceClient
//call SDK
SecretManagerServiceClient client = SecretManagerServiceClient.Create();
System.DllNotFoundException: Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl.so: cannot open shared object file: No such file or directory
at Grpc.Core.Internal.UnmanagedLibrary.Linux.dlopen(String filename, Int32 flags)
at Grpc.Core.Internal.UnmanagedLibrary.LoadLibraryPosix(Func`3 dlopenFunc, Func`1 dlerrorFunc, String libraryPath, String& errorMsg)
at Grpc.Core.Internal.UnmanagedLibrary.PlatformSpecificLoadLibrary(String libraryPath, String& errorMsg)
at Grpc.Core.Internal.UnmanagedLibrary..ctor(String[] libraryPathAlternatives)
at Grpc.Core.Internal.NativeExtension.LoadUnmanagedLibrary()
at Grpc.Core.Internal.NativeExtension.LoadNativeMethods()
at Grpc.Core.Internal.NativeExtension..ctor()
at Grpc.Core.Internal.NativeExtension.Get()
at Grpc.Core.Internal.NativeMethods.Get()
at Grpc.Core.GrpcEnvironment.GrpcNativeInit()
at Grpc.Core.GrpcEnvironment..ctor()
at Grpc.Core.GrpcEnvironment.AddRef()
at Grpc.Core.Channel..ctor(String target, ChannelCredentials credentials, IEnumerable`1 options)
at Google.Api.Gax.Grpc.GrpcCore.GrpcCoreAdapter.CreateChannelImpl(String endpoint, ChannelCredentials credentials, GrpcChannelOptions options)
at Google.Api.Gax.Grpc.GrpcAdapter.CreateChannel(String endpoint, ChannelCredentials credentials, GrpcChannelOptions options)
at Google.Api.Gax.Grpc.ChannelPool.GetChannel(GrpcAdapter grpcAdapter, String endpoint, GrpcChannelOptions channelOptions, ChannelCredentials credentials)
at Google.Api.Gax.Grpc.ChannelPool.GetChannel(GrpcAdapter grpcAdapter, String endpoint, GrpcChannelOptions channelOptions)
at Google.Api.Gax.Grpc.ClientBuilderBase`1.CreateCallInvoker()
at Google.Cloud.SecretManager.V1.SecretManagerServiceClientBuilder.BuildImpl()
at Google.Cloud.SecretManager.V1.SecretManagerServiceClientBuilder.Build()
at Google.Cloud.SecretManager.V1.SecretManagerServiceClient.Create()
Same code works fine if I use aspnetcore 3.1 image. NET 5 is supposed to be upgrade of .NET core 3.1 and backward compatible. So, I am curious and what could be done to make this code work on .NET 5
I posted this answer to make a solution from the comment section more visible.
As it was suggested by #John Hanley and confirmed by #SmartCoder this issue was solved by adding to the Docker file lines below:
RUN apt-get update -y
RUN apt-get install -y libc6-dev

The given key was not found error on ServiceStack

Suddenly, I've started to get error in my ServiceStack MVC service application as below :
{"The given key was not present in the dictionary."}
System.Exception {System.Collections.Generic.KeyNotFoundException}
and StackTrace:
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at ServiceStack.WebHost.Endpoints.Utils.FilterAttributeCache.GetRequestFilterAttributes(Type requestDtoType) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\Utils\FilterAttributeCache.cs:line 44
at ServiceStack.WebHost.Endpoints.EndpointHost.ApplyRequestFilters(IHttpRequest httpReq, IHttpResponse httpRes, Object requestDto) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\EndpointHost.cs:line 201
at ServiceStack.WebHost.Endpoints.RestHandler.ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, String operationName) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\RestHandler.cs:line 79
at ServiceStack.WebHost.Endpoints.Support.EndpointHandlerBase.ProcessRequest(HttpContext context) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\Support\EndpointHandlerBase.cs:line 150
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I've no idea about the error or what wrong is. My app was working and now not working.
Any idea how to fix this ?
EDIT 1: When I navigate the service url in my webbrowser,the debugger never reaches to my service classes and Run methods.
Well, quite strange!
Here are the actions I took and did not work.
Restart IIS and VS 2010.
Compile the code and debug on VS 2010.
Compile the code and replace with the content on IIS and restart IIS again.
Here are the action I took and the project started to work again.
Create a new MVC project.
Install ServiceStack MVC via NuGet.
Copy existing codes to new project.
Rename the namespace in existing code on the new project.
Debug on VS2010 and project started to work like a charm.
When I published the project to the the existing WebSite on IIS , I got the error below :
AppHost instance has been already set
However, to pass the error, I've deleted the existing website and created a new one.
Than, I've copied the new project output in the new website.
All started work like a charm again.
But I still don't know why I got the errors.
I hope this will help who may have the same problems.
I received this error from using the wrong model in the routes.
So:
Routes.Add<ModelA>("/path/to/service");
Should be
Routes.Add<ModelB>("/path/to/service");

Oracle oci.dll missing when running on MSTest agent

I'm trying to get some database related integration tests running on a MSTest test agent. We use c# and an oracle db with devart dotconnect.
Since we need to use indirect mode, I installed devart and an oracle client on the test agent.
The tests run smoothly when I execute them on my local machine. But when executed on the test agent (remotely), it can't find the client's oci.dll, which is a dependency somewhere:
System.IO.FileNotFoundException: Can not load Oracle client library oci.dll from home ..
Now, I have no idea why that happens. I checked the PATH environment variables already, but they seem fine. Any ideas why this works on my machine, but not when deployed to the test agent?
edit: added stacktrace within devart:
Devart.Data.Oracle.OracleHome.get_ClientVersion()
Devart.Data.Oracle.aw.a(Boolean A_0, Boolean A_1, OracleHome A_2, Boolean A_3)
Devart.Data.Oracle.OracleInternalConnection..ctor(aa connectionOptions, OracleInternalConnection proxyConnection)
Devart.Data.Oracle.cs.a(k A_0, Object A_1, DbConnectionBase A_2)
Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, k A_1, DbConnectionBase A_2)
Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0)
Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
Devart.Common.DbConnectionBase.Open()
Devart.Data.Oracle.OracleConnection.Open()
Thanks for the replies, got the right pointers. Apparently the problem occurs when a 64bit thread tries to load a 32bit OCI.DLL and vice versa. However, I played around with the test settings and build settings related to 32/64 things, but to no avail.
Anyway, I was able to solve the problem by additionally installing a 64-bit Oracle Client on the test agent. For some reason it seems that then the QTAgent thread finds the right OCI.DLL.
Faced the same problem in a console project. I fixed it by changing the compilation platform setting by going to
project properties -> Compilation -> Destination of the platform and selecting x86.

System.Reflection.RuntimeModule.GetTypes() error with ODP.Net and C#

I wrote a fairly complex C# application which accesses an oracle database via ODP.Net. I developed the application on a windows XP machine (32-bit) where I installed ODAC (32-bit). The application runs without a glitch on my development PC but throws an exception on the server (windows server 2003 x64 service pack 2).
I installed the runtime for .Net framework 4.0 (dotNetFx40_Full_x86_x64.exe) on the server, as well as ODAC -- I first tried with Release 4 (11.2.0.3.0) for Windows x64 and then with ODAC 11.2 Release 4 (11.2.0.3.0) with Oracle Developer Tools for Visual Studio.
None of the worked. The 32-bit version got a bit further. The first time I call a LINQ statement on the database I get the following message.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at System.Data.Metadata.Edm.ObjectItemAttributeAssemblyLoader.LoadTypesFromAssembly()
at System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load()
at System.Data.Metadata.Edm.ObjectItemAttributeAssemblyLoader.Load()
at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData)
at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors)
at System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage)
at System.Data.Metadata.Edm.ObjectItemCollection.ImplicitLoadAssemblyForType(Type type, EdmItemCollection edmItemCollection)
at System.Data.Metadata.Edm.MetadataWorkspace.ImplicitLoadAssemblyForType(Type type, Assembly callingAssembly)
at System.Data.Objects.ObjectContext.GetTypeUsage(Type entityCLRType)
at System.Data.Objects.ObjectContext.GetEntitySetForNameAndType(String entitySetName, Type entityCLRType, String exceptionParameterName)
at System.Data.Objects.ObjectContext.CreateObjectSet[TEntity](String entitySetName)
at MyProgram.Data.DT.DTContext3.get_MYTABLE()
The 64-bit version tells me I have no Oracle.Access support, which is the same as the original error message I got when I first tried to run the application withouth ODAC on the server.
Can any of you help me on that? I've seen some entries discussing similar problems and the only convincing reply I saw was building the executable with Copy Local set to TRUE for all references and, but even that failed. I still get the same error message.
I just found the answer myself. This piece of code, an entry by bgripka which I found in a discussion about this issue, gave me the answer. There was a reference to a missing library (which wasn't needed at all).
catch (ReflectionTypeLoadException ex)
{
StringBuilder sb = new StringBuilder();
foreach (Exception exSub in ex.LoaderExceptions)
{
sb.AppendLine(exSub.Message);
if (exSub is FileNotFoundException)
{
FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
{
sb.AppendLine("Fusion Log:");
sb.AppendLine(exFileNotFound.FusionLog);
}
}
sb.AppendLine();
}
string errorMessage = sb.ToString();
log.Fatal(errorMessage);
}

Failed to map the path '/'. .net 4.0

I have a .net app that I just opened on in visual studio 2010 and converted to 4.0 when it asked me on start-up. I go to try to build the site, and I get this error:
Failed to map the path '/'.
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[InvalidOperationException: Failed to map the path '/'.]
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +8804446
System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath) +42
System.Web.VirtualPath.MapPathInternal() +4
System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) +107
System.Web.HttpRequest.MapPath(VirtualPath virtualPath) +37
System.Web.HttpServerUtility.MapPath(String path) +99
NU.WorkManagement.Lookup.Lookups..ctor() +82
NU.WorkManagement.Engine.GlobalModule.Init(HttpApplication application) +624
System.Web.HttpApplication.InitModulesCommon() +80
System.Web.HttpApplication.InitModules() +43
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327
I tried the most popular solution I found vis google (replace and ../ with ~/ but there wern't any...)
Update:
Lookups constructor:
public Lookups()
{
_dirPath = System.Web.HttpContext.Current.Server.MapPath("/") + _xmlPath;
}
I know it's and old question, but for the record if you are running against IIS then
'iisreset' in the console may help resolving "Failed to map the path '/'." issue. I had this problem after renaming the sites in IIS.
I was just trying to go through an exercise in a Microsoft Step By Step book and I hit this problem when trying to precompile an ASP.NET appliction.
Here's how I got past this - and it took me a day to figure out!
When you open the Visual Studio Command Prompt to do your build/precompile, you must right-click and choose "Run As Administrator".
That's all it took for me when trying to run this aspnet_compiler -v DeployThis C:\DeployThis -f -u
Try System.Web.HttpContext.Current.Server.MapPath("~/"). Notice the ~.
We had the same problem, IISRESET didn't do it.
It turned out that the Virtual Directory we trying to map has a double backslash (d:\folder\\subfolder\) in the naming (IIS virtual directory was created with powershell script). Removing the extra backslash made HostingEnvironment.MapPath stop throwing exceptions.
Just in the case this could help somebody :-)

Categories