Most questions are related with old version of ASP.NET MVC.
My question is related to latest .NET Core build on Framework 4.6. I created a console application and standard class library. I installed all libraries needed for running WEB on .NET Core.
Everything is working fine, views are compiled fine and debugging views also working. Unfortunately, Visual Studio shows the following on any object in view:
The name does not exists in the current context.
How can I get rid of these red underlines?
I am using this technique: Running ASP.NET Core MVC as a Console Application Project without .NET Core SDK
This error occurred in the initial versions of .NET Core and the tooling for Visual Studio: Basically it was as if we were running release (not debug) build. Please upgrade to the latest versions, including Visual Studio 2015 Update 3, and .NET Core tooling.
Related
I can't successfully build basic ASP.NET web app targeting framework 4.7.2.
I built a docker image with a base image for Windows Server Core 2019. On this image I installed VS 2022 Enterprise and took Azure development, .NET desktop development, ASP.NET and web development modules, including recommended ones.
For dotnet core solutions everything works fine, but for dotnet framework I am getting such errors:
packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props(31,5): Error MSB3758: An error has occurred during compilation. error CS0014: Required file 'alink.dll' could not be found
packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props(31,5): Error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Tasks.Core.dll". The task factory must return a value for the "TaskType" property.
I additionally installed .NET Frameworks: 4.5, 4.6, 4.6.1, 4.7.1, 4.8, but it didn't help.
Locally, I am able to build it without any problems. I checked the image if VS 2022 was installed without any issues and it looks fine as well. All environment variables are also in place. I thought the issue was related with some missing .NET Frameworks with SDKs, but it still persists.
Installing Redistributable C++ 2012-2022 didn't help as well. I am using MSBuild 17.
What I still might be missing?
I want to create an agent for Azure DevOps and as a reference I use the Dockerfile from Microsoft documentation. One difference is that before the start script, I run my custom script to silently install the VS 2022 with the modules I specified earlier.
I use Azure DevOps pipelines to build the solution, and the VSBuild#1 task.
I was finally able to solve the problem I had. It turned out that the base windows server core image didn't contain all of the needed prerequisites nor Visual Studio. Solution was to use extended windows server core image with sdk 4.8. This is strange, because Visual Studio already delivers everything for sdk 4.8. I think the extended image must have had something else that didn't come with the VS installation.
I have a .net 5 web api that consists of a solution with most of projects being .net 5, but two of them are .net framework (v 4.7.2).
The web api works fine when I run it, and referring to .net framework projects is not a problem.
Now I am trying to upload this solution to azure app service using Github actions. The build step works fine, but when publishing, I get the following error:
C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\5.0.202\Microsoft.Common.CurrentVersion.targets(4288,5):
error : MSB4803: The task "FormatUrl" is not supported on the .NET
Core version of MSBuild. Please use the .NET Framework version of
MSBuild. See https://aka.ms/msbuild/MSB4803 for further details. [path
to my .net framework .csproj]
I am trying to avoid updating the project to .net 5. Is there a way to configure my github actions to be able to publish .net framework projects as well?
I have installed both .NET CORE 3.1. and preview 5.0. I see it when I type command:
dotnet --list-sdks
I see all packages
but when I want to use it in VS project in C# .NET CORE console app I cannot.
I have not tried .NET CORE 3.x with VS 2017 but according this page it is possible that is is supported only in VS 2019.
You might also try to restart Visual Studio. I think it loads installed frameworks only during startup.
Also check out this thread. You might find there some answers
I am trying to open this project on my visual studio 2015:
http://www.codeproject.com/Articles/992208/Angular-JS-Application-with-MVC-Web-API-ASPNET-and
When I open the project I get the following message:
DNX SDK version '....1.0.0-beta4-11566' is required by your solution
but is not installed on this machine. Do you want to install it now?
If you select No, '...1.0.0-rc1-update1' will be used as the solution
DNX SDK Version for this session.
I choose Yes and it failed to install the DNX SDK version so it uses version 1.0.0-rc1-update1.
Then, I get this error:
The dependency Microsoft.AspNet.WebApi.Core 5.2.3 in project ... does
not support framework DNXCore, Version=v5.0.
I am running the most recent version of Visual Studio 2015 and Windows 10. I have tried updating everything, everything is up to date. I don't know why I keep getting this annoying error. I tried using different versions of the WebApi.Core from the most recent to the first version.
It's also important to mention that I am new to the whole ASP.NET 5 concept, I'm used to work with MVC 5 and under.
i am working on a dotnet C# web application which was initially created with VS 2003. My goal is to upgrade this application to Dotnet 4.0 without changing any functionaltiy. The solution has 9 projects (1 web + 8 Library projects). The Web project refers the 8 libraries in DLLs. To start off, I created a New project in VS2010 and added the all the Project files from the existing source code. Every time i add a project file to my solution, i was prompted with the Converison wizard and i completed the conversion wizard succesfully and now the solution works fine. After the conversion, i noticed that Except the "Web" project, other projects are converted to Dotnet 2.0 but not 4.0. My application runs without error if i run it locally using VS2010. My questions are
Why the Class libaray project did not upgrade to 4.0? Currently the
Web project is shows up as Dotnet 4.0 and Libaray projects shows up
as Dotnet 2.0.
Can i deploy the application to IIS 7.0 with the
Dotnet runtime of 4.0? Will the Dlls created in version 2.0 work if my application
uses Dotnet 4.0 runtime version?
Please help...
If your'e migrating now, why not move directly to Visual Studio 2012, instead of 2010?
Anyway, what you can do is open the project properties in each of your projects, and change the target framework to the .NET framework 4.0.
Then if you get any compilation error you can probably easily solve it individually. This should be relatively easy if your projects are not too big.
As for your specific questions:
The automatic conversion would only change the format of the solution/projects to be compatible with the new version Visual Studio. It shouldn't change the target framework but you can change that yourself.
Yes, assemblies targeting .NET 2.0 can be loaded and used from assemblies targeting .NET 4.0.
1) Upgrading the solution/projects file only upgrades it's format so you can open it in VS 2010. It will usually leave the targeted .NET setting at the previous value. These are two seperate things. The wonderful thing about VS 2010 is it let's you target whatever version of .NET you desire, so no longer do you need multiple version of VS installed to support differnt .NET versions. It didn't change the targetted .NET version because it leaves it up to you. You can change it under the project settings and recompile your library projects to regenerate the DLLs
2) You will need an application pool for .NET 4. .NET is backwards compatible in that a .NET 2.0 app can run on a machine with .net 4 installed. However, the application pool for 2.0 applications must be separate from 4.0 apps. So it's just a matter of putting the app under the right app pool.