Appinstaller package full name does not match - appx

I have created and msix package and an appinstaller for my application so I can have it auto update.
When I run the appinstaller (with Add-AppxPackage -Appinstaller) I get the message:
Add-AppxPackage : Deployment failed with HRESULT: 0x8008020C, The .appinstaller file is invalid. The .appinstaller file is invalid. The package full name returned from the AppxManifest (95c00d63-12ab-4d97-b385-0a13d8e0ab2a_0.6.8.0_neutral__dvqeabx3zpwwy) does not match the name generated from the AppInstaller (95c00d63-12ab-4d97-b385-0a13d8e0ab2a_0.6.8.0_neutral_~_dvqeabx3zpwwy). Please ensure that the package attributes specified in the .appinstaller file match the package attributes referenced in https://application-downloads.azurewebsites.net/staging/WriteInStoneInstaller_0.6.8.0_AnyCPU_Staging.msix.
The only difference I can see is the tilde between the two underscores. While searching for this online I saw people with package full name containing tilde and without. What is this symbol doing there? What does it denote? How can I specify/change/remove it? I just want the package to install without any errors.

Related

Could not load file or assembly 'Accord.Video.FFMPEG.dll' or one of its dependencies on Click Once Install

My application that has 'Accord.Video.FFMPEG.dll' and supporting DLL's works properly in the development environment. When I publish and try to Click Once install I receive the following message:
Could not load file or assembly 'Accord.Video.FFMPEG.dll' or one of its dependencies. The specified module could not be found.
File name: 'Accord.Video.FFMPEG.dll'
As suggested in other posts, I copied the following DLL's into my Resources folder in my Visual Studio Project and specified to 'always copy to installation folder'. I see them in the Install Folder inside the folder C:\JPGManagerPublish\Application f
Files\JPGManager_3_0_0_179\Resources
avcodec-57.dll
avdevice-57.dll
avfilter-6.dll
avformat-6.dll
avformat-57.dll
avutil-55.dll
postproc-54.dll
swresample-2.dll
swscale-4.dll
These show up in the application install folder as
avcodec.57.dll.deploy, etc.
I install the application with Setup and I when I execute the function that utilizes Accord.Video.FFMPEG.dll I get the error message :
'Accord.Video.FFMPEG.dll' or one of its dependencies. The specified module could not be found.
File name: 'Accord.Video.FFMPEG.dll'
You can try to solve it with the following steps:
Use the latest package currently available in NuGet.
Make sure your application is running in 64-bit mode (check Environment.Is64BitProcess and Environment.Is64BitOperatingSystem), if so, download and install Accord.Video.FFMPEG.x64 from NuGet only (do not install Accord.Video. FFMPEG).
If you still face the problem, please check the value of Directory.GetCurrentDirectory() and make sure the dll of FFmpeg is contained in this folder.
Try adjusting your PATH variable to include the directory where these .dlls are located (usually in the Bin folder).
string oldPath = Environment.GetEnvironmentVariable("Path");
Environment.SetEnvironmentVariable("Path", pathToFFmpegDlls + ";" + oldPath);

ProGet symbols and source server: download pdb correctly but source not found

