UWP app WACK test fails & outputs debug irrespective of chosen settings - c#

I am trying to create a package of my UWP app and put it through a WACK test.
Windows App Certification Kit - Test Results is FAIL. I think it's because VS2015 is outputting a debug build irrespective of the settings i've chosen.
Has anyone come across this problem before?
Is visual studio ignoring my settings, or does my project include a library that's not going to pass WACK?
'Release' is selected both in the build menu and in Output Package dialogue.
JSON.net and EF7 only, both are UWP compatiable. Tasks and DataAccess are a background task and a class library.
File C:\Program Files\WindowsApps\f0679d56-bdc0-4305-837e-16b5560c7c41_1.0.14.0_x86__ade4xr40r36he\coreclr.dll has failed the AppContainerCheck check.
File C:\Program Files\WindowsApps\f0679d56-bdc0-4305-837e-16b5560c7c41_1.0.14.0_x86__ade4xr40r36he\dbgshim.dll has failed the AppContainerCheck check.
File C:\Program Files\WindowsApps\f0679d56-bdc0-4305-837e-16b5560c7c41_1.0.14.0_x86__ade4xr40r36he\mscordaccore.dll has failed the AppContainerCheck check.
File C:\Program Files\WindowsApps\f0679d56-bdc0-4305-837e-16b5560c7c41_1.0.14.0_x86__ade4xr40r36he\mscordbi.dll has failed the AppContainerCheck check.

i also have the same issue and it is caused due to EntityFreamework.Commands reference. When you building the code for store package or release mode just remove all references of EntityFramework.commands by uninstalling from nuget.
that should help to get rid of those errors. for more information please go here. let me know how it went.. all the best.

I am now using VS2015 preview 2 and everything is building with it just fine. I get no errors in the WACK.
Microsoft just decided to release .net native a year before it could actually compile things properly.

Related

Errors when trying to publish .Net Maui project after previous success

I have been working on a .Net Maui app to replace a Python app I built for my company's payroll team. Several previous iterations of this app have allowed me to publish via sideloading. However, I have been unable to publish a new version for a couple of days now.
If I try to publish via sideloading, I get the following error:
MSB4057 The target "_GenerateAppxPackage" does not exist in the
project.
--this error claims to be stemming from line 1 of my .csproj file.
I attempted another route to publish it as an executable file following the answer provided in this stack overflow answer, and received the following error:
C:\User\MyFirstName : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
As well as another error that says looking for the manifest existed with a code 31.
Further up, before that error hits, there is a line that says:
Skipping target "MauiGeneratePackageAppxManifest" because all output
files are up-to-date with respect to input files.
I am running VS 17.4.0 Preview 3.0 on Windows 11. I have tried to roll back my code through git (up to 3 versions back), as well as copying local files into a new project, and I get these same errors every time.
It may also be worth mentioning that my Windows Defender and Windows Malicious Software Removal Tool both updated between when I was last able to publish successfully and when the problem arose. I had also updated Visual Studio, but tried to roll that back and publish, and it received the same errors.
Is there anyone who can help me figure out what is going on here, or point me in the right direction? I can provide code samples if need be, though on a limited basis because this is a private project.
For this, you can refer to document : Publish a .NET MAUI app for Android/IOS/Windows.
Above documents explain the steps to publish android, ios and windows app, respectively.
You can follow the steps step by step. Under normal circumstances, there will be no problem.

how do I get the Omnisharp extension to work in Visual Studio Code

