Can't compile project after adding SFML.NET by Nuget - visual-studio-2012

After adding SFML.NET through Nuget Packge manager I got the following error:
Error 4 The "UnzipNuspec" task was not found. Check the following: 1.) The name of the
task in the project file is the same as the name of the task class. 2.) The task class is
"public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is
correctly declared with <UsingTask> in the project file, or in the *.tasks files located
in the "C:\Windows\Microsoft.NET\Framework\v4.0.30319" directory.
I'm using Visual Studio 2012.
As pointed out in other similar questions, I've tried to close and open MSVS, it didn't helped.
I also checked out the build tools path in the registry, and it points to right directory.
I tried to install and uninstall Nuget packeage.
I found out that error possibly somehow connected to it's dependency : Baseclass.Contrib.Nuget.Output, but I can't find out how to fix it.

It's a bug in their build script.
Go to the packages folder for your solution and locate the following file:
Baseclass.Contrib.Nuget.Output.1.0.6\build\net40\Baseclass.Contrib.Nuget.Output.targets
Around line 84 in that file you'll find a couple of <Using Namespace=... /> tags. Add this after those, before the <Code...> tag:
<Using Namespace="System.Threading" />
I've reported this on their github issues list as well.

Related

IIS web application "Build (web): Object reference not set to an instance of an object."

I inherited an old web application built using IIS, and I'm trying to figure out how to build it. I'm running into this Build (web): Object reference not set to an instance of an object. error during build time. Aren't null object references supposed to be runtime errors, not compile errors? Can anyone explain to me what's happening here and how to fix it?
Have you downloaded the packages your projects reference? And do the assemblies in your bin folder match up with your web.config (check version numbers too)?
Edit: If the packages in the bin folder don't match, you can redownload them with NUGET -
note which packages are out of sync - grab their id values from the package nodes in the web.config
Inside your VS solution, check each project's references to see where the missing packages are referenced
Inside your VS solution, go to: Tools > NuGet Package Manager > Package Manager Console
for each missing package run the following command in the Package Manager Console:
Update-Package -Id <package_name> –reinstall
where <package_name> == the id value you captured from the web.config at step 1.

dotnet core 2.0 ProjectReference error

When using dotnet core 2.0-preview1 in vs2017. I got an error about project reference.
I hava a solution with two projects.
This is Common.Bll Project
The Common.Web referenced the project Common.Bll. But the ide told me cannot find Common.Bll with error Using directive is not required by the code and can be safely removed. Cannot resolve symbol 'Bll'
This is Common.Web project
Common.Bll.csproj
Common.Web.csproj
But it can be build succeed and run normally.
Have any way to solve this?
update:
It's working follow the #Svek to change the Common.Bll from netstandard2.0 to netcoreapp2.0.
Your csproj file
Visual Studio doesn't like to behave quite right when the TargetFramework does not totally match up.
Common.Bll.csproj
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
Common.Web.csproj
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
Make both of them the same, and you should be good to go.
the error:
cannot resolve symbol '< >'
The simple solution is to reinstall all your packages, and make sure all your dependencies are properly showing up in Visual Studio under each project. (Dependencies --> Projects | or | Dependencies --> Assemblies).
In Package Manager
Update-Package -reinstall
More details can be found here to reinstall your packages.
Reference to an unused library
- Update: You can ignore this. Your updated question makes this section no longer apply. -
Until you are actually using a library, Visual Studio will inform you that the referenced library is not required.
using directive is not required by the code and can be safely removed.
You can do one of two things:
1.) Use the library that you are referencing
In your case:
var obj = new Common.Bll.<Your Class>;
2.) Remove library that you are referencing
This can be done quickly by right-clicking and selecting Remove Unused Usings.
The alternative is to use the keyboard shortcut Ctrl+R, Ctrl+G.

TeamCity WindowsAzure.targets causing errors in deployment

