New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building solution with /t:Package does not include all files for services #908
Comments
I've also tried running it as one step but that doesn't work since the apps projects don't have "Package" targets, but maybe there's a way around that.. it feels like this should work though |
This the packaging issue? NuGet/Home#4853 |
hmm interesting, I remember seeing this a while back actually I just didn't connect the dots :) i'll try and see if I can apply the workaround |
I've been reading though that other issue and I wonder if their solution is applicable to this problem because afaik, the service fabric package target is not using nuget to package(right?), also, we're not using the new .csproj here just the old one, although we're still using msbuild 15(.1.1012.6693) Also, my problem is that the project refernces are not included, the framework (and service fabric) assemblies are included |
if anyone is interested i worked around my issue (building multiple apps with common project references in parallel) by building each sfproj file but also specifying the output and intermediate paths and setting different ones for each app. that avoids the read/write conflicts that would happen otherwise. its still kind of sub optimal because all projects are always built, and the project references are built once for every app, so you need a fast harddrive :) It seems like it should work with msbuild too though, would still love to get a comment from the team. |
Any thoughts on this one? |
@aL3891, Can you please provide the cmd that you use to build multiple *sfproj? Are you saying the common projects are built once for each *sfproj, instead of skipping the build. |
we just do This could be avoided if we could do |
As you figured out, the package target exist only on sfproj, so msbuild on solution file is not possible. |
Well, solutions doenst have targets, its perfectly possible to invoke the package target on a solution, as long as the solution configuration only specifies sfprojects. however as i've detailed in this issue, doing that causes the package target to skip a number of files when copying the service build output over. That is why i've raised this issue, to enable packaging the whole solution at once. |
Got it. We will look into enabling package from solution. |
We currently have this on our tooling backlog, but I don't have a timeframe for investigating at the moment as it appears nothing is blocked. Will admit that this seems broken that references are not packaged correctly when packaged from the solution level |
I've actually I've taken things into my own hand over at https://github.com/aL3891/ServiceFabricSdkContrib with my own packaging targets that run during build :) feel free to check them out! |
I'm seeing a similar issue when packaging for sf deploy. We have mixed framework standard projects. I have converted problem .sfproj to by reference projects and it appears to build ok. I am seeing framework overrides when I use standard packages, notably System.Net.Http Now I package to SF deployment using MSBUILD /t:Package. This copies most assemblies from the the bin directory EXCEPT framework assemblies. What it does is copy the System.Net.Http at 4.0.0.0 from the framework directory! So now I have a Code directory with a System.Net.Http at version 4.0.0.0 but a binding redirect telling it to load 4.2.0.0. Since 4.2.0.0 doesn't exist, I get a loading exception. Does anyone else see this? Is there any way to make MSBUILD just copy the bin dir rather than using framework assemblies? The package operation also fails to copy netstandard.dll so I guess this is a general issue rather than a framework specific issue. Any clues? I'm using VisualStudio 15.5.7 |
Ok I got some more observations and a potential solution tho its not nice. I have created a post package target that copies all binaries into the pkg\Code directory basically overriding what MSBUILD /t:Package has done. This has worked for me locally deploying to SF dev node and I'll be trying shortly on an actual azure instance. For those of you interested the targets file is attached below. One warning though, it does increase SF package size by quite a bit and consequently impacts deploy times. ServiceFabricPackageHelper.zip To add to your sfproj here you just do an import like this: |
Can you please try it by setting the <PackageOutputFolder>true</PackageOutputFolder> to *.sfproj to change the package behavior to include all the files from output folder? This new feature is available in the latest 1.6.5 nuget package. |
Hi Ravipal. Much appreciated that flag seems to work a treat. Wish I had known about this yesterday!! Personally as we all move towards a 'standard/core' world I would have thought this should be the default. Many thanks though I will be updating our builds to use this flag. |
Were still having issues with build time and runtime resolution of the build extension assemblies. Examples of this are where a dependent build is up referenced to 4.2.0.0 of System.Net.Http but appears to pass a forward reference of 4.0.0.0 to dependent assemblies which then error as that conflicts with their 4.2.0.0! Some of our IIS services are failing to demand load 4.0.0.0 even though we have a binding redirect downgrade in the Web.config. The only reliable way we have found to work around this is to copy the build extension assemblies to a 'known' location and directly reference them. Using this approach all builds include the assembly in the build output and resulting packages. All builds reference the extension assembly hence there is no conflict at build or runtime. Since the assembly is no longer tagged as 'framework' it appears in the bin directory. This essentially bypasses the build time resolution which seems to be essentially broken in this respect. Any comments on the validity of this approach? |
Is there a current comprehensive list of steps, versions, whatever else is required to get this to work? I have this working when I package and publish from my local - without adding a nuget reference to NetStandard.Library, I just added the System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. |
Hello, i'm trying to build a solution containing multiple sf apps and various services using msbuild. first of I build all the services like so
Then I run the package target on only the sf apps:
When this is done there are no errors and the pkg folders are created correctly, however a lot of dlls are missing from the package folder, all the service fabric dlls are included but any other dlls that the service references are not.
if I run the package target directly on the sfproj file, not the solution, everything works, but i'd like to run it on the solution because its a lot faster. is that not supported or am I missing something else?
The text was updated successfully, but these errors were encountered: