dll not adding to References for a web-site project in VS2022 - web

for a website project(NOT web application project), all dll's which exist in the bin folder are a part of the property-pages-references folder, in VS2019. thus compile successfully.
when tried to open the same project in VS2022, one of the main dll's, though present in the bin folder, does not show up in property-pages-references folder.
thus the project does not compile.
when tried to add the dll in property-pages-references folder, it does not add, but a .refresh file for the same gets added to the bin folder.

Related

How to use npm packages with ASP.NET CORE 2 in Visual Studio 2017?

I added some npm packages to my ASP.NET Core 2 project in Visual Studio 2017. Now I want to use css and js files from these packages, but VS doesn't see them because node_modules folder is outside wwwroot. What is the common practice here, how to make Visual Studio working with node_modules?
As soon as you add the desired npm packages to your project, either through:
npm install command
or
typing the package name and its version in the npm configuration file
or
searching the package in the Library Dialog, indicated in the following image for instance,
they will be downloaded and restored in the node_modules folder. But to use them in your views, you need to add them to a client-side folder, such as lib under wwwroot folder.
You can copy them to wwwroot folder manually through the file system, or use the Library dialog:
right click on the lib directory inside wwwroot
Click Add, and choose Client-Side Library
From the provider, choose fileSystem (if desired files already exist in node_modules folder)
Choose all or specific files needed
Click install
However, you can manage this file copying operation manually.
Now, from the folders under wwwroot, you can drag and drop the file into your views. Be careful to omit ~ if your view is a Layout.
Hope this helped....
More details here: https://learn.microsoft.com/en-us/aspnet/core/client-side/libman/libman-vs?view=aspnetcore-3.0
The common practice is to bundle your web assets, and put only the compiled bundle into your wwwroot folder.
Since Visual Studio 2015 we have multiple Taskrunners from the NPM World:
Gulp
Grunt
With them you could write a script, which automatically bundles your web assets. This script has full access to the NPM infrastructure.
There are some tools out there which make this super easy:
gulp-uglify
gulp-cssmin
More Information:
https://learn.microsoft.com/en-us/aspnet/core/client-side/using-gulp
That said, it is also possible to include your npm folder:
public void Configure(IApplicationBuilder app)
{
app.UseStaticFiles(); // For the wwwroot folder
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), "node_modules")),
RequestPath = "/node_modules"
});
}
But this would be the wrong way.

How can I check `bin/` directories under `node_modules/` into TFS?

