DLL should not be visible in VS solution explorer - solution-explorer

I noticed that some dlls I included as content in my csproj appear at the root of the project in Visual studio in the solution explorer. Not only there, but also under all projects that referer to this project. Is there any way to make them invisible ?
<ItemGroup>
<Content Include="librdkafka\x64\librdkafka.dll" Visible="false">
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>

Related

NuGet package failing to deploy the actually dll.deploy to IIS

Having an issue getting a dependency to deploy w/ a VB.NET WinForms app. The app runs, but errors when the DLL is referenced/used.. The DLL is not inside the user's install directory upon inspection.
I installed a new NuGet package (first NuGet in this solution) and it works great. I've implemented it, tested locally. Looking at the bin folder (this is in debug), I see the DLLs are all there.. great.
I can publish the application w/ ClickOnce with "No Issues". I am deploying to IIS 8.0 w/ a Web Share. The DLL isn't there though on the web server, either.
The "Application Files..." menu under "Publish" has all CefSharp references as "include", "required", "include" across all cols. This forces ClickOnce to include them as resources right?
Under references in Visual Studio, they're all set to Copy Local = True.
However... when I change Copy Local nothing changes in my GIT history/change history!! Visual Studio sees and recognizes the .vbproj was modified, however there weren't any visible (unicode?) changes. I can commit.
I am on the latest version of Visual Studio, VS2019 16.8.2 for Blazor/ASP.NET Core reasons. Should I try downgrading?
I added a Chromium wrapper based control to replace the generic IE7 Web Control in .NET Framework. I'm working in an .NET 4.6 app. x86.
CefSharp GIT Repo.
https://github.com/cefsharp/cefsharp
I'm using the CefSharp.Common and CefSharp.WinForms namespaces in my application.
Warnings saying unable to publish properties for the DLLS.
Edit: Possible Duplicate: Unable to apply publish properties for item X
Edit2:
Here is an excerpt from my .vbproj
<ItemGroup>
<PublishFile Include="CefSharp">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="CefSharp.Core">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="CefSharp.WinForms">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="FlexCell">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CefSharp.Common">
<Version>86.0.241</Version>
</PackageReference>
<PackageReference Include="CefSharp.WinForms">
<Version>86.0.241</Version>
</PackageReference>
</ItemGroup>
SOLVED BY: Edit: This didn't fully solve my issue alone but was a hack attempt to bring in all resources, manually, and it worked.
Edit 3: OK None of these solutions worked including downgrading to 16.4 lol that was fun. Please install your required CefLibrary.WinForms etc libraries..
Then build the project.. it needs to actually build.
This generates .dlls in your \bin directory in your file system.
Edit 4: Gave up. Visual Studio 16.8.2 and 16.8.1 are both just outright broken. You can do down the rabbit hole (this is December 2020) but it looks like the visual studio team
https://github.com/dotnet/roslyn/issues/48679
is having issues with references right now. (that one feature that's been the same for 20 years) They don't even have an eta - after they broke a crucial feature - in a enterprise/production product. This wasn't a preview lol. How did this pass unit testing :D
For my use case of CefSharp I needed to load a PDF. I am not directly using an Adobe ActiveX control instead.
Take a look at this request https://github.com/cefsharp/CefSharp/issues/3274
This was very very recent (nov 2020) and he "fixed" it
Move these out to a better place, maybe a "references" folder then actually reference them manually through VS2019 like you would any other .dll.
I'm assuming this is a bug and not the intended workflow since it wasted almost 10 hours of rabbit hole googling nearly. <-- This was in fact a bug.
Solution: There is none. Evidently. On the latest version of everything as of Dec 2nd 2020 - stable and all - your own CefSharp implementation will be broken even when properly setting up to spec of other examples if compiling w/ 16.8.1 or 16.8.2 (but it doesn't seen to be working with 16.6.2 either)
https://github.com/cefsharp/CefSharp/issues/3274

Visual Studio VB Project config transforms not displaying

Want to use the app.config transforms and make it obvious in a VB project.
The transform app.config files are created in the VB project. The transforms do get made. However I'm unable to have App.Debug.config and App.Release.config display in the solution explorer.
I've tried 'add existing' to the App.Debug.config, and it will not show in the VB project.
I've also tried editing the vb project, change the case 'app.config' to 'App.config' and it made no difference in the display:
<ItemGroup>
<Content Include="App.config" />
<Content Include="App.Debug.config">
<DependentUpon>App.config</DependentUpon>
</Content>
<Content Include="App.Release.config">
<DependentUpon>App.config</DependentUpon>
</Content>
</ItemGroup>
How can I get a vb project to display the .configs in a similar manner as c# project?
Well! It turn out in the solution explorer if one clicks 'show all files' the app.Debug.config and app.Release.config will appear in the VB project.

MSBuild output missing javascript files compiled by Typescript

We use MSBuild on our CI server to compile our WebApp, however the build omits the JavaScript files built by TypeScript from the output of the build.
I would expect the output to contain the JavaScript and not the Typescript, however neither are in the output at the expected locations.
How can I include the JavaScript files without having to have them all in my solution? The TypeScript team seems to think this is bad, but I would rather not have duplicates of all the files in my solution either.
The problem was due to using MSBuild instead of the "Publish" on the build server it seems. I added an AfterBuild target to content include all of the JS files to the build output.
<Target Name="AfterBuild">
<ItemGroup>
<Content Include="**\*.js" />
</ItemGroup>
</Target>
Although this is not ideal, it allows the js files not to show in the solution when using visual studio and the files end up in the build output.
I tried many solutions from the web including the <Content Include="**\*.js" />, but nothing worked. I'm using MSBuild on my local dev box and typescript is installed and targets available in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript.
It turns out my "old" MSBuild runner for web app csproj files is obsolete. I was doing this:
MSBuild.exe my.csproj /Target:ResolveReferences;_CopyWebApplication /property:WebProjectOutputDir=myfolder;OutDir=myfolder\bin;Configuration=Debug
but thanks to this post I need to use UseWPP_CopyWebApplication instead of the legacy _CopyWebApplication:
MSBuild.exe /t:Rebuild "/p:WebProjectOutputDir=myfolder;OutDir=myfolder\bin;Configuration=Debug;UseWPP_CopyWebApplication=True;PipelineDependsOnBuild=False" my.csproj
Now without any editing of the csproj file, all my TypeScript is included!
TypeScript is probably not installed on your build server. To install it, copy your TypeScript folder from c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\ to the same folder on your build server (where v12 is the version of your Visual Studio).
The Visual Studio version on your build server can be different however. In my situation, the version on my development machine is v12, while the build server uses v11. I found that out by adding the following to the [WebProjectName].csproj file:
<Target Name="PrintVisualStudioInfo">
<Message Text="VisualStudioVersion: '$(VisualStudioVersion)'" Importance="High" />
</Target>
<PropertyGroup>
<CompileDependsOn>
PrintVisualStudioInfo;
$(CompileDependsOn)
</CompileDependsOn>
</PropertyGroup>
Be sure you put it after the last <Import /> element. Now when you look at the output of your build on the build server, you should see 'VisualStudioVersion: xx' somewhere.
Copy the TypeScript folder to the correct version folder on the build server.
Just adding in case it helps people.
We had this issue recently and it was fixed by adding
/p:VisualStudioVersion=12.0 to the BAT file :
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe FullBuild.proj /p:VisualStudioVersion=12.0 /t:createRelease /p:ReleaseNumber=5.22.0

How to exclude some stylecop rule in visual studio 2013

I'm using visual studio 2013.
I install stylecop using NuGet Package follow these steps:
https://www.nuget.org/packages/StyleCop.MSBuild/
Previously when I using visual studio 2010, I usually put my custom rules set called Setting.StyleCop file to my solution or project.
How should I implement my custom rules set in VS 2013?
Settings.StyleCop still works as it did previously.
The StyleCop.MsBuild package performs a couple of actions:
1. Stores an instance of StyleCop.exe in the packages directory, this makes it portable between machines, build servers etc.. Namely \packages\StyleCop.MSBuild.4.7.49.1\tools this is pretty much the same you would get with installing it, but its not in program files.
2. Makes changes to the csproj, namely:
<Import Project="..\..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets'))" />
</Target>
All this basically does is point at the targets file so that it runs stylecop and adds in some requires for the package to be there before building.
What you need to do to use StyleCop.Settings
Copy it into the root of your solution, or the project file, then it should get picked up as usual. The easiest way is just to copy it from \packages\StyleCop.MSBuild.4.7.49.1\tools

Putting solution build output in a different directory !

I have an issue in building my solution (Hardcopy.sln) .This solution consists of many other modules & each module is directing their output to the bin/debug/ folder. during the whole solution build . i want to redirect the output of each module to a different location .how to do the same. i am using the MSbuild utility to build the solution in my nant scripts .
i want to do it using Msbuild utility in the Nant is there any way out:
Thanks
Rajesh
Using MSBuild Nant task :
<msbuild project="Hardcopy.sln">
<property name="Platform" value="Any Cpu" />
<property name="Configuration" value="Debug" />
<property name="OutputPath" value="DIFFERENT_DIRECTORY_PATH" />
</msbuild>
Using msbuild directly :
msbuild Hardcopy.sln /p:Platform="Any Cpu";Configuration=Debug;OutputPath=DIFFERENT_DIRECTORY_PATH
Modifying the OutputPath property in projects file. Manually or with Visual Studio project properties.
Not sure if you're looking to have only a specific build done with MsBuild to be directed to the folder, or for all builds (including Visual Studio) to go to the build folder. This assumes you want all builds to go to a different folder.
In Visual Studio, goto the project properties screen (right click on any revelant projects and choose properties from context menu). In the new windows goto the build tab and under there are output settings. You can specify a path to build to here (you can also utilize relative paths here). You would need to do this for any relevant build configuration - such as for debug and release - you can switch between these through the Configuration combobox on that screen.
This will cause Visual Studio and MsBuild to direct the build output to the folder specified