Namespace Issues in Visual Studio Automated Builds - c#

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.

Related

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.

The name "..." does not exist in the namespace "clr-namespace"

I am having a weird problem with Visual Studio 2012, .NET 4.5 and WPF.
Views wont find references to any of my clases and I keep receiving the error "The name "..." does not exist in the namespace "clr-namespace" "
while intellisense do find any of my clases
What I've tried:
xmlns:common="clr-namespace:IVT.Common.View;assembly=IVT"
xmlns:common="clr-namespace:IVT.Common.View;assembly="
xmlns:common="clr-namespace:IVT.Common.View"
Moving my classes to other namespaces
I restarted visual studio and my computer
Changed the .NET version and the compilation method (x86/x64)
I created new projects and they have this problem now too... but old project still work...
EVERY time intellisense would find classes but visual studio still throws that error...
Any idea?
Thanks.
Try changing the build target platform and rebuilding. It actually solved the problem for me.
Change your current build target platform to the other one ie x64 if currently x86.
Re-build the entire solution.
Change back to required target platform ie x86 and re-build the solution.
I had similar problem using VS Studio 2017
In order to reproduce the problem I Created a WPF project. Added a user control and referenced the control in the main window.
The problem I had was that my solution was on a file server and not locally on my computer. Moving it to local everything worked as expected. Not sure if this is a bug in VS Studio or not.

Need help getting Azure project built

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.

VS 2012 occasionally not finding the reference to another project in the solution

I re-factored some functionality from an ASP.Net Project into a library project. Everything seemed to work fine but on my co-workers computer Visual Studio does not always find the assembly reference after a rebuild.
She writes some lines of code and sometimes the error list gets filled missing references. After a rebuild it is fine again and she can continue. It only occurs on her PC, I could not replicate it anywhere else.
I have already checked the Build Order and the Target Framework (Every Project uses .Net 4.5)

One or more project was not loaded properly

After copying the project to another laptop/ PC, when I want to open the solution, VS2010 shows the error "One or more project was not loaded properly". I have tried running visual studio in admin mode but that did not solve the problem.
This is usually a result of an inconsistency in your solution or projects. Open the solution file in an external editor (such as notepad) and check that the path it has to the projects is available and did not change. There shouldn't be any absolute paths in the solution file.
Maybe because the project from where you copied was configured with IIS configurations and you are trying to run the project in visual studio's default environment.
you have to right click on your project and set as a start up project after that you have run your project,
I seem to have found unloaded project, after noticing there's one missing by manually counting and comparing it to the number of projects the solution explorer reported. It was deep inside another folder in the solution explorer that I never used and assumed that had nothing worthwhile.
It's a familiar issue. Looks like the project you are trying to open was created in higher version than what you have. If the project is in MVC, make sure you have installed MVC OR Make sure you have appropriate version of .NET installed in your system.
I work with NopCommerce and a couple of times I downloaded new version and got same error message. It goes away once I install the dependencies.
Because you tagged it ASP.NET make sure you have all the ASP.NET components installed. Those are not part of .net framework but might be necessary in your project.

Categories