In Visual Studio Code I tried to install the Omnisharp extension so that I can get formatting (among other things).
this is the c# log: Installing C# dependencies...
Platform: win32, x86_64
Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' Retrying from 'https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.32.8.zip' Failed at stage: downloadAndInstallPackages
Error: connect ETIMEDOUT 93.184.215.201:443
You can also tell the extension didn't install by the Omnisharp log error:
Starting OmniSharp server at 1/9/2019, 4:17:59 PM
Target: c:\Users[myUserId]\source\project-folder
OmniSharp server started.
Path: C:\Users[myUserId].vscode\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.32.8\OmniSharp.exe
PID: 15188
The system cannot find the path specified.
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).
It seems like the version 1.32.8 is not available, but https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.30.1.zip is.
I downloaded the package, extracted filed, and tried to placed the folder where it's expected: C:\Users[myUserId].vscode\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.30.1\OmniSharp.exe -- but windows doesn't allow folder names starting with a dot in this location. I thought I had figured out a solution and I didn't.
I had the problem previously. So did setup proxy and other at settings.json.
But now in new VS Code, i was getting same problem weirdly.
Finaly when i emptied out the settings.json file (deleted all the settings) VS code is working.
It automatically downloads C# and other extentions.
So, give it a try, if you had some settings put there for previous versions of VS Code, you got to remove(comment) them to check if thats cuasing problems.
[You dont have proxy, but if someone have, 'yes of course proxy needed to setup for .npmrc and enviroment variables at cmd as internet is necessary to download files]
This article has a section at the end about installing downloaded extension as vsix files. It also mentions the error you described and about how it could be proxy related. It is a somewhat long article... but I hope this helps.
https://code.visualstudio.com/docs/editor/extension-gallery
"Can I download an extension directly from the Marketplace?
Some users prefer to download an extension once from the Marketplace and then install it multiple times from a local share. This is useful when there are connectivity concerns or if your development team wants to use a fixed set of extensions.
To download an extension, navigate to the details page for the specific extension within the Marketplace. On that page, there is a Download Extension link in the Resources section which is located on the right hand side of the page.
Once downloaded, you can then install the extension via the Install from VSIX command in the Extensions view command drop-down."
What worked for me was this:
(press crtl + shift + P) then choose Preferences > Open settings
Comment these lines out if they are there:
// "http.proxySupport": "on",
// "http.proxyAuthorization": null,
After I did this, the extension was able to use the proxy settings, and the extension downloaded and worked!
The installation should be easier with VSCode 1.61 (Sept. 2021) because, as OmniSharp/omnisharp-vscode issue 4775 mentions:
VS Code now supports platform specific extensions.
This should be very useful for C# since currently you download platform binaries after activation.
As detailed in Publishing Extensions / Platform-specific extensions:
Extensions can publish different VSIXs for each platform (Windows, Linux, macOS) VS Code is running on.
This is useful if your extension has platform-specific libraries or dependencies, so you can control the exact binaries that are included in a platform package.
A common use case is the use of native node modules.
When installing a platform-specific extension, VS Code (starting from version 1.61.0) looks for the extension package that matches the current platform.
If no package has been published for the platform, the extension will appear as disabled and can not be installed.
Therefore, you need to publish a package for each and every platform that your extension supports. To meet this requirement, we are providing tooling to help make this potentially repetitive process easier.
This is followed by the 2018 microsoft/vscode issue 23251

Team Foundation Server Build Failed. Could not copy "xxx.dll" to "yyy.dll"

I'm having the following 2 errors when trying to build on the build server:
path\to.NETFramework\Microsoft.Common.targets (3390): Could not copy "path\to\xxx.dll" to "path\to\yyy.dll". Exceeded retry count of 10. Failed.
and
path\to.NETFramework\Microsoft.Common.targets (3390): Unable to copy file "path\to\xxx.dll" to "path\to\yyy.dll".
The process cannot access the file 'path\to\yyy.dll' because it is being used by another process.
Locally, it's easy to fix - closing Visual Studio and running it as admin solves the problem. However, when using the build server (Microsoft Server), I can't seem to fix the problem.
Already tried restarting the build agent.
Made sure my project was the only one building at the time.
Manually deleted the dll.
Run the agent with the /m:1 argument.
Thanks.
EDIT: I've managed to reproduce the error locally. If I change the configurations in the configuration manager and clean->rebuild the project, it gives me the same error. However, like I said before, restarting VS solves this error, I just don't know how to do it in the server.
If you are using XAML build you could try to solve this problem via a setting of disable the parallel build in the build server.For TFS2010 and TFS2012 setting MSBuild Multi-Proc on the Process tab to False, for TFS2013, TFS2015 type the /m:1 in MSBuild Arguments. For more information about the /m argument in MSBuild, please refer to this document: MSBuild Command-Line Reference
Switching to single process builds has increased the build time, but if it's an acceptable loss. You could use this as a workaround.
Finally managed to find the solution. Turns out it had nothing to do with TFS itself. I wasn't able to reproduce the error locally because, for some reason, it was compiling when it shouldn't.
My problem was "broken references".
I am using some Biztalk programs and 5 of them had a dependency to other project (custom Biztalk Pipeline Components), but not the reference to the project itself. I think this maybe was caused by opening the components toolbox, although I'm not sure of it.
So, I manually removed and added again the references (Add->Reference) to said projects and now everything works like a charm.

how to install GDAL into visual studio for c# on windows?

I'm gonna use GDAL into visual studio for c# on windows.
And followed some steps through some posts.
However, it seems it doesn't work between steps and, the biggest problem is that it can't build and install.
I will explain how to install, then if any of you knows and let me know why i can't install it, it will be so helpful.
to download:
Stable Releases, GDAL2.1.2 and MapServer 7.0.2, MSVC 2013/x64(mine:64), gdal-201-1800-x64-core.msi.
link: http://www.gisinternals.com/query.html?content=filelist&file=release-1800-x64-gdal-2-1-2-mapserver-7-0-2.zip
to set up paths:
System -> Advanced system settings -> System Properties -> Environment Variables =>
Edit System Variable: Path, C:\Program Files\GDAL\csharp
Add System Variable: GDAL, C:\Program Files\GDAL
(i also add two more: C:\Program Files\GDAL\gdalplugins, C:\Program Files\GDAL\gdal-data with names)
I downloaded a sample to test this environment setting.
(http://svn.osgeo.org/gdal/trunk/gdal/swig/csharp/apps/GDALInfo.cs)
(visual studio 2013)Add four of the dll-files(gdal_csharp.dll, gdalconst_csharp.dll, ogr_csharp.dll and osr_csharp.) to my project references from C:\Program Files\GDAL\csharp(there was no gdalconst_cshap.dell though, i download it from a site i found).
Change Platform target to x64 in Properties.
Run the program.
1) nothing happened.
2) in the case, i forced to change the running goes to Gdal.AllRegister() to chech if GADL and VS are linked though, it said "The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception."
// I know there must be something i missed during process, but i think for now i can't find anymore. any help or hints or suggestion will be very welcomed!

MSB6004 error in xamarin

I want to start programming Android with C# but in my first program I have this error:
"C:\Program Files\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error
MSB6004: The specified task executable location "C:\Users\briluser\AppData\Local\Android\android-sdk\tools\zipalign.exe" is invalid. (MSB6004)"
I found the android-sdk directory on my system, and copied zipalign from the build-tools/19.1.0 directory to the tools directory but it doesn't work for me!
I have seen this issue before and manually copying the file doesn't seem to work. To work around this try going into the Android SDK Manager and expanding the Tools folder. In there, try installing the latest version of the Android SDK Build-tools. For me this is Rev. 20. After installing the update, this error should go away.

Categories