The target "RunResolvePublishAssemblies" does not exist in the project - c#

I'm working on a WPF application, using VS 2017 version 15.3.3
I was curious to know what's behind the file type Azure Function:
When I added it there was nothing changed in the solution explorer, I ignored that and continued my work (which has nothing to do with Azure), but when I compiled the project I get this error:
The target "RunResolvePublishAssemblies" does not exist in the project
and this warning:
Error encountered while loading the project. Some project features,
such as full solution analysis for the failed project and projects
that depend on it, have been disabled
I switched the solution explorer to view all files, and I found the azure function class is hidden in the place I added in, I deleted it, but the same problem still exist
Please, help!

For me this problem was happening because we switched Azure functions project back from dot net core to 4.5.1. So i deleted 'bin' and 'obj' folders from each of the projects, and re-build. It started working fine for me once deleting these 2 folders. I was able to clean and build the projects. My unit tests are also passing fine.

This GitHub error log helped me with this error: https://github.com/Azure/azure-functions-vs-build-sdk/issues/92
Following this suggestion resolved my build error:
To work-around this specific issue , you may be able to give an empty target in your csproj
<Target Name="RunResolvePublishAssemblies" /> but I am not sure what else would be broken without using the SDK style projects.

Related

unable to implement gRPC having issues with Protos\greet.proto: No such file or directory

I'm trying to use gRPC for one of the microservice using this URL in ASP NET 6.0. I have also installed the required package "Grpc.AspNetCore" Version="2.48.0". But it still gives me compilation error about 'Protos\greet.proto: No such file or directory', path\Could not make proto path relative 1
'
I tried to make path relative but still no luck.
I'm running on visual studio 2022 and did make update to make sure that it is not because of update. I also tried creating another test project with gPRC project template and it worked but when i tried to add another service it gets failed again in test project too.
working with manual way for now.

Mapster.Tool Code Generation for Specific Project

