Azure package not including linked project DLL even with copy local set
Asked Answered
O

2

17

I've an Azure solution with 4 projects in it. (VS 2012 on Windows 8, Azure Tools 1.8)

  1. Core project with common code
  2. Web Role Front End
  3. Service Role for servicing data (from SQL Azure DB)
  4. Worker Role for scheduled tasks

All role projects have a reference to the core project with copy local = true... standard stuff.

The web role and the worker role work fine, but my service role keeps getting stuck in the Initializing - Starting - Recycling loop. When I browse to the service I get the Could note load file or assembly FileNotFoundException. Sure enough, RDP to the server and the DLL is missing.

Having a look in the package files locally, the other roles include the missing DLL, but not the service role.

If I use VS to publish the service role (not azure publish) to local file system, the core DLL is included, proving that the VS settings are correct for the copy local.

Is there any other way from within VS to influence the files that are added to the Azure deployment package, or is there a simple way to script the creation of the package without using VS?

Oscillogram answered 4/2, 2013 at 1:5 Comment(4)
Could be a GAC issue. Might review this post: #8257038Outherod
Thanks @Jay, but this is a Project Reference (So private tag doesn't apply, instead I have set Copy Local to true in the designer) and my referenced project is not signed or in the GAC. The most confusing bit it that it works for the Web and Worker Roles in the same solution, just not this one service roleOscillogram
what is this "Service Role" ? is it the "WCF Service Role" from the templates?Athanasius
The same issue with my latest solution, created couple of days beforeIsahella
I
18

As I wrote in comment I have same situation as you (Windows 7 and 8, VS 2012, Azure SDK 1.8). Copy Local is set to true but when I open *.cspkg package, referenced assemblies are missing in approot folder. What I did I created new Worker Role project and copied the code from old one. Now are all assemblies included.

UPDATE: The solution described above was not really necessary in my case. The real problem by me was that my Web Role accidentally referenced my Worker Role assembly. When I removed this unnecessary reference, the Worker Role got the all assemblies in package. This behaviour is, on my opinion, buggy.

Isahella answered 7/2, 2013 at 10:40 Comment(4)
Just had to deal with this myself - it's weird behaviour, but I can't see any situation where you'd want to reference your worker role DLL in a web role, without using a shared library.Embosser
Keith you are right! But something like warning would be nice when this happens accidentallyIsahella
@KeithWilliams - True, but two wrongs don't make a right. ;)Optimistic
It was a bit simpler for me -- Copy Local was set to true, but I had to set it to False and back to True again for it to be saved in the .csproj file (as <Private>True</Private>)Parfleche
C
2

I can confirm what Anton describes in his answer in the paragraph starting with "UPDATE":

I had a class library project called "Utils", a "WorkerRole" and a "WebRole" project. Both WorkerRole and WebRole were referencing Utils. In addition, WebRole was referencing WorkerRole - as latter one contained some classes which were used as Service Bus messages.

The result was that Utils.dll was not included in the .cspkg file for the cloud service, and there was no error message in Visual Studio. After putting the message classes in project Utils and removing the reference WebRole->WorkerRole everything was fine again.

Seems to be a bug indeed.

Cand answered 14/9, 2013 at 22:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.