Need help getting Azure project built - c#

A client has given my company a Visual Studio project that I've told is using Azure and I've been told to get it working ("debugable") in Visual Studio. I've not used anything with Azure before, so this is all new to me. I downloaded the Azure SDK and have opened the project in Visual Studio. I'm getting multiple errors when I try to rebuild it. It looks like I'm missing .dll files. I've searched online and can't find reference to those files. My guess is that something related to Azure isn't installed, but I'm not sure how to find it. Can someone take a look at the errors I'm getting and suggest what the problem is and how to fix it?
The most common errors seem to reference missing dll's like this "Scfx.Core.WebApi\bin\Debug\Scfx.Core.WebApi.dll' could not be found".

Your projects are not rebuilding because (as Jonesopolis said) it looks like you are using VS2013, but you need VS2015.
Once you have the correct version of Visual Studio it will probably compile, but if it does not then see this question for more help.

Related

C# Rider IDE can't create a new project

I've installed Rider IDE on my Arch machine using flatpak, I face an error while creating new projects Unable to load project and obtain project information from MsBuild.
The error message says: Probably this project is incompatible with the current MsBuild.
MsBuild error details: Protocol connection was interrupted because the process has exited.
Anyone knows why it happens, and how can I fix the issue?
I have .NET6 installed and everything (including build process) works on VSCode.
I've tried cloning MsBuild from the GitHub repo and building it locally, but that doesn't help either.
After all, I tried all the solutions found on the internet and realized it was an issue with the Flatpak package.
I believe the maintainer forgot to put some required files in the package, or this might be a Permission related issue!
My suggestions to all the other user who might come to this once in the future are:
Learn Flatpak fully, so you be able to track what's not working and why!
If you're on an Arch machine, it might be a better idea to search in the AUR first.

Dotnet framework error when using Visual Studio Windows Forms App

So i am trying to make my first aplication using C# and Visual studio but every time i try to make one I get the following error:
Could not find a part of path 'C:\Users\Myusername\.templateengine\dotnetcli\v6.0.201\packages'
Here is a sceenshot of what my screen is:
I tried installing the .net framework i tried mostly everything i could find as tips. Could you share a download link for the .NET framework or if you could explain to me why it doesn't work. I would be greatly appreciative
EDIT:
For anyone out there, creating the folder should fix the issue for a bit but a more sustainable way to fix this is to uninstall and reinstall visual studio again. If that doesn't work, try updating your Visual studio or worst case scenario, ask on visual studios forums for help
I'm not sure if it's related to your issue, but i would avoid using spaces in project name, it can cause some trouble.
For anyone out there having the same issue to resolve it you can just do the following:
1- Goto CMD (by typing cmd in the search bar) and type:
cd .templateengine\v<the version your error throws at you>
And then do dir to check all of the items within the folder. If you don't see a directory named packages then go ahead and do: mkdir packages which will create a directory named packages. Now boot up Visual studio and create your project. Now you should not get any errors and Visual studio should boot up your project.

Unable to debug and publish Azure Function from Visual Studio 2017

I used to debug and publish my Azure Function Project using Visual Studio 2017.
However suddenly everything stopped working.
When i tried to debug the project i got the error "A project with an Output Type of Class Library cannot be started directly.".
When i tried to publish the project, the option to publish to Azure disappeared and i'm only offered to publish to a folder.
When trying to create a profile i can also only choose the Folder Profile type.
I saw a similar behavior once in a Web Project when the "Project Sdk" Attribute in the .csproj file was wrong but i doublechecked it with a newly created Azure Function Project and it was the same.
When i create a new function project, i can publish to Azure as i could before.
I'm using the following packages:
along with .NET Framework 4.7.1.
Also i'm referencing some other projects from my solution containing Business Logic.
I ended up creating a new function project, copying everything there and now it's working again as expected.
Does anybody know how this could happen and how to fix it without creating everything from scratch?
In my case I was able to fix it by ensuring the NuGet package for Azure Functions was referenced:
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
I just had this same thing happen to me. I added a new Azure Function project to an existing solution, and it wouldn't let me debug it. I added an additional Azure Function project just to test it, and it worked fine. Compared the .csproj files, they were both correct.
I restarted Visual Studio and I was able to debug both Function projects, though I don't know if that will always fix the problem.
I had the same problem. I went in to the Visual Studio Installer and (re?) installed the "Azure development" workload. That fixed it for me.
Azure Functions tooling for Visual Studio is not always as stable as one would wish - but it's getting better for every release.
I had a similar problem after updating to Visual Studio 2017 v15.3 and then again when updating to v15.5. Both problems disappeared after updating or reinstalling the Azure Functions plugin.
But if you already have opened (and saved) to solution with a non-working VS setup then VS seems to 'destroy' the project sometimes.
You could look in your non-working project to see if your .csproj-file(s) contain:
<ProjectGuid>{0EC16A67-C60A-4950-A533-07D8783C88B0}</ProjectGuid>
...which is the guid for Azure Functions projects.
If your ProjectGuid is different then you could try changing it to the above and it should(might?) work.
It could be because the wrong project is set as startup project. In the solution explorer, you'll notice that the startup project is in bold. If it is not the right project, try right clicking on the correct one and click Set as startup project.
Solved it for me.

Visual Studio 2017 MVC does not contain all source folders

I have an issue with the new Visual Studio 2017 when starting a new ASP.NET MVC project. Recently I started a course on Udemy:
https://www.udemy.com/the-complete-aspnet-mvc-5-course/learn/v4/content
In this course I obviously try to mimic the teacher as perfectly as possible. However, I bought a new laptop yesterday and installed VS2017 on it (apparently you cannot get VS2015 as easily anymore). I followed the same steps as with VS2015 on my previous laptop, but it seems that the files generated by VS2017 are less than those generated by VS2015. Two of the files I'm missing are:
Startup.cs
Models/IdentityModels.cs
And there are several more missing, for instance regarding the Account Managing. The files in VS2017 look like this:
VS2017 MVC generated files
Unfortunately I don't have a snippet of the VS2015 version, since I already reset my old laptop to factory settings.
Are there others with the same issue, or is this standard since VS2017? Right now I can just look at what the teacher does, but later on he will introduce logging in and authentication, at which point I assume I will need that Account Manager .cs file.
Any help is appreciated.
Thanks to itsme86 and Jasen I found the "issue". Just needed to put the authentication model to "Individual user accounts" when creating the project. Stupid error from my side.

Namespace Issues in Visual Studio Automated Builds

Having a bit of an issue with automated builds in Visual Studio Team Services (previously VSO, TFS Online).
I have a class that is referencing a namespace that is this format:
Project.Name.Name.Folder
The issue is there is class named:
Project.Name.
There is no issue in Visual Studio when building or even packaging the project for Azure and it deploys manually fine, but when I run automated builds it comes back with and error that basically states that Name does not exist in namespace Project.Name, so it's obviously looking in the wrong project when it runs the automated build.
Is there some syntax I can use to basically notate what is specifically the class name and then the folder path inside the class?
ex: [Project.Name.Name].Folder
Any help is appreciated.
Turns out VS was just confused :/
If I removed the reference, re-added it, and then removed the using statement and re-added it, the issue was resolved. To be fair, the solution built, ran, and even manually deployed to Azure just fine. It was Continuous Integration that was being problematic with it.

Categories