I have a problem reguarding the source files and symbols using ProGet and VS2017/VS2019.
My scenario is the following
Develop test assembly on my pc
Push mod files on our git server
Get mod files in our TeamCity (2019.1)
Build source in Release mode, pack and publish the AssemblyTest.symbols.nupkg on ProGet (5.2.3)
In VS2017 I've create a test console app, install the AssemblyTest via Package Reference and I've tried simply to press F12 on the class in my code to show the source code or step in in debug mode.
I've configure VS2017 as the guide suggests here
The nuget pack command was launched with -symbols command line parameter and the symbol.nupkg was created with the following stucture
package
service
metadata
...
lib
net472
TestAssembly.dll
TestAssembly.pdb
TestAssembly.xml
src
Properties
AssemblyInfo.cs
TestClass.cs
Pressing F12 on TestClass in my code the pdb was correctly downloaded in
c:\users\me\appdata\local\temp\symbolcache\testassembly.pdb\bf5be5cd155e4400b9b18c0e1e6a05941\testassembly.pdb
and selecting ReSharper item form the drop down list on the output window in Visual Studio I see
PdbNavigator: Downloader: http://srv.symbolsource.org/pdb/Public/testassembly.pdb/bf5be5cd155e4400b9b18c0e1e6a05941/testassembly.pdb -> The remote server returned an error: (500) Internal Server Error.
--OK, it's MS symbol server
PdbNavigator: Downloader: http://myproget/symbols/dev/testassembly.pdb/bf5be5cd155e4400b9b18c0e1e6a05941/testassembly.pdb -> ok, 15.5 KB
-- OK, it's our ProGet server
PdbNavigator: Searching for 'TestAssembly.TestClass' type sources in C:\Users\me\AppData\Local\Temp\SymbolCache\TestAssembly.pdb\bf5be5cd155e4400b9b18c0e1e6a05941\TestAssembly.pdb
PdbNavigator: Downloader: http://myproget/source-files/dev/TestAssembly/1.0.0.10/TestClass.cs -> The remote server returned an error: (404) Not Found.
-- Here we come :(
PdbNavigator: No sources found in debugging information for 'TestAssembly.TestClass' in assembly 'TestAssembly, Version=1.0.0.10, Culture=neutral, PublicKeyToken=null'
In my symbolcache folder there is a subfolder with this path
C:\Users\me\AppData\Local\Temp\SymbolCache\src\source-files\dev\TestAssembly\1.0.0.10
but there's no source file instead.
Taking a look inside the pdb file and I've found
SRCSRV: ini ------------------------------------------------
VERSION=2
INDEXVERSION=2
VERCTRL=http
SRCSRV: variables ------------------------------------------
SRCSRVVERCTRL=http
PGSERVER=http://myproget/source-files
PGFEED=dev
PGPKGID=TestAssembly
PGPKGVER=1.0.0.10
HTTP_EXTRACT_TARGET=%pgserver%/%pgfeed%/%pgpkgid%/%pgpkgver%/%var2%
SRCSRVTRG=%http_extract_target%
SRCSRVCMD=
SRCSRV: source files ---------------------------------------
c:\buildagent\work\b5cfc05c815c43d9\testassembly\testclass.cs*TestClass.cs
SRCSRV: end ------------------------------------------------
So, my question is: how can I download correctly the source file from ProGet?
What's wrong in my scenario?
Thank you!
Fabrizio
From ProGet's perspective, a 404 is returned by the /source-files/* endpoint in any of the following cases:
the feed name (i.e. dev in your example) is not found
the feed is not a NuGet feed
the symbol server is not enabled for the feed
the package version is missing from the /source-files URL
the package version is not a valid NuGet version (1.0.0.10 looks OK)
the file itself (i.e. TestClass.cs in your example) is not found under the /src folder within the package
That being said, can you verify in the feed itself that those source files are present using the Files tab for version 1.0.0.10 of this package? I know if the normal, non-symbols package is pushed after the symbols one, it can overwrite it which effectively removes those files.

"The target 'AddScheduledJob' does not exist in the project" when publishing to Azure from Visual Studio

My solution consists of a main web app, with several azure web jobs attached to it. When I go to publish the main web app, I receive this error:
[project_path]\[project_name].csproj(0,0): Error MSB4057: The target "AddScheduledJob" does not exist in the project.
I'm not sure where AddScheduledJob is coming from. It is not the name of any project in the solution.
I think I have tracked down the file that is "attempting" to reference this phantom project:
[solution_path]\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets
This file contains this snippet of text:
<Target Name="AddScheduledJob"
DependsOnTargets="$(AddScheduledJobDependsOn)"
AfterTargets="MSDeployPublish"
Condition="'$(FilePreview)' == 'false' and ('$(WebJobPublishFromWAP)' == 'true' or '$(_DestinationType)' == 'AzureWebSite')">
<CreateScheduledWebJob JobConfig="#(JobConfig)"
WebSiteName="$(WebSiteName)"
WebSiteUrl="$(WebSiteUrl)"
ManagementUri="$(WebJobManagementUri)"
ManagementCertificatePath="$(ManagementCertificatePath)"
ManagementCertificatePassword="$(ManagementCertificatePassword)"
ManagementCertificate="$(ManagementCertificate)"
ManagementToken="$(ManagementToken)"
PublishSettingsPath="$(PublishSettingsPath)"
SubscriptionId="$(SubscriptionId)"
Condition="'%(RunMode)' == 'Scheduled'"/>
I have no idea where this is coming from, or why it is causing a problem. I am tempted to just remove that snippet, but at the top of the file, I read this snippet:
WARNING: DO NOT MODIFY this file, this file is added to your project automatically...
Can I safely remove this snippet from the "webjobs.console.targets" file? Or, is there something else that might be going on?
UPDATE
I discovered that even with this error, my web app is successfully getting published. Here is a more in-depth view of the logs at the end of the publish process:
Adding ACLs for path (ringclone-test/App_Data)
Publish Succeeded.
C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(25,3): Warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" cannot be imported again. It was already imported at "C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.12\tools\webjobs.console.targets (25,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\APD\RingClone\TicketProcessor\TicketProcessor.csproj]
C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(25,3): Warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" cannot be imported again. It was already imported at "C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.12\tools\webjobs.console.targets (25,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\APD\RingClone\TicketDistributor\TicketDistributor.csproj]
C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(25,3): Warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" cannot be imported again. It was already imported at "C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.12\tools\webjobs.console.targets (25,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\APD\RingClone\ArchiveIndexer\ArchiveIndexer.csproj]
C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(25,3): Warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" cannot be imported again. It was already imported at "C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.1.0\tools\webjobs.console.targets (24,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\APD\RingClone\Starter\Starter.csproj]
C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(25,3): Warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" cannot be imported again. It was already imported at "C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.1.0\tools\webjobs.console.targets (24,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\APD\RingClone\NrtTrigger\NrtTrigger.csproj]
C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(25,3): Warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" cannot be imported again. It was already imported at "C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.12\tools\webjobs.console.targets (25,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\APD\RingClone\DownloadProcessor\DownloadProcessor.csproj]
C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(25,3): Warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" cannot be imported again. It was already imported at "C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.1.0\tools\webjobs.console.targets (24,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\APD\RingClone\DatabaseReIndexer\DatabaseReIndexer.csproj]
C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(110,5): Error : An error occurred while creating the WebJob schedule: Webjob configuration is missing metadata for StartTime
C:\APD\RingClone\DailyMaintenance\DailyMaintenance.csproj(0,0): Error MSB4057: The target "AddScheduledJob" does not exist in the project.
C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.console.targets(25,3): Warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" cannot be imported again. It was already imported at "C:\APD\RingClone\packages\Microsoft.Web.WebJobs.Publish.1.0.12\tools\webjobs.console.targets (25,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\APD\RingClone\ScheduledTrigger\ScheduledTrigger.csproj]
As you can see, it says "publish succeeded", then complains about the "StartTime" for one of the jobs. And then complains about the "AddScheduledJob". I'm not concerned about the "StartTime" issue. I can get that fixed. But the error about the project called "AddScheduledJob" is baffling. Even though the publish seems to happen, I don't want this error cluttering up the log. What is causing this error?
That's an ancient NuGet package. In older versions, Visual Studio would allow you to configure the schedule of a webjob if you configured it to run on a schedule instead of continuously. You can remove that target and configure the schedule using the following guidance: https://learn.microsoft.com/en-us/azure/app-service/web-sites-create-web-jobs#CreateScheduledCRON . If you're using an older version of Visual Studio, please upgrade so that you have the latest WebJob project template.
First, you have to add the Microsoft.Web.WebJobs.Publish package from Nuget. Even though VS has the publish to Web Job action, it doesn’t automatically add that package to your project. You could refer to this blog.
Once you add it, you’re still screwed. VS doesn’t automatically modify your .csproj file to use this package.
To do so, you need manually hack your .csproj file. Easiest way is to unload it in VS and add the following line right after the CSharp targets – I’ve included it below for context:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Web.WebJobs.Publish.1.0.11\tools\webjobs.targets"
Condition="Exists('..\packages\Microsoft.Web.WebJobs.Publish.1.0.11\tools\webjobs.targets')" />
Here is a similar issue with you. When he add a new WebJob under asp.net site, retain the newer version of Microsoft.Web.WebJobs.Publish package.

creating nuget package adds project folder name to payload file path

I'm attempting to create a nuget package using Nuget Package Explorer. The project is just a collection of dlls and files I need copied to the output (bin) directory of the project in which it is used, which unless I'm mistaken is pretty much the way nuget packages work.
However, after creating the package the path to the files I want copied appears to be incorrect, even though I specified no such path in my package.
I created the package, added the libs added the two platforms I want to support (Win8.1 and WP8.1 RT) and added the files for each platform in their respective libs container.
When I install the package into my project it creates the package folder with the exact same structure. Everything looks good.
However, when I then build the project, instead of trying to add the contents of for example:
packages/MyPackage/libs/wpa81/MyProject.WindowsPhone.Data.xml
it's instead attempting to find this:
packages/MyPackage/libs/wpa81/MyProject.WindowsPhone/MyProject.WindowsPhone.Data.xml
and so I get an error like:
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1496,9):
error APPX0702: Payload file 'C:\Users\Me\Visual
Studio\AnotherProject\packages\MyPackage\lib\wpa81\MyProject.WindowsPhone\MyProject.WindowsPhone.Data.xml'
does not exist.
now, MyProject.WindowsPhone IS the name of the original project I used to create the content I want to include in the package, but I make no reference to this folder anywhere in the nuget package or manifest.
If I manually create that folder and move everything inside it works, but none of the other packages I use require me to do this. I want to simply reference the files that are there, where is it getting this folder name from?
does anyone have any idea what I'm doing wrong? please let me know what information I can add to help identify the problem...

NuGet package installed on the solution level instead of project level

I'm trying to customize an existing NuGet package to add some new behavior, specifically into a package called StyleCop.MsBuild
Downloaded the source of the package from bitbucket repo (https://bitbucket.org/adamralph/stylecop-msbuild/wiki/Home)
Changed id of package in *.nuspec file from StyleCop.MSBuild to MyCustomPackage
Created *.nupkg file using NuGet Package Explorer
Uploaded *.nupkg file to my local NuGet server
So the only change was the id of the original package.
But now when I try to install MyCustomPackage into a project, it is installed on the solution level and not on the project level. Visual Studio creates a folder called '.nuget' in the root of the solution and places the packages.config file in there.
Not sure what causes this change since all I did was to change the package id.
Any help appreciated.
The StyleCop.MsBuild package has an msbuild target in the build folder and the convention is that the name should match the package id. So by changing the package id, the msbuild target file was not referenced anymore and the package became a solution level one.
https://docs.nuget.org/create/creating-and-publishing-a-package#import-msbuild-targets-and-props-files-into-project

Resources