We are currently trying to setup an Angular 2 project that also contains a Cloud Service project in its solution. We have set up numerous Angular 1 projects containing Cloud Service projects and have had no errors. When trying to run the MSBuild step for the Angular 2 project, we get the following error on the TeamCity build server:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Windows Azure Tools\2.7\Microsoft.WindowsAzure.targets(2787, 5): error MSB3021: Unable to copy file "C:\TeamCityBuildAgent\temp\buildTmp\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs" to "C:\SourceControlFolder\Apps\MyApp\MyApp.CloudDeployment\obj\Debug\Website\C:\TeamCityBuildAgent\temp\buildTmp\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs". The given path's format is not supported.
The main problem seems to be the build attempting to throw the full C:\TeamCityBuildAgent.. path into the obj\Debug\Website folder.
My current MSBuild parameters are:
/p:Configuration="Dev"
/p:platform="Any CPU"
/p:OctoPackEnforceAddingFiles=true
/p:OctoPackProjectName=MyApp_Dev
I've tried the following solutions:
Making sure the latest Visual Studio Update is installed (for MSBuild)
Running the install tool to repair Azure Tools 2.7 on the build server.
Changing the debug configuration in the build.
Ensuring TypeScript 1.7.6 is installed on the build server (even though it's an Azure.targets issue) [https://github.com/Microsoft/TypeScript/issues/6215]
Updated the project to Azure Tools 2.9. The same error remains except it's failing on the 2.9 folder instead now.
Curious if anyone else has experienced this error and knows a fix. I'll keep this post updated as I try other solutions.
Update
It appears that what is causing this issue is this line within the .csproj file:
<FilesToIncludeForPublish>AllFilesInProjectFolder</FilesToIncludeForPublish>
This is specified for our build configurations to copy all files generated by the ng build to the output directory of the publish. What I don't understand at the moment is how this works on all of the devs' local machines but does not work on our build server. Will keep this posted as I find more info or any kind of workaround.
This ended up being the fix:
Instead of targeting the .sln in MSBuild, we specifically targeted the .csproj file. This fixed the build errors and allowed us to keep the FilesToIncludeForPublish tag inside.

The target "PipelineTransformPhase" does not exist in the project

I'm trying to create an azure package via tfs build server.
my project is an Azure MVC web api project. when i trigger a build I get the error "The target "PipelineTransformPhase" does not exist in the project."
But I've added the Microsoft.WebApplication.targets file to the appropriate folder in my build server.
this is the line mentioned in my csproj file
Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' == ''" />
even without condition I get the same error.
could someone help to resolve this issue .
many thanks in advance
First, read these SO posts, they might have your answer:
Package / Publish error on Azure
MSBuild target package not found
Is it possible that the .targets file was never found? (If you're on a machine without Visual Studio it won't be there). That would produce an error somewhat like:
The imported project
"...\WebApplications\Microsoft.WebApplication.targets" was not found.
Confirm that the path in the <Import> declaration is correct, and that
the file exists on disk.
I'll assume that isn't the problem. I would run the build with logging enabled and look at where your targets are coming from (or not coming from in this case). It might add some light to your problem. You can use the /fl switch something like my example below to get a detailed (not diagnostic -- which you could do) log from a build:
msbuild /fl /flp:logfile=<yourpath>\yourLog.log;verbosity=detailed
The lines you should be most interested in are around targets. Lines like
Target "Clean" in file "..." from project "..." (entry point): and
Overriding target "Clean" in project "..." with target "Clean" from project "..."

Unable to execute dex: Multiple dex files define Lcom/actionbarsherlock/R$attr;

i use ActionBarLibrary in a library, that I use in a my app
i got this message when i try to compil
[2013-01-28 16:09:46 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/actionbarsherlock/R$attr;
[2013-01-28 16:09:46 - comfree] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/actionbarsherlock/R$attr;
As asked here, I was facing the exact same error yesterday. I pinpointed the cause of the error to /bin/classes. If I deleted the /classes dir before running the app, the app would compile and run. Of course, when I tried to actually export the app, the /classes dir would come back and along with it the error.
The solution to my problem was to install the latest version of Eclipse. You will then need to install the latest version of the ADT but all the Android versions you have downloaded earlier for the other Eclipse installation will be detected and used for this one as well. When I export or run the app through Eclipse, the /classes folder does not appear now.
right click on project to go project property>>java Build path>>choose Order and Export and then Unselect all except android4.0 or what every you have then clean and build your project ,now error not come again..
The solution to my problem was that I deleted the jar files which I copy pasted in project's lib folder. I explicitly imported external jars in build path

Resources