Nunit.framework dll from the package doesnt get copied to bin folder - msbuild

I'm currently running .net framework 4.6 and added the NUnit, NUnit3TestAdapter nuget package to the test project that i am working on and I see that the test's are not being discovered.
Upon some investigtion, I see that nunit.framework.dll is not being copied to the bin folder. Did some more research and I see the following in the assets.json file, and Nunit's build/NUnit.props file which is supposed to have the MSBuild settings is empty and does not have any.
"NUnit/3.13.3": {
"type": "package",
"compile": {
"lib/net45/nunit.framework.dll": {}
},
"runtime": {
"lib/net45/nunit.framework.dll": {}
},
"build": {
"build/NUnit.props": {}
}
},
However Nbuild/Unit3TestAdapter.props file which is installed from the official Nunit has the MSBuild settings. Is there a reason why build/NUnit.props does not have the build setting where as build/Unit3TestAdapter.props has these?
Also, Is there a work-around to get these copied to local or should I add the reference's manually than getting these from the package?

Related

How to set working directory in CMake Visual Studio 2022?

I have a problem with setting the working directory with CMake (Visual Studio 2022).
I'm currently working on a project (some OpenGL learning stuff) and decided to switch from typical VS solution-project to CMake project. I need to load some files (.obj, shaders) from Resources folder (LearnOpenGL/Resources) but I see that paths in c++ code are relative to LearnOpenGL/out/build/x64-Debug/.
I've already tried :
setting property VS_DEBUGGER_WORKING_DIRECTORY like (also without trailing slash):
set_property(TARGET LearnOpenGL PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/")
adding "currentDir" or "cwd" to CMakeSettings.json like:
"currentDir": "${projectDir}"
"cwd": "${projectDir}"
but there is no effect of any of those changes. Does anyone have some ideas what else can I do? Or maybe I'm doing here something wrong?
You can add currentDir property to your launch.vs.json which will typically be in ${workspaceRoot}/.vs directory.
To access it from Visual Studio 2022 CMake project you can follow these steps:
In the solution explorer click on Switch between solutions and available views button:
Then click on CMake Targets View
Now right click on your project and press Add Debug Configuration in context menu
This will open launch.vs.json file where you can edit currentDir property, for example - my project 02_texture.exe should start in root directory so my launch config looks like this:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "",
"name": "CMakeLists.txt"
},
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "02_texture.exe (02_texture\\02_texture.exe)",
"name": "02_texture.exe (02_texture\\02_texture.exe)",
"currentDir": "${workspaceRoot}"
}
]
}

Gulp task to web deploy from Visual Studio

I have not found a concrete example on how to do the publishing via a Gulp Task. Anyone has an idea?
This is how i'm trying at the moment.
gulp.task("Deploy-To-Azure", function() {
var targets = ["Build"];
console.log("Publishing to Azure");
return gulp.src(["./src/Feature/Accounts/code"])
.pipe(foreach(function (stream, file) {
return stream
.pipe(debug({ title: "Building project:" }))
.pipe(msbuild({
targets: targets,
configuration: "Azure",
logCommand: false,
verbosity: "verbose",
stdout: true,
errorOnFail: true,
maxcpucount: 0,
toolsVersion: 14.0,
properties: {
DeployOnBuild: "true",
DeployDefaultTarget: "Web Deploy",
WebPublishMethod: "FileSystem",
DeleteExistingFiles: "false",
_FindDependencies: "false",
Configuration: "Release"
}
}))
.pipe(debug({title: "Finished building project"}));
}));
});
But it looks like the project is built but not deployed. I think my properties are not complete. Any ideas are appreciated. Thank you
I attempted to use those same MSBuild properties from the commandline and received the following error:
>c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild /p:DeployOnBuild=true /p:WebPub
lishMethod=FileSystem /p:DeleteExistingFiles=false /p:DeployDefaultTarget="Web Deploy"
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.P
ublishing.targets(4449,11): error MSB4057: The target "Web Deploy" does not exi
st in the project. [c:\users\me\documents\visual studio 2015\projects\w
ebapplication12\WebApplication12.csproj]
Unless you've created a custom MSBuild Target named "Web Deploy". This won't work.
When I remove the /p:DeployDefaultTarget="Web Deploy" property a WebDeploy package is created in the /obj/[configuration]/Package folder.
Try DeployDefaultTarget: "WebPublish"

ASP.NET Core (vNext) project can't find reference to 4.51

