VS Code is not recognizing imports - testdriven.io

I'm currently working through "The definitive guide to celery and flask" and I'm having a problem after Chapter 5. I created the docker containers but now Visual Studio code is not recognizing new packages. I added "watchgod" to requirements.txt and the app works ok but VS Code says I have a missing import.
How do I get VS Code to recognize new imports?

Related

The target "ResolveTagHelperRazorGenerateInputs" does not exist in the project

I am getting the following error when i try to build an AspNetCore Web Application targeting netcoreapp2.2.
Error MSB4057 The target "ResolveTagHelperRazorGenerateInputs" does not exist in the project. C:\Program Files\dotnet\sdk\2.2.103\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets
I have tried the following:
clear cache on vs according to this post
update vs2017 to 15.9.5
reinstall net core sdks
reinstall vs
Nothing helped. I first got the error during an upgrade from core 2.1 to core 2.2 on a different project, and it's possible that by mistake edited the
Sdk.Razor.CurrentVersion.targets file. From that moment on, i keep getting this error on any project that targets core 2.2 (even new ones).
Does anyone encountered this problem or have any clues about solving it?
Thanks
After long battles it figured out to be a problem with VS NuGet Package Manager.
All I had to do was:
VS > Tools > Options > NuGet Package Manager > Clear All NuGet Cache(s).
The Following Link was my solution. I also struggled to get this fixed.
Just copy the files from the NetStandard2.0 folder from GitHub then replace it with you Directory from the same location.
Hopefully this helps someone.!
Here is the Answered Link:
https://social.msdn.microsoft.com/Forums/en-US/cafc9823-eb61-46f7-8489-007242ef2ad2/target-quotresolvetaghelperrazorgenerateinputsquot-does-not-exist-in-the-project?forum=msbuild
Here is the GitHub Link
https://github.com/aspnet/Razor/tree/master/src/Microsoft.NET.Sdk.Razor/build/netstandard2.0
I encountered the same issue during the Azure build pipeline process, and clearing the NuGet package cache resolved the issue.
Solution:
I used a dotnet tasks with "custom" to issue the following command before NuGet package restore task:
command:
dotnet nuget locals global-packages -c
Screenshot shows the build pipeline task
For me the solution was as follows:
In Visual Studio
Right click on each project and click "Unload Project"
Right click on each project and click "Reload Project"

Visual studio project.json does not have a runtime section

I ran into a error in visual studio 2017, I'm searching over the net but I don't find anything usefull, so my question is, how can I solve this:
Severity Code Description Project File Line Suppression State
Error Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win": { } }' to your project.json and then re-run NuGet restore.
I was seaching for file where is located in my project but with no succsess.
Thanks
I got rid of this problem by manually deleting Visual Studio obj folder of the project that it's complaining about (the 'Clean Solution' command wasn't getting rid of it).
I found the answer through this and this threads.
I had the same issue after trying to migrate all my projects to the new .csproj format manually. I had an issue with one projet in the new format, so I reverted from git, and this message started to show up.
What I did:
Closed VS
Removed the .vs folder
Removed the packages folder
Restarted VS
Tried to build
Had issues with namespaces not found, as if packages were not installed
Opened NuGet package manager console
Ran Update-Package -reinstall -ProjectName <project>
Problem gone!
Hope it helps someone with the same issue :)
I upgraded a NuGet Package.
Then I undid some changes for the project, but the NuGet Packege had created a json file called project inside the project folder.
Inside this file, I could find runtimes.
But I just deleted this json file and built again.

How do I import Primefaces 6.0 source as maven project in Eclipse?

I followed Building From Source https://github.com/primefaces/primefaces/wiki/Building-From-Source instructions. Building the SNAPSHOT version project from command works well.
However, importing it into eclipse using the Existing Maven Projects wizard gives me a lot of errors in the Problems view. I fixed the lifecycle mappings by setting all to ignore.
I realized the generated source code in the target/generated-sources/maven-jsf-plugin directory but it was not picked up by the m2e plugins as a source folder automatically. So I included it into the eclipse build path manually. But then again, many compile errors show up in the generated code.
Does anybody use eclipse as IDE for primefaces development? How do you setup the eclipse project to develop primefaces?
The eclipse project uses Java Compiler compliance level 1.5 derived from the pom.xml maven-compiler-plugin settings. Setting the Java Compiler compliance level to 1.6 solved the issue for me.

Razor Engine on Mono 3.2.x with Fast CGI - target specific .net?

My site works on mono 2.10 and I'm nearly done on a brand new server upgrading to mono 3.2.x.
It works using XSP4, the ServiceStack Razor views render correctly. (And it fixes a lot of artefacts in 2.10)
When I set the site to use nginx + Fast CGI (4) however I get a HttpCompileException, caused by:
The predefined type `System.Collections.Generic.IReadOnlyList' is defined multiple times. Using definition from `mscorlib.dll'
Remember this works fine with xsp4 so I think it needs some setting to tie it to one .Net instance, maybe it's confused between .net 4.0 and .net 4.5? Any suggestions on how I can force it to use only one of these?
Note: I installed from git using latest (3.2.7), as the 3.2.5 release would crash. I'm using a clean Amazon EC2 Ubuntu 12.04 64bit. It didn't have mono on it before, and when I tried 3.2.5 it was another now deleted instance.
This is largely the same error as: RazorEngine on Mono - TemplateCompilationException thrown
But I had no other version installed. The build process added others which have since been deleted to no effect. All instances of mscorlib are here:
/usr/lib/mono/2.0/mscorlib.dll
/usr/lib/mono/4.5/mscorlib.dll
/usr/lib/mono/4.0/mscorlib.dll
I found out what the problem is and was able to solve it.
The culprit are these files:
https://github.com/mono/xsp/tree/master/src/Mono.WebServer.FastCgi/Compatibility
For some reason, they added these compaibility classes that are compiled to a NET 4.0 target (which does not have the IReadOnlyList class), but when we run the fastcgi-mono-server4, it runs under the 4.5 runtime, which do have a IReadOnlyList class and therefore generates the Razor HttpCompile error.
The solution was adding these 2 parameters -d:NET_4_5 -sdk:4.5 to the Makefile.in of the FastCGI source project:
#NET_4_0_TRUE# $(DMCS) -d:NET_2_0 -d:NET_4_0 -d:NET_4_5 -sdk:4.5 $(MCSFLAGS) $(references4) /out:$# \
Then I recompiled and reinstalled with ./configure, make, make install and the Razor compile error was gone for good.
If you don't want to go through all this trouble, I'd recommend sticking to the latest released version of the xsp project, which didn't have these Compatibility classes.

Marmalade: error LNK1181: cannot open input file 'python.lib

I'm trying to build Marmalade project for Windows Phone 8 in Visual Studio Ultimate 2012 but receive following error:
error LNK1181: cannot open input file 'python.lib'
Seems that it happens because of wrong path to project's additional library directories. Currently it's c:\users\*user_name_omitted*\appdata\roaming\marmalade\packages\6.3.0\python_2.6.4\lib\wp8\x86
But in fact there is no wp8 folder. As I understand this foulder should be created automatically...
I have Marmalade evaluation license.
How can i get rid ot this error?
Two suggestions:
I've not got a working version to hand, but the bundled version of python with marmalade is (IIRC) 2.5.x, so the reference to 2.6.4 looks odd. I wonder if when you ran s3eConfig it was running a different version and got confused? More as like it should have downloaded some extra stuff and has not.
It might be worth uninstalling marmalade and then re-installing. There are reports of people not having a full installation following the install.