I have a Visual Studio solution containing various sample console app projects. One of which is MapsterSample where I am trying out Mapster and following the steps described on GitHub https://github.com/MapsterMapper/Mapster/wiki/Mapster.Tool to generate mapping code.
Everything seems fine except for the part where I issue the command:
dotnet msbuild -t:Mapster
This results in the command executing for every project in the solution even if MapsterSample is selected as Default project in Package Manager Console:
SampleSolution\FirstSample\FirstSample.csproj : error MSB4057: The target "Mapster" does not exist in the project.
SampleSolution\SecondSample\SecondSample.csproj : error MSB4057: The target "Mapster" does not exist in the project.
... and so on
Is there a way to just execute the command for the MapsterSample project?
Make sure the project exists within your solution.
Make sure that the name Mapster is spelled correctly.
Make sure your terminal is in the correct directory. (ideally you should be in the directory ABOVE the directory the .csproj for Mapster is in.

Specflow designer generated code is using old specFlow 1.9.0.77

I have the following Nuget packages in my project.
Specflow v2.4.1
Nunit v3.11
Nunit Test Adapter v3.12
When I added or modified a feature file, specFlow is creating/modifying designer generated file somehow referring to old version of specFlow.
using TechTalk.SpecFlow;
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")]
With this I am getting build errors and tests no longer running.
When checking the issue, I noticed that the TestTalk.SpecFlow.dll is pointing to bin/debug folder. When I closed the solution and removed all files from bin/debug folder then the reference path changed to packages folder and then the designer generated code is picking right specflow version.
The problem is re-occurring after build solution action is performed (Now Techtalk.specFlow.dll is referring to bin/debug folder)
I have tried to remove the designer generated code and run the custom tool again but only when the DLL is removed from bin/debug folder the problem resolved.
I even tried to change the setting Code Behind File Generation to AppDomain or Out of process but the issue persists.
Pls help to resolve the issue instead of deleting the files everytime. Thanks.
I solved this problem by downgrading both NUnit and SpecFlow.
• Nunit.Framework: 3.4.1
• SpecFlow: 2.3.2

Silverlight 5 (5.1.30214.0) causes "Invalid or malformed application" error

I recently updated Silverlight to version 5.1.30214.0 and am now seeing this strange error:
Unhandled Error in Silverlight Application
Code: 2103
Category: InitializeError
Message: Invalid or malformed application: Check manifest
I already checked the following (see Silverlight application doesn't run. I get an invalid or malformed application error):
I did not make any namespace changes
startup object is set correctly
I do not use any styles
I do not use any resources
generated AppManifest contains correct EntryPoint and AssemblyParts
uninstalled and re-installed Silverlight 5 and SDK
I also recreated the whole Silverlight project (different namespace) and manually recreated the files.
Anything I'm missing?
UPDATE:
I manually removed all files under bin and obj and recompiled (Clean option does not seem to work). It now appears to be working again?!
As silly as it might seem, VS-2012 does NOT clean the bin/obj folders. Deleting the files manually fixed the issue and everything is hunky dory again.
I wasted hours on this. Hopefully this will help someone out there.

Visual Studio "Rebuild all failed"

Why does Rebuild fail with no errors?
Since this morning, this error keeps showing up. I build the entire solution (25 C# managed projects) and a "Rebuild All failed" appears, but without any errors! (I have 13 warnings about COM not supporting Generics, but it's "normal" because one dll is exposed as COM.)
Not an answer per se - but you're better off looking at the output window and seeing what it says there.
Also, to help with that you might want to look at your MSBuild verbosity - as shown on this screenshot (last two options):
Beware - the highest level generates a MASSIVE amount of information.
Finally - running msbuild from the solution folder in a command prompt will really nail the issue - because error messages and warnings come up in red and yellow respectively.
I found my own solution and it is simple:
When this error occurs, save the project and close VS 2013. After that, re-open VS2013 and open the last project.
It works like a charm. But it is very annoying every time!
Many people reported this problem in VS2010, VS2012 and VS2013.
Could be a corrupt Solution User Options file.
Close the solution, delete its .suo (.v12.suo for VS2012+), reopen the solution, and Visual Studio will build a new one. You will lose the StartUp Project, breakpoints, bookmarks, which files are open, which projects/folders are expanded, etc. But that's all minor compared to the solution not building!
I had the same problem. I was trying to refrence a higher .net framework version(4.5.2) to lower .net framework version(4.5) which was causing build error. I made the version same in both projects and it worked.
Check the Output Window (View -> Output) as that will tell you what's going wrong. Sometimes a reference might be missing or there is an issue with the targeted version of .NET for one project in a solution.
Have you tried to clean the solution befor rebiuld it?
This is the list of checks & things I would do if I were you (try to build after each step):
Is error list activated? (Sometimes I forgot to activate and I can see only warnings & messages)
Check output window for error messages..
Clean solution.
Double check after clean that everything is deleted from debug folders.
Build it in release mode.
Build solution project to project until you isolate problematic project.
Remove COM and comment code to see if is this the source of problem.
Restart VS2010.
Restart windows.
Few moments ago I fix it with repair of .NET Framework installation (.NET Framework v4.0 Extended in my case).
I had the same issue in VS 2015. I tried the following with no success:
Close VS project and reopen
Close all open VS projects and reopen just the project that had the issue
Clean solution
Rebuild solution
Delete all files in bin\debug and bin\release
Lastly I tried Keith Robertson's answer, delete .suo (\Visual Studio 2015\Projects\[ProjectName]\.vs\[ProjectName]\v14\.suo). Although this didn't get me a good build, it did finally give me an error message stating that I had two entry points to my application. I went to application properties (Alt + Enter) and select a Startup object from the drop down.
This error seems a bit generic to me. I also went through this situation, but I managed to solve it differently than any of the ones mentioned here.
I have a project and several dependencies. And one of these dependencies has undergone a change.
When compiling the main project in debug mode, I verified that everything was ok.
However, switching to release mode and recompiling the problem occurred.Rebuild all failed and 0 Errors
By analyzing the debug output, I encountered an error:
Although the build dependencies are configured correctly. When compiling in release mode, the main project did not find the new method created in the secondary project.
So I had to recompile each secondary project one by one in release mode. After that, I recompiled the main project and everything worked.
Hope it helps someone!
I just had the same thing. For me, it helped to restart VS and run it as Administrator.
Select the appropriate target framework
- Right click on project
- Properties
- In application tab, Select the target framework
clean the solution
Try and build each project and see where the issue is.
Check each of the references (of each project) to make sure not have the yellow warning sign
Has the solution ever built?
I just had this happen to me, and realized that I left a '#error' line in my code and forgot about it. When I tried to build, the build failed but the #error line didn't show up in my errors.
Try searching all for '#error'
I fixed it on my new implementation of Visual Studio 2013 by going to the database project / Project Settings and noticing that the Target Platform was SQL Server 2014 instead of 2012 like it should be.
Once chance of getting this error is when we try re naming the service reference name, we give some other name in the service reference, but in the namespace some where it will be referring the old name, so if you delete and add a service reference then keep the same name, else we may face this error, but we can see the error in the Output window.
There are apparently many causes of this. I just found the cause of my issue: the .NET version of a new project I created was higher than the version of the top-level project. (4.5.2 vs 4.0)
I got a similar issue today, and fixed it with repair.
Start
Run…
Appwiz.cpl
(Find your installed Visual Studio version)
Right click
Change
Repair
In my case it was the wrong date and time of computer.
I was getting no feedback/messages/errors. Just that all projects failed to build.
I closed and tried again--I noticed an error saying "you are not authorized to access..."
I clicked on my account, re-entered my credentials, and rebuilt the solution.
Voila! I got what I am used to seeing when I build a solution -- plenty of errors in all their glory.
Hope this helps someone.
Here's yet another reason which may sound familiar to some. I had integrated some code into my solution that wrapped a DLL. The C# code file that came with it offered a nice managed API and handled the low-level LoadLibrary stuff to access the DLL. Both had the same base name, so I had SomeName.cs and SomeName.dll. I could just drop it into any project and it would work.
This wasn't so nice after a while as I started using it in different projects. I got copies of both the DLL and the wrapper code in multiple projects. So I figured it would be better to drop the wrapper code and the DLL into a new class library project and then reference that new project from other projects.
After I had done that, I started to get this issue. The build went well up until the very last stage and then failed without error. Output showed nothing but successes.
The problem was the name of the wrapping class library project. I used the same base name (SomeName) for this. By default the assembly name would be SomeName.dll and I already had one such file (the DLL to be wrapped), thus I had a conflict with output files.
After renaming the wrapping project and its output assembly to SomeNameWrapper, the problem went away.
This may not be your exact cause but it seems likely you have some name clash or deployment issue as well. And it is not surprising the compiler won't give you an error because there is no problem in the compilation phase, the trouble starts with deployment and apparently this does not come out in an obvious way.
I had the same problem the original poster was displaying with 0 errors and Rebuild all succeeded. The Output tab showed a message that a referenced dll was built with a higher version of the .NET Framework.
Changing the .NET framework to match resolved the issue I was having with 0 Errors and Rebuild All succeeded.
The solution:
Because Prerequisites not set for debug set only for release
01-Change solution configuration ( in main screen )
set (debug to release)
set solution platform to (Any CPU)
02-Set Prerequisites for debug ( If you want to continue in debug mode )
03-set target platform version for all Projects
Some of the files included in your solution are not in the correct directories, or you have changed the name of one or more directories in your application. In the solution explorer under Setup review the list of all files and remove those that are not properly listed in the SourcePath Property.
One of my dependency in View file caused this. Check your view files for any dependencies which is not injected yet.

Categories

Resources