AppFabric Applications June SDK Problems
-
vendredi 9 septembre 2011 11:34
Hi,
I've just installed the Azure AppFabric SDK - June Update. I was interested in the AppFabric Application Manager so I tried using the 'Getting Started' tutorial found at http://msdn.microsoft.com/en-us/library/hh239695.aspx
When I run the application I get the following error message:
Can anyone suggest a solution?
Thanks
Toutes les réponses
-
vendredi 9 septembre 2011 15:09Modérateur
Hey, I will try this out on my VM and see if it is a sample that got broken with the latest CTP. I can report the problem to the Microsoft team that created the sample and see if they can release an update.
Thanks,
If this answers your question, please use the "Answer" button to say so | Ben Cline -
vendredi 9 septembre 2011 16:29Modérateur
It seems a little confusing to me which site you are running - when you follow the tutorial, it creates a site at Web1 on your local server that runs the Default.aspx page like at http://127.0.0.1/Web1/Default.aspx.
For your error I would guess maybe the service reference got removed or did not generate successfully. Maybe try to go back to App.cs, remove the service reference and add it again.
Thanks,
If this answers your question, please use the "Answer" button to say so | Ben Cline -
vendredi 9 septembre 2011 16:40
Have triec removing and rhen adding the service reference and get the same problem.
The error I have included happens when I set the Web application as the startup project...I did this so that I could debug to find where the application fell over. When I set the appfabric application as startup and run it through the emulator I get the same error.
I get similar issues when I try the ContosoPizza application included in the CTP samples.
-
vendredi 9 septembre 2011 17:49Modérateur
Interesting. I wonder if you have had a previous CTP of AppFabric installed that may have had this sample too. If so, did you uninstall the older version before installing the latest CTP?
The error seems like it is not finding the proxy class when it loads up.
I will try the ContosoPizza sample next.
Thanks,
If this answers your question, please use the "Answer" button to say so | Ben Cline -
vendredi 9 septembre 2011 17:59I always uninstall the previous versions.
-
vendredi 9 septembre 2011 20:54Modérateur
I think "Import1" is probably a key in a file of all service references and I am guessing it no longer refers to the right key. This could be a bug. Based on the stack trace try opening WebApplication11\ServiceReferences.g.cs and see if you can find "Import1" there. You might try manuall deleting this file too although back it up - I do not know if it is required or not.
Maybe the generated code is out of synch internally.
Thanks,
If this answers your question, please use the "Answer" button to say so | Ben Cline -
lundi 12 septembre 2011 09:29
Still no joy I'm afraid Ben.
My colleague tried the same sample on a different machine and he got exactly the same problem.
-
mercredi 21 septembre 2011 02:45Modérateur
I finally got some more time to work on this. If you expand App.cs and then open up App.designer.cs and search for "import" then you can find the code where it defines the service reference. It is annoying how there is not a standard service reference like with WCF which would be a much easier way of doing this. But it is interesting to build a service reference dynamically.
Here is the code around my Import1 in App.designer.cs:
Microsoft.ApplicationServer.ApplicationModel.Definitions.ServiceImportDefinition serviceimportdefinition1 = new Microsoft.ApplicationServer.ApplicationModel.Definitions.ServiceImportDefinition(); serviceimportdefinition1.Name = "Import1"; serviceimportdefinition1.TargetExportName = "AppFabricApplication1.AppFabricContainer1.StatelessContract1.Service1"; webapplicationservicedefinition1.Imports.Add(serviceimportdefinition1); webapplicationservicedefinition1.Name = "WebApplication1"; webservicegroupdefinition1.ServiceDefinitions.Add(webapplicationservicedefinition1); webservicegroupdefinition1.TraceSourceLevels = System.Diagnostics.SourceLevels.Warning; webservicegroupdefinition1.VirtualDirectory = "Web1";
Maybe check to see if yours matches something like this. I did try searching for "serviceProvider" in my App.designer.cs but did not see this.
Thanks,
If this answers your question, please use the "Answer" button to say so | Ben Cline -
mercredi 21 septembre 2011 02:54Modérateur
Another thing I tried which was interesting, was if you go to WebApplication1 and then find the ServiceReferences.g.cs file (it is not hidden) and then open it up and then go to the IService interface in the code, right-click and then choose to go to definition, it will show you the service interface based off the compiled metadata. I am guessing in your case it will not be able to find the interface definition.
Basically the import name in ServiceReferences.g.cs has to match up with the values defined in App.designer.cs. You might also try changing the Import name in ServiceReferences.g.cs to what you find in App.designer.cs.
Thanks,
If this answers your question, please use the "Answer" button to say so | Ben Cline