I have a asp.net 5 (vNext) project with a project.json that is named FMS.DOMAIN. One of the references is a dotNet 4.51 project named FMS.DAL.
This works on all machine except one. On one machine it can't find this dotNet 4.51 project. I think it is looking for it on a public nuget server.
When I do 'dnu restore' I see this:
C:_Workspaces\MyProject\MyProject\FMS.Domain\project.json
CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='FMS.DAL'
Unable to locate Dependency FMS.DAL >= 1.0.
This is the project.json from FMS.Domain.
{
"version": "1.0.0-*",
"description": "FMS.Domain Class Library",
"authors": [ "ctcrrmcidmc" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"dnx451": {
"dependencies": {
"FMS.DAL": "1.0.0-*"
}
}
},
"dependencies": {
"AutoMapper": "4.1.1",
"FMS.Common": "1.0.0-*"
}
}
How does it know when to search nugget and when to use a local project? The reference to "FMS.Common": "1.0.0-*" is also a local project and it's working (but it's vNext).
We did get it to work if we had a reference to the DLL directly using the 'Add Reference' context menu. That produce an edit the project.json that look the same as the manual edit but it works. It must be doing something else.
More Info:
I blew away my workspace and got the code fresh from TFS. I am getting the problem on my machine. I see this error with 'dnu restore':
CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='FMS.DAL'
nable to locate Dependency FMS.DAL >= 1.0.0
It is looking for FMS.DAL at nuget.org instead of in my project. I removed the dependency from project.json and saved, then I add it back by right-clicking on references and picking a project reference. It's added back to project.json and looks exactly the same as before I removed it. I run 'dnu restore' again and it works.
The only pending change is in project.json and when I do a compare with TFS there are no differences. Then I did an undo pending changes for the entire solution and 'dnu restore' still works.

How to add a non-Amber library with bower? (for example processing js)

I have started a project with amber init and then bower install processing --save to get processing.js added.
I do the initialisation with
firstProcessingInstance
<return Processing.instances[0]>
This method is called by the instance method initializeand it worked a pre-Amber v0.13 version.
How do I initialize Processing.js in Amber 0.13 and 0.14?
The code of the example is here
Addition after answer by Herby
In version 0.13 and 0.14 a configuration file processing.amd.json has to be added manually to the root directory. Files libraryname.amd.json in the root directory of the project are needed if the library does not have a local.amd.json file in the library directory.
Examples for libraryname.amd.json files from Amber Smalltalk and Helios are
project amber; file jquery.amd.json
{
"paths": {
"jquery": ["dist/jquery", "jquery"]
}
}
project amber; file es5-shim.amd.json
{
"paths": {
"amber_lib/es5-shim": "."
}
}
project helios; file showdown.amd.json
{
"paths": {
"helios/showdown": "src/showdown"
}
}
project: https://github.com/hhzl/Amber-snapsvg-demo
file: snap.svg.amd.json
{
"paths": {
"snap.svg" : "dist/snap.svg"
}
}
References
Amber may be a project and a library
Lego bricks illustration
Question
What is wrong with this processing.amd.json library mapping file?
{
"paths": {
"processing" : "processing"
}
}
Note After a change in processing.amd.json run grunt devel
Adding external non-Amber library to the project involves more steps than just bower install. You must create libdir.amd.json in root of the project with mapping the library file to the symbolic name. Then, you should add the symbolic name into either deploy.js or devel.js (depending on the context in which it is used), outside the place intended for amber packages (that is, not between the two delimiter comments).
EDIT: There is nothing wrong with the cited processing.amd.json, it's right and correct. With this, "processing" module name is mapped to .../processing/processing (.js is omitted from AMD mapping by design). After all, see your config.js to check the mapping is correct. If you have problems loading processing.js, it is outside this domain (.amd.json and Amber's mappings).

How do I add a reference to a mono assembly in asp.net vNext

So I've installed Asp.net vNext onto my Linux box and have been playing around with it. I have everything set up and can build and run mvc applications. I'm building a console application and need to reference an assembly that doesn't exist in NuGet. I want to add a reference to Mono.Data.SqliteClient to my project.json. I know the path to the assembly /usr/local/lib/mono/4.5/Mono.Data.Sqlite.dll.
How do I add the reference to the dll? My project.json file currently looks like this:
{
"dependencies": {
"System.Console": "4.0.0.0",
"Dapper":"1.27",
"Mono.Data.Sqlite":""
},
"configurations": {
"net45": {},
"k10": {}
}
}
I found the answer on a forum...
In a nutshell, you can only reference your dlls if they are inside a nuget package... ( I hope this will be improved. It is a hassle IMO. )
The long story :
Ok, after a lot of fannying about, it seems that the way to do this is to create a nuget package using the DLL (i'll use Quartz version 2.2.4.400 as an example).
use http://docs.nuget.org/docs/creating-packages/using-a-gui-to-build-packages to build it. Drag and drop Quartz.dll into the right hand side (nb. it does need to be placed in the lib directory). File -> save as... save it in the following location:
projectRoot\packages\Quartz.2.2.4.400\Quartz.2.2.4.400.nupkg
With the dll in the following:
projectRoot\packages\Quartz.2.2.4.400\lib\Quartz.dll
nb. placing the DLL outside of the lib directory will compile alright, but won't work with intellisense. If you are compiling with a specific version, then i'd put it in a net45, net451 or k10 folder; as i'm not, I didn't bother. my project.json then looks like:
{
"dependencies": {
"Quartz" : "2.2.4.400"
},
"configurations" : {
"k10" : {
"dependencies": {
"System.Console": "4.0.0.0"
}
}
}
}