I have a Team Foundation Build server behind a firewall, and I would like to check in a node_modules/ directory (powering both a Browserify client app and Node server app) associated with a project so that all of the files and dependencies needed to deploy a build are available without fetching anything.
Checking node_modules/ in to TFS seemed to work at first, except that the bin/ directories appearing in around 20 of my NPM dependencies were not checked in. bin/ does not appear in my .tfignore (or anywhere else I know of that could be preventing the check in).
These bin/ directories don't appear in the included/excluded changes in Team Explorer, at all. It's possible to locate one of these folders in Windows Explorer and add it with the TFS context menu, but doing that for all of the dependencies would be horrifically tedious and error prone.
How can I persuade TFS to detect changes in these folders? Is there some other configuration affecting included/excluded changes that I'm not aware of?
It is not recommended to upload "bin" folder or "node_modules" folder into Version Control. But if you do want to do this, following the steps below:
Go to "C:\Users\youraccount\AppData\Local\Microsoft\Team Foundation\x.0\Configuration\VersionControl" folder and open "LocalItemExclusions.config" file. (There may several folders named like 1.0, 2.0, 3.0, you need to make sure open the folder your VS current use.)
Delete the lines like following and save the file:
<Exclusion>bin</Exclusion>
<Exclusion>*.dll</Exclusion>
Close Visual Studio.
Delete "node_modules" folder.
Restart Visual Studio.
Run "npm install" command to reinstall the node modules.
Check "Pending Changes", files in "bin" folder should be listed in "Excluded Changes" section.
To check if the files and bin folders will get ignored by TFS. You could try to manually add them (such as drag to source control explorer). If you couldn't, then must related to some .tfignore settings , you may double check this such as if there is a .tfignore file in the root of the project folder level.
If you could, there maybe something wrong with your workspace or source control mapping of the bin folder. Try to remove the source control bindings and rebinding to TFS. Also give a try with delete the old workspace and use a new workspace.
You shouldn't check in node_modules - ever.
Rather use browserify or WebPack (I'd recommend WebPack) to package up your bundle.js.
Add the bundle.js to your source/scripts folder. Reference your bundle.js from your html instead of any <../node_modules/../scripts>.
Remove the npm install from your build script. you won't need it now due to referencing your bundle.js
WebPack is a dev-step, but it secures the version of packages you used during development and also saves you the npm install headache during deployment.

Cross-Project References in Visual Studio 2015

I am trying to reference a dll project from another project, and am encountering a few difficulties. I have done the following:
Added both projects to a solution
Within my executable project, I add the dll project as a reference.
I add the include directory under Properties --> C/C++ --> Additional Include directories.
I thought this was sufficient - I don't get any errors, my intellisense is detecting the dll project and everything compiles. But when I run, I get the following system error messagebox:
The program can't start because xxx.dll is missing from your computer.
Try reinstalling the program to fix this problem.
So I have tried adding the directory where the dll and lib files are built to to Reference Directories and Library Directories under VC++ Directories in the properties, but still get the same error.

Android studio configuration with Gradle

I am having an issue to configure Android studio after importing gradle project. My project structures is as following:
Root Project
|_.config
|_settings.gradle
|_build.gradle
|_app_module
|_lib1_module
|_lib2_module
|_ etc.
Please note, that for several reasons I am not able to move settings.gradle and build.gradle files to project root . Also, the files mentioned above are configured correctly, so there is no problem with the build.
So the problem is that once the project in imported, the all gradle related file and folders are are generated inside .config folder, which doesn't disturd me.
Also the .idea folder and all relevant sub-folders are generated in this very folder.
So this is the problem. For some reason, the studio doesn't recognize all sub-modules are under source control. I.e. it's vcs.xml is empty and contains only project root. Actually the problem is resolved by adding the modules via settings--> subversion menu, but I'd really like out-of-the-box solution. I've tried to put .idea folder under source-control - doesn't help. Upon project creation, the vcs.xml is re-written and empty again.
So, the main question is:
Is there a possibility to
Force studio to generate .idea folder and the root project folder without changing location of .gradle files OR
Make studio NOT to re-write it's settings files upon project import (e.g. keep predefined vcs.xml)
PS. I'm aware the putting all generated files (including gradle folder, gradlew, etc.) will probably solve the issue, but I wouldn't like to go so far.
Thank all in advance
It should be a comment, but it is too long.
Android Studio works with a project.
Inside this project you can configure more modules but it need this structure:
Root Project
|_.idea
|_.gradle
|_.config
|_build.gradle
|_app_module
|_build.gradle
|_lib1_module
|_build.gradle
|_lib2_module
|_build.gradle
|_ etc.
|_settings.gradle
|_build.gradle
Inside the settings.gradle you have to define all modules:
include ':config' , ':app_module' , ':lib1_module', ':lib2_module'
Under the root folder, Android Studio when builds the project with gradle, makes same folders, like the .idea.
I read that your are not able to move the settings.gradle file.
In this case Android Studio recognizes the config folder as the root of a project and build the .idea folder inside.
|_.config (root)
|_.idea
|_.gradle
|_build.gradle
|_settings.gradle
|_myModule
Force studio to generate .idea folder and the root project folder without changing location of .gradle files OR
As I know you can't avoid this.
Also ,
Make studio NOT to re-write it's settings files upon project import
The .idea, the .gradle folder, the .iml files are built locally by the IDE when the project is built. The IDE re-writes these resources, also these files contain local paths and usually they are not commited in VCS for this reason.

Android Studio icons meaning

I am trying to add flavors to my project in the gradle file, but can't because my src folder is not just a folder, and I can't make another folder within it. I can only create packages. Can you explain to me why this is happening? I tried to recreate this folder many times, but I had no success.
Java folder comes automatically after selection of build variant from package:
production.java.com.bigblueclip.picstitch

Resources