Visual Studio / Xamarin.Forms Errors on New Project - visual-studio-2017

I was working on a Xamarin.Forms project for weeks - everything compiled and I was able to distribute. The last things which happened as of 05/20, were 1) a Windows 10 update occurred, and 2) I did a VS 2017 update.
Now the entire project has this "type or namespace 'system'..." error on everything. This is happening 1) upon creating a brand new project and 2) before doing anything - even compiling. Just opening the "App.xaml.cs" file after a few seconds highlights all these things in red in the IDE
A screenshot of partial list of the "App.xaml.cs" file and the errors is here:
Other Info
I right-clicked solution and chose "restore nuget packages" - no change. I "cleaned" the solution - no change. I rebuilt... no change.
I am continuing to research and one clue which may help is that I can see the "NETStandard.Library" package in Nuget "installed" section shows "2.0.3" yet my common Xamarin.Forms project shows "2.0.1" and the drop-down of versions shows anything else is "blocked by project".
The other 3 projects, "Android", "iOS", and "UWP" will let me choose and install "2.0.3". I tried that once and then got a message about "mixed versions". At this point, I do believe the issue I'm seeing is related to this "NETStandard" package.
Cannot figure out how to make a brand new project load/use/install "2.0.3" instead of "2.0.1".

I was actually able to install the 2.0.3 version by opening the nuget package console and installing the package to the individual projects one at a time using the command Install-Package NETStandard.Library -Version 2.0.3 -Project ...

I had this problem like you and i solved this problem by add 2 package in package source.
In Visual Studio go to Tools -> NuGet Package Manager -> Package Manager Settings. Here select the Package Sources tab in the tree on the left. You should see the following:
enter image description here
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
Name: LiveReload
Source: https://nugetized.blob.core.windows.net/Live-reload/index.json

Related

After opening website in VS2017 - Error Publishing Customization

I am relatively new to Acumatica. I have been following the Development series of training videos and hit a hard stop on T300 video 4 after opening the website in Visual Studio and then trying to publish the changes in my customization project (after detecting/updating changed files).
Error:
The CodeDom provider type "Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" could not be located.
My environment is pretty simple:
Acumatica ERP 2018R1
Visual Studio Community Edition
Windows 10 Pro build 1803
I found a number of posts suggesting that I install a nuget package, which may or may not have helped but did not fix the problem. (Microsoft.CodeDom.Providers.DotNetCompilerPlatform)
I stumbled across a reference to the node_modules folder (sorry, lost that post link) which prompted me to check my TST vs DEV instances, and I found it does not exist in my TST instance. I also then noticed that the error I received during publishing happens after a series of lines about node_modules.
After a little more digging, I found https://stackoverflow.com/a/43494775 which seems to have stopped the node_modules folder from being created and appears to have solved my problem publishing inside of Acumatica.
Other posts for visual studio claimed that the issue comes from the C++ compiler not being included in GAC in VS2017, but I completed the T100 and T200 courses on VS2017 without any issue. The problem seems to be connected specifically to opening the Acumatica Website in VS2017.
Does anyone have any experience with this issue that can confirm disabling NPM restores won't cause me headaches down the road? Or is there a better solution? I don't recall anything in the setup guides telling me to make this change, and I haven't found any references that this was an issue before VS2017.
I do recall running into this in older version of 2018R1.
These posts helped me solve the issue:
This post solved it for me:
How can I disable NPM package restore in Visual Studio 2015?
Also with help from this post:
Getting File Path error while adding file to files list in Customization Manager
if you still have the node_modules related folder just delete it and you should be good (from what I can remember).
If these don't work try the latest 2018R1 build. (or at least 2018R1 Update 1)

VSTS feed "refresh" mechanism in Visual Studio

