I get an error when trying to add OrchardCms - orchardcms

I get this error on both Visual Studio 2015 and 2019
public void ConfigureServices(IServiceCollection services)
{
services.AddOrchardCms();
}
'IServiceCollection' does not contain a definition for 'AddOrchardCms' and no accessible extension method accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)

[SOLVED] Make sure if you are using VS2019 you select .NET Core 3.1

Related

Missing OpenTK when porting Xamarin.iOS app to .Net 7

I am porting a Xamarin.iOS application using OpenTK to net7.0-ios:
error CS0246: The type or namespace name 'OpenTK' could not be found
(are you missing a using directive or an assembly reference?)
OpenTK assembly seems to be missing from net7.0-ios.
In net7.0-android one can reference the Xamarin.Legacy.OpenTK NuGet package to get OpenTK. But this package is only for Android. I cannot find the corresponding legacy package for iOS.
Are legacy bindings for OpenTK no longer available in net7.0-ios?

How can an Azure precompiled C# function build locally in VS2017, but not in VSTS MSBuild?

How can an Azure precompiled C# function locally compile, but not in VSTS?
I've used the latest preview of the Visual Studio 2017 Tools for Azure Functions, along with VS 2017 preview 3 to create a simple HttpTrigger function. The VS sln compiles fine locally.
I can also successfully publish to Azure from VS ... eventually!!
First time fails, but shell is created in Azure. Second publish actually gets the json and dll up to Azure.
Thought I'd set up a quick CI build in VSTS, and followed details in Donna Malayeri post.
But VSTS shows loads of errors in the build solution task, e.g.
2017-07-11T13:51:59.3254765Z ##[error]SmcPrecompileFunctionApp\TriggerByHttp.cs(14,10): Error CS0246: The type or namespace name 'FunctionNameAttribute' could not be found (are you missing a using directive or an assembly reference?)
2017-07-11T13:51:59.3254765Z TriggerByHttp.cs(14,10): error CS0246: The type or namespace name 'FunctionNameAttribute' could not be found (are you missing a using directive or an assembly reference?) [d:\a\1\s\SmcPrecompileFunctionApp\SmcPrecompileFunctionApp.csproj]
Double checked and the agent is set to the Hosted VS2017
Make sure you're using the latest version of NuGet in the NuGet build task. For some reason, lower versions don't restore all the packages correctly.

type or namespace could not be found / Xamarin

i tried the MVVMCross Tutorial over at https://www.youtube.com/watch?feature=player_detailpage&list=PLR6WI6W1JdeYSXLbm58jwAKYT7RQR31-W&v=_DHDMNB_IeY&t=1563s. Android works very fine.
I'm currently at iOS and it does not work like in the video. It says:
Error 8 The type or namespace name 'MvxMessage' could not be found (are you missing a using directive or an assembly reference?)
so i can't to anything. Do you guys know what to do?
Edit: I use Xamarin.iOS Unified.
The general advice seems to be not to use the unified projects yet.
See:
Could not install package MvvmCross.PortableSupport 3.2.1 at Visual Studio 2013 for PCL Profile 158
http://blog.xamarin.com/is-the-ios-unified-api-for-me/ - "if you don’t need to utilize the App Extensions framework today, hold off on moving to our preview Unified API"

Project Reference Compilation Error

In my C# solution, there is a web service project in which adding project reference of a class library project does not work, it throws compilation error saying -
The type or namespace name 'xyz' does not exist in the namespace
'abc.pqr' (are you missing an assembly reference?)
abc.pqr.xyz is from the class library being referenced.
while adding dll reference does not throw any compilation error.
I even checked the framework, it is .net framework 4 in both.
One thing more, the project which needs to have a reference was a web service project (Framework 3.5, converted to 4.0).
I added another web service (then converted to 4.0), then added project reference added the same code, compilation goes well.
Issue is with only one project in the solution.
Please help me to figure out the fix.

The type or namespace could not be found

I'm currently trying to convert a WiX 3.5 custom actions project in Visual Studio 2008 to WiX 3.7 and Visual Studio 2012 and I'm getting the following exception:
The type or namespace name 'MyNamespace' could not be found (are you
missing a using directive or an assembly reference?)
The dll is definitely referenced and Visual Studio 2012 has no problem seeing the namespace. Everything under the namespace even pops up in Intellisense, but when I build it I'm getting this exception.
Anyone have an idea of what's going on here?
Additional Info:
The namespace I'm referencing is a .Net 2.0 library and the custom actions project is a .Net 2.0 project.
EDIT:
After further investigation, I'm getting this warning, which I'm guessing is the root of the problem:
The primary reference "MyNamespace, Version=8.5.1.20, Culture=neutral,
PublicKeyToken=f593502af6ee46ae, processorArchitecture=MSIL" could not
be resolved because it has an indirect dependency on the .NET
Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0"
than the version "2.0.0.0" in the current target framework.
Why is it trying to use mscorelib 4.0 when this is a 2.0 project?
So it turned out that the dll being reference, while compiled to target the .Net 2.0 framework, was being compiled with the 4.0 compiler. Switching the project to compile with the 3.5 compiler solved the problem.
This may be completely unrelated but I had a similar issue yesterday. I had accidentally copied a class file (.cs) from one solution into another solution. Clearly, I hadn't added the references to the other solutions.
In our case, while the referenced dll was targeting .Net 4.0, it had its own reference to a .Net 4.5.2 dll. The referenced 4.0 framework target led us to believe that 4.5 or 4.5.1 were sufficient to handle things, but they weren't—the referencing project had to be 4.5.2 to handle the dll and all its references.
This was clearly an error on the part of the dll maker.

Resources