I am facing issue while packaging static content as part of NuGet.
I want to package Javascript files only as part of the NuGet package. Included the following entry inside the NuSpec file as shown below...
file src="*.js" target="Content\JS"
Included the csprok and corresponding NuSpec file inside the .Proj file.
Now when i try to run the following command (msbuild packaging.proj) it gives out the error saying
error : Failed to build package. Ensure '...NuSpec' includes source and symbol files
Not sure if i am missing something here...
Any help is appreciated.
Thanks
Finally figured out that we can use "NuGet Package Explorer" to create a NuGet package. This way we can add the static content only and it doesn't thrown any issues i was facing earlier.
Related
First time poster, so please let me know if I forgot anything.
I've got a dotnet project I've been working on using WinUI3 in Visual Studio 2022. More or less it grabs some reports from Azure using Microsoft Graph.
When trying to package the application, for use on a different machine, I get the following error:
error NETSDK1152: Found multiple publish output files with the same
relative path:
C:\Users\McTwitch\source\repos\Heimdall\obj\x64\Release\net6.0-windows10.0.19041.0\win10-x64\MsixContent\Microsoft.Web.WebView2.Core.dll,
obj\x64\Release\net6.0-windows10.0.19041.0\win10-x64\R2R\Microsoft.Web.WebView2.Core.dll.
I've added
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
to my .csproj file, and that gives me a different error:
Severity Code Description Project Path File Line Source Suppression State
Error APPX1101 Payload contains two or more files with the same destination path 'Microsoft.Web.WebView2.Core.dll'. Source files:
C:\Users\McTwitch\source\repos\Heimdall\obj\x64\Release\net6.0-windows10.0.19041.0\win10-x64\MsixContent\Microsoft.Web.WebView2.Core.dll
C:\Users\McTwitch\source\repos\Heimdall\obj\x64\Release\net6.0-windows10.0.19041.0\win10-x64\R2R\Microsoft.Web.WebView2.Core.dll SIEMGUI C:\Users\McTwitch\.nuget\packages\microsoft.windowsappsdk\1.2.221109.1\buildTransitive C:\Users\McTwitch\.nuget\packages\microsoft.windowsappsdk\1.2.221109.1\buildTransitive\Microsoft.Build.Msix.Packaging.targets 1504 Build
I've also checked Tools>NuGet Package Manager > Manage NuGet Packages for this Solution, but there aren't any entries under "Consolidate".
There was one post (Publish error: Found multiple publish output files with the same relative path) that mentioned adding some lines to the common.props file, but I haven't been able to locate the file, which is a tad frustrating.
Any and all help is appreciated, and I'll try to reply as quickly as I can to any additional questions or requests for information.
I have a .NET Framework class library project that I'm turning into a nuget package and uploading to my own nuget server.
This is how the project looks:
Really simple, just a single .cs file with a few classes.
I'm compiling the code with Debug configuration and Any CPU platform.
Produced files are the following: Synteco.ScriptInterpreter.dll and a .pdb file with the same name
In the directory of my .csproj file I also have a .nuspec file, which looks like this:
I'm only copying the Synteco-Icon.png file in the images folder in the final .nupkg in order to set the icon for my nuget package.
Upon running nuget pack I'm getting the following output
As we can see, everything seems to be in order.
However, if we look into the produced .nupkg file, its contents are:
Somehow the folder content has been created. In the past this folder was not created at all.
I am able to push this nuget package to my server, but when I download it via Nuget Package Manager in other projects, everything from the content folder is being copied into the project that is trying to use that nuget package. For larger packages this becomes a real issue and unwanted files are being copied to projects.
What is the issue and how can I stop the content folder from being created?
I've tried running nuget pack [NAME_OF_MY_NUSPEC_FILE] but that would produce something even more strange. Take a look:
Am I doing something wrong?
P.S.
As far as I'm concerned, this is how a proper nuget package should look like. This is Newtonsoft.Json:
Problem was solved!
Silly me, I actually had some files with build action set to Content in my C# project for my nuget packages!
Upon removing all items with that build action the content folder is gone!
I have a problem with Xamarin in Visual Studio.
I am working with Xamarin.Forms and Xamarin.Android. My problem is that that android component of the project do not install themselves. The zip folder is empty and the component folders are empty.
Solutions I tried:
Delete the the ./AppData/Local/Xamarin (in windows) folder which is supposed to force the IDE to download the appropriate packages (does not work)
Downloaded the m2repository_r29, put it in zip folders and give it his hash name (does not work)
Install manually each library : download, unzip and put in right folder (works, but is super long for each library from this source https://learn.microsoft.com/en-us/xamarin/android/troubleshooting/resolving-library-installation-errors#Manually_Downloading_m2repository)
This is a sample of the error message I get:
Severity Code Description Project File Line Suppression State
Error An error occurred trying to install required android components on Project 'Project.AndroidClient'.
Project 'Project.AndroidClient' requires the following components installed on your machine:
Xamarin.Android.Support.Animated.Vector.Drawable
JavaLibraryReference: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/animated-vector-drawable/23.3.0/animated-vector-drawable-23.3.0.aar-23.3.0.0
AndroidResources: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/animated-vector-drawable/23.3.0/animated-vector-drawable-23.3.0.aar-23.3.0.0
...
Please double-click here to install it.
Intallation Errors: XA5209 Unzipping failed. Please download 'https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip:m2repository/com/android/support/animated-vector-drawable/23.3.0/animated-vector-drawable-23.3.0.aar' and extract it to the 'C:\Users\...\AppData\Local\Xamarin\Xamarin.Android.Support.Animated.Vector.Drawable\23.3.0.0\embedded' directory
XA5209 Reason: ...
Please help, I am new to all this and I don't know what to do.
Use nugets instead, xamarin is migrating fully from components to nugets on May, 5th
I created a new project by selecting the default theme as Appcompat.Light, then when I run the app, I'm getting this error:
"Error XA5209: Unzipping failed. Please download dl-ssl.google.com/android/… and extract it to the /Users/username/.local/share/Xamarin/Xamarin.Android.Support.Vector.Drawable/23.3.0.0/content directory. (XA5209)."
I haven't done anything else other than create a new project, Why am i getting this error?
The process of downloading the Android.Support.V7 or other nuget could take some time.
If in the middle of the process for some reason you quit the Xamarin Studio/Visual Studio or your internet goes down the packages being download as .zip will be corrupt.
After you try to open it again you will see that message "Error XA5209: Unzipping failed. Please download dl-ssl.google.com/android/… and extract it to the /Users/username/.local/share/Xamarin/Xamarin.Android.Support.Vector.Drawable/23.3.0.0/content directory. (XA5209)."
The solution that I follow most of the times this happens is to delete the root folder of the package where the error come from (/Users/username/.local/share/Xamarin.Android.Support.Vector.Drawable) and all the .zips inside the folder /Users/username/.local/share/zips.
Click here for more Resolving Library Installation Errors
The accepted answer did not work for me, so here is what I did to make it work. Basically the solution recommended here: https://learn.microsoft.com/en-us/xamarin/android/troubleshooting/resolving-library-installation-errors.
I am developing on Windows 10, with Visual Studio 2017 Community. The Packages are located in ..user/AppData/Local/Xamarin/....
I got errors for every package I needed, meaning Xamarin.Android.Support.Animated.Vector.Drawable, Xamarin.Android.Support.v4, Xamarin.Android.Support.Vector.Drawable and about 4 more... So I did the following (solution applies to every package), I illustrate it here for the Xamarin.Android.Support.v4 and version 23.3.0.0:
Create the 23.3.0.0 directory in Xamarin.Android.Support.v4
Create the directories embedded and content (embedded is very important)
Extract the zip (m2repository) in the content folder
From the m2repository, copy the contents of Xamarin.Android.Support.v4\23.3.0.0\content\m2repository\com\android\support\support-v4\23.3.0 to the Xamarin.Android.Support.v4\23.3.0.0\embedded directory, rename the file ending in .aar (in my case support-v4-23.3.0.aar) to support-v4-23.3.0.aar.zip, then extracting all the contents in the same folder (embedded). Note that this is package dependent, meaning for Xamarin.Android.Support.Design you will have to copy the contents of the \content\m2repository\com\android\support\design\23.3.0 folder.
Now repeat step 1 through 4 for every package that causes VisualStudio to throw an error.
I'm trying the Xamarin.Forms.
I created a Solution named "App2". The Visual Studio automatically created the following projects:
App2 (Portable)
App2.Droid
App2.iOS
When I try to compile the Android Project (App2.Droid), I get the following errors:
Download failed. Please download
https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
and put it to the
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3
directory. App2.Droid Reason: One or more errors. App2.Droid
Please install package: 'Xamarin.Android.Support.Design' available in
SDK installer. Java library file
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3\embedded\classes.jar
doesn't exist. App2.Droid Download failed. Please download
https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
and put it to the
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3
directory. App2.Droid Reason: One or more errors. App2.Droid
Please install package: 'Xamarin.Android.Support.Design' available in
SDK installer. Android resource directory
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3\embedded./
doesn't exist. App2.Droid
I've already tried to:
Download the android_m2repository_r22.zip file and put it on the C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 folder
Download the file and extract it to the folder
Delete the C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 folder and recompile project
Delete the C:\Users\pedro.costa\AppData\Local\Xamarin\zips folder and recompile the project.
Update the Xamarin.Android.Support.* nuget packages, but when I try it, I also get those build errors.
I've done a lot of research and it seems that the Android.Support.* folders should have files inside it, and that those files should be downloaded when the android solution is built, but it is not happening for me.
Try this work around :
Navigate to C:\Users\[user-name]\AppData\Local\Xamarin\zips folder.
Remove all zip files.
Remove /bin and /objfrom your project.
Clean and build your project.
It may take a while to build and debug project.
1.download
https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip
2.rename to 2A3A8A6D6826EF6CC653030E7D695C41.zip
3.copy to C:\Users\User\AppData\Local\Xamarin\zip
4.rebuild
I saw in other answers to this problem, that by just deleting all the content from the Android.Support.Design folder, Visual Studio would download it again once the project was rebuild.
The problem in my case, was a proxy issue. When I set my environment to access the internet without the proxy, Visual Studio download the necessary files and folders on the rebuild.
Don't extract the zip to \23.0.1.3folder or just put it there, that won't work don't mind the error message.
You must put the zip in the \zip folder, after you delete the already existing zip, you may need to rename the zip you downloaded to something like: 2A3A8A6D6826EF6CC653030E7D695C41.zip
But if you don't want to manually download the support repository you can just delete everything in the %USER%\AppData\Local\Xamarin\ folder and rebuild and wait.
there is a zips name folder over this address C:\Users\[user-name]\AppData\Local\Xamarin\zips
first u have to check it the file is in extract condition there we can see an error it is an currupt format then u can replace those two files
1)2A3A8A6D6826EF6CC653030E7D695C41.zip replace by this link rename with 2A3A8A6D6826EF6CC653030E7D695C41
2)96659D653BDE0FAEDB818170891F2BB0.zip replace by this link rename with 96659D653BDE0FAEDB818170891F2BB0
then rebuild the project