XSockets.NET windows service won't start - .net-4.0

I cannot get the xsockets.net windows service to work. Currently, I'm using this source because I couldn't find a better one
the solution was built in VS2012Express edition,
installed it using .NET v4 framework InstallUtil.exe
When trying to start the service in windows service dialogue it gives a dialogue saying: "The XSockets.NET service on Local Computer started and then stopped." The Windows event viewer just lists: "The XSockets.NET service entered the stopped state."
I'm all newbie to .NET and C#, just trying to get websockets to work and going a little crazy on this issue :-)
Any help appreciated.

If all the XSockets's plugins (dlls ) is in place, and the app.config of your Windows Service is okey, it should not give that kind of error.
At the following repo you find an template, it is maybe that one you are refereeing to?
https://github.com/MagnusThor/XSockets.Windows.Service
Make sure all of the DLL's listed here 'https://github.com/MagnusThor/XSockets.Windows.Service/tree/master/Dependencies' is referenced in the project that "host" the XSockets.NET ( project that create an Service ) as shown below
protected override void OnStart(string[] args)
{
new XSockets.Windows.Service.Host.Instance();
}
<-
Hope that this helps!
Magnus

Make sure all of the DLL's (including dependencies) of your project are on this folder C:\Chocolatey\lib\XSockets.Windows.Service.2.5.2\tools
I had the same problem and I solved putting the dependencies in that folder, i.e: EntityFramework.dll...
I hope this help you.

Related

Consuming WCF in Xamarin forms

I am generating a WCF proxy using add web referance in Xamarin Studio
yet genrated proxy create the following error:
The type or namespace name IExtensibleDataObject' does not exist in the namespaceSystem.Runtime.Serialization'. Are you missing an assembly reference? (CS0234) (infra)
I am using mono4.0.5
Can anybody help me solve this problem that gave me many sleepless nights.
PS: I tried to skip proxy generation to using slsvcutil.exe code generation
but the same error keeps happening
Right click on you project and select Edit references. Look for System.Runtime.Serialization and select it.
If you already set the reference of System.Runtime.Serailization and error is still persist then try following regular steps..
clean solution and rebuild solution
restart visual studio
I found a solution for your problem. The problem is Xamarin Portable Targets. The targets must not contain any Windows targets selected. After changing this as in the image below it will not give you any compile time errors for System.Runtime.Serialization.
I found that after reading this https://developer.xamarin.com/guides/android/under_the_hood/assemblies/
The System.Runtime.Serialization.dll is for the Silverlight package and when selecting windows targets it might be removing these dlls/code not supported in windows platform from the portable libraries.

Xamarin Forms how to consume a wcf service

I've created a Xamarin project which added the following projects to the solution:
Xamarin.UI(Portable)
Xamarin.UI.Droid
Xamarin.UI.iOS
Xamarin.UI.UWP
Xamarin.UI.Windows (Windows 8.1)
Xamarin.UI.WindowsPhone (Windows Phone 8.1)
I am having problems creating a client which can consume my WCF service.
1) Firstly the current Xamarin project template doesn't reference System.ServiceModel assembly in the PCL therefore I cannot right click the PCL and Add Service Reference to my project. When I manually add a reference to System.ServiceModel from this location - C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5 the menu item for create service reference pops up. When I click Go in the Add Service Reference dialog I get the following error:
"This service cannot be consumed by the current project. Please check if the project target framework supports this service type."
The PCL targets are as follows:
.NET Framework 4.5
ASP.NET Core 1.0
Windows 8
Windows Phone 8.1
Xamarin.Android
Xamarin.iOS
Xamarin.iOS
I don't know how to get this working ?
2) Secondly the work around I use is to create the client with SlSvcUtil.exe
Add the generated code to my PCL along with a reference to System.ServiceModel and everything builds ok. The problem is that when I run the code it flags up type reference errors ! Should I be manually adding the reference to System.ServiceModel anyway? What am I doing wrong in this scenario? Am I missing some steps?
I've checked the Xamarin docs but it seems that I can't find detailed instructions on this.
Please help me out ! Thanks:)
PCL and WCF should be supported. Alternatively, you could get this to work manually with HttpClient, etc. But maybe if you can use the shared project instead of PCL, that would be easier. Otherwise you'd have to also use DependencyService, create interfaces, etc. for each platform.

Windows Azure - Microsoft.IdentityModel not found

I installed WIF runtime and SDK on my machine. I added Microsoft.IdentityModel.dll to my azure web application and locally everything is running great. I build simple web application which use Azure AppFabric Access control. I follow azure labs for that and as I told, local everything is great. When I published my web application to Azure, I'm getting following error :
Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
I get it after Appfabric Relaying part is going to return url, after sign in on identity provider. The weird thing is that I set Copy Local to TRUE, because that .dll is not part of Azure GAC. I tried to publish it again, but I received same error. I found few same problems on the internet but with no concrete solution. Does anybody here had something similar and probably have a working solution? Thank you in advance
For anything that I need to deploy locally to Azure I make a copy of the DLL's in my project folder and reference them from there while setting copy local to true. Since doing this I no longer have any issues with DLL's not being published to Azure. I also do all of my building through the command line using MSBuild and publish the cspack by hand. This means that I do not rely on Visual Studio for doing the build or deployment.
I have run into this and solution described in this blog helped. You will need to run this command from your role startup task:
gacutil /nologo /i .\Microsoft.IdentityModel.dll
This startup task has to be run with full privilegies.
Have you tried disabling encryption on the creation of the deployment package and verifying that the dll is indeed present?
Create a new environment variable called: _CSPACK_FORCE_NOENCRYPT_ set the value to true.Restart your visual studio.

Silverlight designer unhandled exception

When I create a new Silverlight Application (C# if that matters) using Silverlight 4 (with or without WCF RIA Services Checked) and open the MainPage.xaml in the designer I receive an Unhandled Exception has occurred. Stack is below. This is on an unmodified project.
I have uninstalled all Silverlight and reinstalled the tools listed above. I the same error when I open the App.xaml file as well. When I compile it completes without error, however when I run the application it always comes up that Silverlight is not installed.
I have installed Visual Web Developer Express 2010 (v10.0.30319.1 RTMRel) and Silverlight Tools for VS2010 (v10.0.30319.332) on a 32bit Windows XP machine. The IDE works fine in other regards, only issue seems to be with xaml files.
Anybody run into this?
System.NullReferenceException
Object reference not set to an instance of an object.
at Microsoft.Expression.Platform.Silverlight.SilverlightDomainManager.CreateDomainCore()
at Microsoft.Expression.Platform.Silverlight.SilverlightDomainManager.CreateDomainInitial()
at Microsoft.Expression.Platform.Silverlight.SilverlightPlatformCreator.Initialize()
at MS.Internal.Platform.SilverlightPlatformImpl.Initialize()
at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.EnsurePlatformInitialized()
at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.EnsurePlatformInitialized()
at MS.Internal.Package.VSIsolationProviderService.CreateIsolationProvider(String originalIdentifier, Boolean isGlobal, String identity, FrameworkName frameworkName, AssemblyName appAssemblyName, IVsHierarchy hierarchy)
at MS.Internal.Package.VSIsolationProviderService.CreateIsolationProviderWorker(String identifier, IServiceProvider provider)
at MS.Internal.Package.VSIsolationProviderService.CreateIsolationProvider(String identifier, IServiceProvider provider)
at MS.Internal.Providers.VSDesignerContext.CreateIsolationProvider(IServiceProvider provider, IVsHierarchy hierarchy)
at MS.Internal.Providers.VSDesignerContext.<>c__DisplayClass1.b__0(IsolationProviderProxy i)
at MS.Internal.Providers.IsolationProviderProxy.get_RealProvider()
at MS.Internal.Providers.IsolationProviderProxy.add_UnhandledException(UnhandledExceptionEventHandler value)
at MS.Internal.Designer.DesignerPane.LoadDesignerView()
After hours of pulling my hair out I found the following post that led me on the path to solving my problem. I had to uninstall the standard version of silverlight and then install the developer runtime and it solved all my problems. Go Figure.
Posted by Microsoft on 2/26/2010 at
12:40 PM Is what is likely
happening is that you have the
standard version of the Silverlight
runtime and you need to install the
developer runtime for Silverlight.
Blend will install and run with the
standard verison of the silverlight
runtime, but Visual Studio requires
the developer version of the runtime.
This issue is fixed in the RTM version
of Visual Studio.
For now, if you hit this issue, please
install the silverlight developer
runtime from this link:
http://go.microsoft.com/fwlink/?LinkId=146060
download Silverlight_Developer.exe
Did you install the latest Silverlight SDK?
http://www.microsoft.com/downloads/details.aspx?FamilyID=40ef0f31-cb95-426d-9ce0-00dcfabf3df5&displaylang=en

How can I make a .Net 4.0 Exe ask the user to download .Net 4.0 framework / redistributable before running this exe?

I thought that latest Matlab does this automatically. I have tested the following exe on a clean Win XP VM:
namespace DotNetTest
{
using System.Windows.Forms;
class Program
{
static void Main(string[] args)
{
MessageBox.Show("Howdy!");
}
}
}
When I run it on a computer which has all these installed, it does show the message box and a window. When I run it on a clean VM, I get this error:
Title: DotNetTest.exe - Application Error
Icon: Error
Buttons: {OK}
Message Body: The application failed to initialize properly (0xc0000135). Click on OK to terminate the application.
I would expect better from MSFT geniuses. Why cannot every .Net exe contain a tiny bit of overhead and have the very first bytes of it do the work of detecting if .Net is installed and presenting a better message.
Is there some sort of setting that I can flip to fix this? All of the settings were default ones provided by VS2010 when I created a new project.
Thank you.
This is what you use an installer for. In .net this is simple, you just "publish" your project and you get an installer that makes shure that .net is installed and such. The application itself should never have to worry about that.
As Alexandr says, you should really use the installer for this. If that's not possible, you'd have to write an unmanaged exe to run first and then either start the .net exe or tell the user to download the framework depending on if it's already installed.