Errors when trying to use StackExchange REDIS in Azure Cloud Service Worker Role - azure-cloud-services

I have a solution hosted in Azure that is using ServiceStack.Redis 2.0.601.
App Services (Web API) and On-Premise windows services are all working as expected but the Cloud service worker roles are throwing binding errors.
Add Binding redirect and enable auto binding redirect in the worker role.
Use ILSpy to verify the versions that are copied by the build have same version as defined in the binding redirect.
Use fuslogvw.exe to catch binding errors but couldn't make it get any data from the Cloud Service Emulator
I'm running the same code with same app configs in other type of projects and all working great
The code is very simple, Create a cloud service with one worker role.
Add StachExchange.Redis nuget version 2.0.601 and try to connect a REDIS instance using the following line:
var connection = ConnectionMultiplexer.Connect(#ConnectionString#);
This is the only line I have in the code inside WorkerRole.OnStart Method.
System.BadImageFormatException: 'Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)'

I was getting similar errors, and realized I needed to add a bunch of additional Nuget packages.
System.Buffers
System.IO.Pipelines
System.Memory

Related

FF4J with Spring Boot in IBM WebSphere 8.5.11 server giving Error 500( SESN0008E) while accessing static resources(css,img)

I am using FF4J-Web as a maven jar dependency in my Spring Boot application. I am able to run the application in local environment without any issues( embedded tomcat and IBM Liberty Servers). However I am facing some issues in rendering view components when I promote the changes to development environment server(IBM WebSphere 8.5.X) which seems to be due to authorization issue. Please find below responses I got while accessing static contents.
Response Code 200: https://dummyserverlink.com/rootcontext/ff4j-web-console/static/js/jquery.dataTables.min.js
Response Code 500: https://dummyserverlink.com/rootcontext/ff4j-web-console/static/css/bootstrap.min.css
Response Code 500: https://dummyserverlink.com/rootcontext/ff4j-web-console/static/png/ff4j.png
As you can see above, .js files are downloading without any issues. But .css and .img files are not authorized and accessible in the browser(Error Code Status 500). But all resources are present under static folder only. Please note that since I have added FF4J as a maven dependency all the static contents are present inside WEB-INF/lib folder
So if I try to access the .css/.png resource directly from browser, I am getting error ‘Error 500: SESN0008E: A user authenticated as anonymous has attempted to access a session owned by loggedUserName.’
Disabling the security configuration in Websphere is not an option we can go with as the same server is used for multiple applications. Also I am using third party login API for authentication at server level.
Is there any other way that you can share you expertise to bypass the authorization error for static resources(css,img) that are inside the WEBINF folder?
Regards
Dinesh

No response when trying to publish the project on to the WAS Server

I have imported a project into the eclipse and it has different modules like
Audit
AuditEJB
Common
CommonLoginConsumer
Core
Db2Integration
EJB
InitWeb
Integration EAR
MDMIntegration
PrepackagedApps
Properties
SchedulerEJB
ScreensWeb
WebServiceConsumer
WebServiceProvider
Provider
CCWSTest (Gradle module)
CTest
CUiWeb
UtilityTestEAR
UtilityTestWeb
Configured build Path, solved all the Java Problems. In the company that I'm working to configure WAS Server 8.0, we need to configure DSC which has all the deployment frameworks.
In Servers (Right click)> Add and Remove, I have IntegrationEAR and UtilityTestEAR
UtilityTestEAR contains Properties, and UtilityTestWeb
Integration EAR has apsclient-source.jar, Adit, AuditEJB, Common, CommonLoginConsumer, Core, Db2Integration, EJB, InitWeb, MDMIntegration, Properties, SchedulerEJB, ScreensWeb, WebServiceConsumer, WebServiceProvider, Provider, org.apache.soap.encoding61.jar
When I added UtilityTestEAR to the WAS Server, Server started Successfully and when I try to publish there was no response.
When I added IntegrationEAR to the WAS Server, when I started the server, there was an error saying:
The publish encountered some problems and the application may not have been installed or it may have been successfully installed but was unable to start.
The application contains validation errors. Correct the errors in the Problems view before publishing the application on the server.
If you want to allow applications containing errors to be published on the server, enable the Allow applications containing errors to be published on a server check box (Windows > Preferences > Servers > WebSphere).
CHKJ2802E: class com.ford.mss.cdr.cib.mdb.CdrAuditLogMDB, or one of its supertypes, cannot be reflected. Check the classpath.
I am trying to deploy to my localhost.
Please Suggest

Startup.cs not needed on DEV machine but needed for deployment

I am developing an ASP.NET Web API v2 application. My application works fine from my DEV machine but when I go to deploy it to my server it gives the following errors.
The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- No assembly found containing a Startup or [AssemblyName].Startup class.
To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.
After searching Google, SO, and other sites I found adding a default Startup.cs class to my project fixed the issue. The problem is I don't know how.
What did adding Startup.cs do?
Why would my app compile and run on my development machine without Startup.cs?
This seems to involve OWIN but I was not even aware I was making use of any OWIN features.
This is most likely due to the way OWIN searches for its entry point (Startup class). In your dev environment you probably have a DLL in the project folder that has an OWIN Startup class. That dll is not being deployed as part of the deployment step and therefore doesn't exist in your deployed location.
Another posibility, along the same lines, is you're using .config transformations and you have defined a Startup class in your DEV config but not in your deployed config.
<appSettings>
<add key="owin:appStartup" value="StartupDemo.ProductionStartup" />
</appSettings>
OWIN Startup Class Detection might be informative.
MVC5 uses OWIN pipeline by default so it's "under the hood". Perhaps you migrated from a previous MVC site and that's why the Startup class was missing?
Cheers!

Add WCF Service Reference to Umbraco

Im currently using Umbraco 4.11 that is integrated to an asp.net mvc 3 application. Im trying to reference a wcf service in the umbraco project by selecting Add Service Reference in visual studio but I can not seem to access the service library once it is added. I tried to look into the object view browser and I couldn't find the object namespace for the wcf service. Am I missing something? Is this method of consuming wcf service in umbraco possible? I prefer not to use a separate project that uses a user control to access the wcf service since it seems to be tedious to do.
There is a warning when adding a service reference:
Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Could not load file or assembly 'umbraco, Version=1.0.4090.38017, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
You may want to setup the service reference in a separate project, then migrate the dll and the web.config settings. Then you should be able to access your web service via razor after adding using statements.
The problem is that the code file for the service isn't being generated because of a conflict with umbraco. You could alternatively generate the code file manually using svcutil.exe.

silverlight project setup

i have a a new silverlight solution in visual studio. i have created a silverlight class library to share common functionality. this class library has a service reference and so it has a ServiceReferences.ClientConfig file. the problem is if i create a project in this solution and add a reference to the class library it seems that i need a ServiceReferences.ClientConfig in this individual project. if i copy and paste the ServiceReferences.ClientConfig file from the class library to the project, everything works fine. if i do not i get the error below. doesnt this defeat the purpose of sharing this service reference in a class library? i want to be able to change where the service reference points to (debug machine / production machine) easily in one place. what can i do? is there another way i'm missing? Thank you.
Cannot find 'ServiceReferences.ClientConfig' in the .xap application package. This file is used to configure client proxies for web services, and allows the application to locate the services it needs. Either include this file in the application package, or modify your code to use a client proxy constructor that specifies the service address and binding explicitly. Please see inner exception for details. >
The config for the class library is not packaged into the .xap file. Without that configuration, the service reference cannot be properly configured.
doesnt this defeat the purpose of sharing this service reference in a class library?
Not really. The bulk of the "service reference" is the code in the class library. This is what you are sharing. Since a xap (or exe and web app) has only one config file, you must have the ServiceReferences.ClientConfig in the application's config file.
I am not aware of a mechanism to copy some important bits from the config file of a class library to the application config file during a build.

Resources