I have set up a VSTS nuget feed. And I have pushed some packages two days ago. I was able to add those packages to my project. But I needed to push an other version for one of them. Made new nupgk version, pushed it and I can see it in VSTS, I can download it from there, Visual Studio 2017 is also listing it correctly but when I try to install it, I am getting an error:
Package 'whatever 1.0.1' is not found in the following primary source(s): 'https://whatever.pkgs.visualstudio.com/_packaging/feedname/nuget/v3/index.json'. Please verify all your online package sources are available (OR) package id, version are specified correctly. 0
What I have tried:
- waiting around 10 minutes
- restarted Visual Studio several times
- pasting the above url into a browser and refreshing it manually several times
One or more of these helped. But I would like to know if there is any canonic solution for that.
I used the answer widget to have some formatting. Still, this might not be "the" answer, as I don't know the mechanism beyond. But it looks to be a workaround.
Steps:
Create a solution with a library project (let's call it L01)
Add another library project to the solution (let's call it D01)
Make a nuget package from L01 (version 0.0.1)
Push the package to your VSTS feed
Manage packages for project D01 and browse your feed
Package L01 v0.0.1 will be listed
Add it to project D01, it will work
Edit L01 nuspec file and change version to 0.0.2
Build and push the new package
Go back to project D01 and refresh the package list. The update will be shown.
Try to update. It will fail with the error message from my question.
Now go to folder %localappdata%\NuGet\v3-cache (or equivalent)
Locate the folder corresponding to your feed and open it
Locate list_l01.lib_index.dat (where l01 is the package name) and delete it
Go back to project D01 and try to install the update. It will succeed.
Would be good if others could confirm. I have reproduced this several times.
Seems you are trying to download the package or packages that where just freshly pushed to VSTS nuget feed.
Since Visual Studio 2017 is listing it correctly, then the issue should not related to the feed on VSTS server.
If this occurs very recently(download the new refresh package) and your package is very large, this maybe a network delay. Suggest you use a fiddler trace when this issue happens again. This makes "some" sense, what you see is probably an incorrect propagation of pushed packages showing up in the search results but not yet available to download.
And some other also encounter the same issue and error as you.
FYI, I've been seeing this exact issue in the past month or so.
Switching between sources, uninstalling and reinstalling are some work
arounds, but not 100%. Pushing my own packages up to VSTS and then
it takes like 15 minutes to finally get it to install.
More details please take a look at this similar issue Package update not found when updating via Visual Studio Solution

VS2017 RC1 Installation installation error - Microsoft.PortableLibrary.TargetingPack.Msi failed - No XAML

I had errors installing VS2017 with
Package 'Microsoft.PortableLibrary.TargetingPack.Msi,version=15.0.26004.1' failed to install
The actual IDE will open but I don't have any XAML functionality - it appeared to fail the installation before this component was installed. XAML files won't load and there is no XAML listed under 'Text Editor'.
How to fix this error?
After several hours finally managed to get it to work:
Still not sure exactly what a targeting pack is - and why VS couldn't install it but I manually installed this package and managed to get it to work:
Manually installed:
Microsoft .NET Framework 4.6.2 Developer Pack and Language Packs
https://www.microsoft.com/en-us/download/details.aspx?id=53321
Other things I did that may have contributed to the solution:
I rebooted
I removed all files in C:\ProgramData\Microsoft\VisualStudio\Packages - actually I moved them to an OLD folder and later deleted them. You will see packages downloaded here after you restart the install.
I had previously created a symbolic link from %ProgramData%\Package Cache to another drive to save space (https://superuser.com/questions/455853/can-i-delete-the-folder-c-programdata-package-cache). This symbolic link didn't seem to work anymore leaving me with some files in %ProgramData%\Package Cache and the rest in the other drive. I moved them over and recreated the link. If this is something you did to save disk space and forgot then that could contribute towards a failed solution.
Something above fixed the issue and I now have XAML back again.
Note: The VS2017 RC1 does not support offline installation so that was another avenue I explored and gave up on. The command line switches currently do NOTHING.
I believe the package I needed is the following one but not absolutely sure.
C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.PortableLibrary.TargetingPack.Msi,version=15.0.25719.0

Building UWP app from command line

I need to create kind of builder for my Universal Windows App (UWP) application, that would load some configuration into it, build it and create app store package. Is there any way to build UWP app from command line, without associating it with the store and using Visual Studio at all?
There is WinAppDeployCmd, but it can be used to install builded appx package on device and I need tool like that to generate that package.
UPDATE
I've managed to build it and create app packages with command line, here is command I used:
msbuild "path to .csproj file" /p:OutDir=output_dir /p:AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM" /p:BuildAppxUploadPackageForUap=true
It's working but not as it should apparently. I can not install generated appx package on my phone (and emulator). I just get error
Failure reason: Failed to start deployment. Failure text: Install failed. Please contact your software vendor. (0x80073cf9)
I found many solutions for Windows 10 PC version, but there is only one solution I found for Windows 10 Mobile and this "solution" is to hard reset the phone, but I do not want to do that. Is there any other way?
And there is one more problem. This command doesn't work with parameter /p:Configuration=Release; and it only builds with Debug configuration, but I believe this is not related to previous error, because it doesn't work with Visual Studio either.
UPDATE
I could not find another solution, so I did the 'hard reset' of my phone and now it is working. It's sad, but I hope the reason is the Windows 10 Mobile OS is still in beta version.
Step 1 : See, you need to install .NET Framework installer from the below link. https://www.microsoft.com/en-us/download/details.aspx?id=30653
Step 2 : Go to C: drive and find where msbuild.exe is. You will find more msbuild. But mostly it will be in the location like C:\Windows\Microsoft.NET\Framework\v4.0.30319.
Step 3: Open the CMD in administrator and point to the location which is mentioned in Step 2.
Step 4 : Paste this. msbuild.exe "YourCompleteProjectPath.sln" /t:rebuild
See this for reference : https://msdn.microsoft.com/en-us/library/ms164311%28v=vs.85%29.aspx

Failed to configure settings for runsettings plugin 'VSTest Run Configuration' as it threw following exception:

------ Discover test started ------
Failed to configure settings for runsettings plugin 'VSTest Run Configuration' as it threw following exception:
'Method not found: 'System.Collections.Generic.IEnumerable1<System.String> Microsoft.VisualStudio.TestPlatform.Utilities.InferSettingsHelper.MergeRunSettingsAndFindCompatibleSources(Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture ByRef, Microsoft.VisualStudio.TestPlatform.ObjectModel.FrameworkVersion ByRef, System.String, System.String, System.Collections.Generic.IDictionary2>, System.Xml.XPath.IXPathNavigable, System.String ByRef)'.'
Please contact the plugin author.
Exception has been thrown by the target of an invocation.
========== Discover test finished: 0 found (0:00:00) ==========
I found the solution by my own observations. After digging for 2 days and found nothing about this problem...
Well, the problem is caused simply because vstest engine is not updated. When I implemented those steps mentioned in the article "Authoring a new Visual studio unit test adapter" for Bhuvaneshwari K, sorry guys the admin says I can't post more than 2 hyperlinks and I prefered to post the links for Microsort down center for the solution. Anyway, you can google the article for more info.
When I compared the vstest of my build machine, and once again of my local test machine I found that the vesion of vstest.console was obsolete, although I see in the Hellp=>About menue that Update1 is already installed for both machines with the same version. So, I figured to install again the VS SDK and update 1, well in fact, repair not install. So I installed them from those links:
1- Microsoft Visual Studio 2012 SDK
http://www.microsoft.com/en-us/download/details.aspx?id=30668
2- Visual Studio 2012 Update 1 KB2707250 from the link:
http://www.microsoft.com/en-us/download/details.aspx?id=35774
3- Restart the machine.
And the XMLTestAdapter is working like a charm in VS2012 in the build machine, still though I met some issues with TFSBuild to find the assemblies in a mapped folder under TFS2012 for the dlls of that adapter. I'll post a question for it in a new thread.
My solution to this problem was that I had an issue in my Windows 7 System Environment variables.
To access:
Start Menu\Control Panel\System and Security\System
Click the Advanced System Settings link of the left.
Choose 'Environment Variables'
In the 'user variables for ***' section, click "New".
Variable name = PROCESSOR_ARCHITECTURE
Variable value = AMD64 (or whatever you find in the same corresponding 'system variable' area in the same window.)
close/reopen Visual Studio and rebuild your solution.
What fixed this for me was adding the System.Configuration.ConfigurationManager package to the class library I wanted to test.