I've got licenses.licx file that is included to one of my projects properties. I am not sure how that is used by its dlls. Is it used by msbuild? Do you have any idea how it is used when the solution is building?
Since you indicate that StellarEleven's reply doesn't help, I guess you're looking for something even simpler. This is probably not 100% correct, but it is my understanding of how this works:
The licx file is simply a list of the "licensed" components used by your application.
Each line in the file is of the following format:
[Component Name], [Assembly Name]
For example one of my projects uses the licensed IP Works NetDial component so my .licx file contains the following line:
nsoftware.IPWorks.Netdial, nsoftware.IPWorks
In the context of the project (.csproj) file, the .licx file is referenced as an EmbeddedResource. During the build process, LC.exe verifies that the machine performing the build has the appropriate license(s) for the component in question, and generates a binary .licenses file which eventually gets embedded as a resource ([AssemblyName].exe.licenses) in the final executable.
Does this help?
Licenses.licx file woes
File this under ASP.NET, Department of WTF.
Frustration When you are developing a web application with our
controls, a mysterious file called licenses.licx appears. No, it's not
an order to use a weirdly-named lollipop, but is a transitional file
generated (and modified) by Visual Studio that participates in license
checking. In design mode, Visual Studio uses this file to make a note
of every licensed control you use in your design. When you then build
your application, Visual Studio read this licenses.licx file and for
every control mentioned there, will load the relevant assembly and run
the license code in that assembly to see if the assembly is properly
licensed (that is, that the product to which it belongs has been
properly installed on that machine). If everything checks out, Visual
Studio embeds the license key into the executable. If it doesn't,
you'll get weird error messages about the control not being licensed
(my favorite is "Could not transform licenses file 'licenses.licx'
into a binary resource." to which I usually invoke the colorful
language of my ancestors).
Licenses.licx is actually a file in your solution (if you cannot see
it there, click Show All Files). Visual Studio uses a program called
lc.exe to compile the licenses into embedded resources in your
application, and when things go wrong with the license compiling I've
seen error messages that reference this executable as well.
Here's an example of a line in a licenses.licx file.
DevExpress.XtraCharts.Web.WebChartControl,
DevExpress.XtraCharts.v8.2.Web, Version=8.2.4.0, Culture=neutral,
PublicKeyToken=9b171c9fd64da1d1
The first value in this comma delimited list is the class, the second
is the assembly where it's found, and the other values are the rest of
the assembly's strong name. I'm sure you can see problems already,
especially when you upgrade a solution to the latest versions of the
third-party controls you use. If you want, you can edit this file and
remove the strong name parts with no problem.
But that's not the biggest issue with licenses.licx. The thing is
Visual Studio has a propensity of touching this file if you open the
solution (that's "touching" as in changing the file date to the
current date/time). This plays havoc with licensing, especially if you
happen open the solution on a non-licensed machine and you are using
source control. Suddenly your build machine will throw off these
"cannot transform" messages and you're left wondering what went wrong.
Another prevalent issue is when you have a team of developers working
on a solution: they're all unconsciously "modifying" this file.
So, the answer seems to be not to put the licenses.licx file under
source control. (KB article)
But this solution to the problem throws another red flag: if one of
the developers in a team adds a new control that needs licensing to
the form, a line gets added to his local licenses.licx file and it may
not get reflected in source control. Bam, your build machine fails the
build and Joe, who added the control, has to buy doughnuts for the
team until someone else breaks the build.
I'm afraid I have no good solution to this latter issue, because
unfortunately the "not putting licenses.licx in source control" seems
to be the way everyone is solving the licensing problem. Another
solution is to delete the licenses.licx file altogether and then get
Visual Studio to regenerate it by opening the solution (although this
is a bit difficult on a build machine).
Anyway, hope that all helps in some way. And hitting your laptop with
a phone isn't really going to help.
We use a custom check-in policy (TFS) that explicitly nulls the contents of this while if present in the check-in list.
Related
How can one debug the .NET framework source code using Visual Studio 2017?
There are some questions here on stackoverflow about this topic, but even after reading all of them, I still wasn't able to make it work.
I thought it would be useful to present an up-to-date, working solution about how to debug .NET framework source code.
I would like to solve it without using any external tools (e.g. dotPeek as source server).
First of all, I tested it using Microsoft Visual Studio Enterprise 2017, Version 15.9.7 and via .NET Framework 4.7.2. Though, I think it should work on Community edition the same way.
Steps to take:
Go to Tools / Options / Debugging / General, and perform these settings:
check Enable .NET Framework source stepping (this will automatically disable "Enable Just My Code"; if not, do it manually)
uncheck Require source files to exactly match the original version
check Enable source server support
Go to Tools / Options / Debugging / Symbols, and:
in the upper listbox check Microsoft Symbol Servers
click Empty Symbol Cache button (to make sure you will get the correct symbols)
select Load all modules, unless excluded radio button at the bottom
Download the source of the .NET framework version your project is targeting, from the https://referencesource.microsoft.com/download.html site.
Unpack the downloaded archive (zip) file to a convenient path on your PC.
Debug your application; set a breakpoint to the line of .NET code you wish to debug, and step to the desired code line with the debugger.
Note: your application may start slower since it will download PDBs from the internet.
Press Step Into (F11 by default). If your settings are correct, this will cause some delay (if your VS crashes (like mine did), Empty Symbol Cache again). Eventually it will ask for the sources of the given file, e.g. dictionary.cs.
Two things can happen here:
A) It asks for the source file (.cs) in a file dialog. Go to step 7.
B) It says whatever.cs not found, and there is a link that says "Browse and find whatever.cs...". Click that link.
Select the corresponding .cs file on your disk (you can search for the file on the OS).
Note: I had to restart VS several times until it "did not crash" while looking for sources, this is most likely a bug in VS.
If you did everything correctly, you will find yourself debugging the .NET source code.
Note: Since VS saves the path you entered for the source files, you can stop debugging or restart VS; it will work next time, too.
Besides, you do not have to manually select any more source files within the framework, because the VS will use the source folder you entered and will search in source files there.
Many people wondering why they can't step into source although they does set the checkboxes as described above. I'm, too.
Because you can extract dotnet sources to any location, Visual Studio isn't able to know about them and the reason can't be the source files itself (why Visual Studio doesn't find the files).
But some dll's are browseable, some not (through double clicking in Visual Studios stack view or context menu > goto source). This brought me to the assumption, that the .pdb itself must be the reason. If you look into a file which works (e.g. notepad), you see at beginning a list of strings with file pathes (source files). In files, which doesn't work, the files starting immediatelly with binary data.
For some reason microsoft doesn't create her .pdb's with full debug information in every build process. But why not - good question! g
In short: you have to search a dll version of your file (which you like to debug) which contains FULL DEBUG INFORMATION. This is also the reason why context menu disables "goto source".
I'm replacing this file temporary in global assembly cache for time of debug. This works for me.
Here an example of PresentationFramework.dll
- 4.0.30319.298 => pdb size: 1219 KB
- 4.0.30319.18408 => pdb size: 15.562 KB
Perhabs somebody can create a public database (wiki), which everyone can add files and versions for which full debug information are available?
(If you are like me and after following all steps you still can't step into code...your PDBs downloaded from Microsoft are wrong, try this)
Using JetBrains dotPeek as the symbol server worked for me. (4.6.2 framework) (I did everything mentioned in this thread and many more threads, and nothing worked)
https://hmemcpy.com/2014/07/how-to-debug-anything-with-visual-studio-and-jetbrains-dotpeek-v1-2/
JetBrains dotPeek decompiles your actual .NET DLLs, then hosts a symbol server that you download symbols from in Visual Studio. After a pretty slow download, then a restart of VS, I was able to breakpoint and step into the code.
You can find the path to your .NET DLLs in the "Modules" window when debugging in VS. Enter this into dotPeek. Then Host Symbol server in dotPeek. Then add http://localhost:33417 as your symbol server in VS symbol settings. then load those symbols. it takes a minute and a VS restart, but works.
When I edit the code I would like the cs file is became checked out automatically.
In the Tools -> Option -> Source Control -> Enviroment in the On Edit there is Check out automatically but it does not work.
Some help?
You need to ensure the files are read-only, or VS won't be able to tell that they are version controlled (or, at least that's what it uses to determine it). You can tell VSS to set itself up so getting the latest version places the files RW on disk.
There may be other problems here, but that's what comes to mind first.
Source: https://social.msdn.microsoft.com/Forums/vstudio/en-US/88d652fa-1fef-4e3c-8dcb-a2079a96f031/visual-studio-2010-automatic-check-out-not-working-on-file-edit-or-save?forum=tfsversioncontrol
Update: Read only possible reasons:
Possible problems:
Files on network drives. If the network is slow, the compiler can have trouble accessing the file.
File still open in (an other) editor. Normally this shouldn't be a problem, but you may never know.
Some code files are generated during the build. In this case they don't belong in the version system, their source (if any) does.
Hope this will helps you.
Thanks
I accidentally deleted my project from visual studio2013/projects/myproject. I did a system restore and got the folder myproject. I am unable to see my code form or design form but I can run my application.
What d I have to do to be able to edit my code?
System Restore will only revert the computer's state (including system files, installed applications, Windows Registry, and system settings), not user files, and your sourcecode files are user files.
Since you can still run the application, then you must have a compiled executable somewhere. I suggest that you download dotPeek from JetBrains and then you can open your application up in it and decompile your assembly back into source code.
The code will be a bit ugly; your nice, meaningful variable names will probably be gone, but at least it's a starting point. Here's the link to dotPeek. https://www.jetbrains.com/decompiler/
BTW, I'm assuming that you've already tried to get the files back from the Recycle Bin.
I had build setup file from my winform application.
Then I installed it to my other computer, everything was working normally however when I clicked the SaveToPDF button which saves the gridview to pdf file
I encountered with this error :
Could not load file or assembly itextsharp, Version = 4.1.6.15 , Culture=neutral, PublicKey Token=8354ae6d2174ddca'
or one of its dependencies. The system cannot find the file specified.
If I run application from visual studio everything works pretty good.
Therefore while building the setup File iTextSharp content may be lost or while installing from setup iTextSharp content lost.
I'm stuck with this problem and dont know how to fix.
Any help would be appreciated.
Right-click on iTextSharp and select Properties. Set "Copy Local" to True.
Also I'd recommend using NuGet for package management. If setting Copy Local doesn't work or if it's already set to true, remove the reference and using Package Manager Console enter this:
Install-Package iTextSharp
UPDATE:
I tried with the InstallShield 2015 trial. Here's my experience. I'm guessing it's pertinent to your problem:
I tried a Basic MSI project and in Application File I pointed the primary output of the project using iTextSharp assembly. When I built the project I got an error "-6213 - Internal Build Error" Apparently it's a known issue with the .NET projects. Here is their article suggesting a workaround: https://flexeracommunity.force.com/customer/articles/en_US/ERRDOC/Q109089
The suggestion is turning off Dependency Scanning at build. I did that and the project compiled fine. But when I installed it only the exe for the application was deployed and iTextSharp wasn't. So this may be your case. Do you recall disabling scanning dependencies?
I removed the Project Output and added the desired files manually. This time it gave another internal error but fixed it with their suggestion (replacing ISWIScanners.dll with a new one they provide and rebuild). This time I could get all the files I wanted deployed but of course it's not ideal.
I'd suggest adding the files manually and applying the workaround. Alternatively, you can give Wix (http://wixtoolset.org) a go - a free and open-source installer. I haven't used it myself but heard it on DotNetRocks podcast. It's free so it might be worth a shot.
I hope this helps you.
I would like to Supress the Merge/Conflict checking for a few source files in a project on Get Latest Version. This is because these source files are autogenerated by a pre-build step. I just want them to be either left with 'local copy' or overwritten by the server version, because they're replace before building anyway and it doesn't matter.
When somebody on my team does a Get Latest Version, of course, these they get merge conflict errors, which isn't a big deal, but since the team changes from time to time, I get emails for a few weeks from new team members saying 'Am I going to lose my changes if I overwrite', until they finally remember to look at the filename.
Which of course caused a dev to get lazy once and ignore a merge warning, on a real source file ... and lose his changes!
Is there any way to tell TFS not to worry about this ... or, better yet, since the pre-build step always creates new versions of these files, just have them in the project (they're needed for building) but not in TFS?
You can always remove the binding of that file, so that it's not added to SourceControl.
Select the file in your solution.
In Visual Studio, File -> Source Control -> Exclude file from source control
The file will be part of your project but wont be under sourcecontrol. Basically it adds an entry to the ".vspscc" file to ignore the particular file.
Example from Vs2008 solution file.
Edit by O.P.
Note, as stated, this is not on the right-click of the file in project explorer!
Visual Studio 2012 has it hidden a bit better then vs 2008: