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.
Related
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>
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
Yesterday I did the update to VS (15.3), .NET Standard 2.0, .NET Core SDK 2.0 and so on. After that my current Xamarin Forms project broke. Most packages lost compatibility (although I did not change the standard1.4 version of the library). So I created a new standard1.4 library through VS (as stated here: https://xamarinhelp.com/visual-studio-2017-net-standard-xamarin/). I copied the code from the old Xamarin library to the new one and added all packages.
The problem now is that all xaml and xaml.cs are splitted and I get compile errors. I cant connect the files as I was used to (How can I connect xaml and xaml.cs files), because the csproj has completely changed through the evolution of netstandard. Whats even more astonishing is that even when I add a new xaml page to the project, the xaml and xaml.cs files are splitted. How can I fix this behavior?
Found the solution, through my post on the Microsoft Developer Network (https://developercommunity.visualstudio.com/content/problem/96027/vs-153-netstandard-xaml-and-xamlcs-seperated-and-c.html)
Credit to Long Nguyen (see source):
Fixed it by following this article:
https://oren.codes/2017/04/23/using-xamarin-forms-with-net-standard-vs-2017-edition/
In the .csproj file, you can see he declare the .xaml pages:
<ItemGroup>
<!-- https://bugzilla.xamarin.com/show_bug.cgi?id=55591 -->
<None Remove="***.xaml" />
<Compile Update="***.xaml.cs" DependentUpon="%(Filename)" />
<EmbeddedResource Include="***.xaml" SubType="Designer" Generator="MSBuild:UpdateDesignTimeXaml" />
</ItemGroup>
After doing the changes to the csproj, it should pick up the xaml and xaml.cs files again.
I have custom MSBuild Tasks to execute after the : AfterBuild event for each project in a solution.
I don't want to modify each Project file as:
Visual Studio wipes out all the Custom Changes done to the project file once i modify the project in Visual Studio (VS 2012 Ultimate), say add or remove a file/reference.
I don't want to use "CustomAfterMicrosoftCommonTargets" as mentioned here as there is no way to pass this command line argument while building from Visual Studio :
msbuild.exe app.proj /property:CustomAfterMicrosoftCommonTargets=custom.target
I found a solution here, but I didn't quite get it.
Can anybody please elaborate on it or help me figure out a better solution?
Update 5/12/2014:
I figured out that Visual Studio doesn't wipe out the custom changes if I am running the Visual Studio in the Administrator mode.
I can now think of having a Custom import file that has got the required overrides, but still I have to do this for each project in the solution. If somebody adds a new project, they have to remember to add this customization. I don't like this, but probably I can live with for now.
I tried to use the "CustomAfterMicrosoftCommonTargets" approach, but I was not able to set this property from the Pre-build event of Visual Studio, even running as Administrator didn't help.
I was trying to set an environment variable with same name from the Pre-Build event, but I never got the new value while MSBuild executes.
Thanks!
Finally I found an option where in I don't have to edit the individual project file.
The idea is to invoke your custom common targets file in the "AfterBuild" event that Visual Studio exposes.
IF "$(BuildingInsideVisualStudio)"=="true" (
$(MSBuildBinPath)\msbuild.exe "$(ProjectDir)CustomMSBuild.targets" /p:Configuration="$(Configuration)"/property:"ProjectUnderCompilation=$(MSBuildThisFileDirectory)$(MSBuildThisFile)"
)
So I am passing the project under compilation as a property and import that project file.
If I throw an exception in the custom task, it appears as as Compilation error on the parent project.
This worked amazingly and I am able to perform any validations on the project that was passed.
The only downside I see is that I am spawning another MSBuild.exe and I don't see any impact of that in the compilation time as of now.
Please let me know your thoughts on this implementation.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="MyTarget">
<UsingTask AssemblyFile="$(ProjectDir)\bin\TaskLibrary.dll" TaskName="CheckProjectReferences" />
<PropertyGroup>
<ProjectUnderCompilation></ProjectUnderCompilation>
</PropertyGroup>
<Target Name="MyTarget">
<Message Text="Inside MyTarget" Importance="High" />
<CheckProjectReferences/>
</Target>
<Import Project="$(ProjectUnderCompilation)" />
</Project>
I have a project in VB.NET 2010 (compiling to x86, .NET 2.0 runtime) that I want to compile into two separate EXEs - a "lite" version and a "full" version.
Unfortunately I cannot make two separate projects as it uses the Adobe Reader COM control - and sharing a form using that control between two projects seems to confuse the IDE (something to do with COM Interop, I assume - if someone knows how to share a form hosting the adobe reader control, that would solve my problem too).
I have found this thread:
Change name of exe depending on conditional compilation symbol however I don't have any MSBuild experience so I need more explicit instructions.
On the "My Project>Compile" tab there is a "Build Events..." button. I was wondering if anyone knows how to set a conditional compilation constant and use that to determine the EXE name (or change it after build).
If all else fails I can rename the EXE manually I suppose, but I'd prefer it to be automated.
If having two separate projects within your solution isn't acceptable, you'll want to look into creating your own MSBuild script.
Here is an example of a custom MSBuild script that will allow you to define your custom compilation constants at build time, and then build your two versions of your application ("Full" and "Lite"):
<Project DefaultTargets="BuildAll" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildVersionFull>FULL</BuildVersionFull>
<BuildVersionLite>LITE</BuildVersionLite>
</PropertyGroup>
<ItemGroup>
<Projects Include="$(MSBuildProjectDirectory)\MyApp.vbproj" />
</ItemGroup>
<Target Name="BuildAll" DependsOnTargets="BuildFull;BuildLite" />
<Target Name="BuildFull">
<MSBuild Projects="#(Projects)" Properties="DefineConstants=$(BuildVersionFull);OutputPath=binFull\;BaseIntermediateOutputPath=objFull\;AssemblyName=MyApp_Full" />
</Target>
<Target Name="BuildLite">
<MSBuild Projects="#(Projects)" Properties="DefineConstants=$(BuildVersionLite);OutputPath=binLite\;BaseIntermediateOutputPath=objLite\;AssemblyName=MyApp_Lite" />
</Target>
</Project>
What you'll need to do:
Create a new file and save it the same directory as your application's project file as "MyBuild.xml".
Change to reflect the name of your application's project file.
Open the Visual Studio Command Prompt and run "msbuild ".
Within your project, you can use the "FULL" and "LITE" conditional compilation constants to determine whether to compile certain statements:
#If FULL Then
' Compile code for the "Full" version.
#End If