HP Fortify Pre compilation errors.(could not load file or assembly Oracle.Dataacess ) - odp.net

I try to analyze my .net solution with HP FORTIFY from visual studio .But I am unable my web project and got pre compilation error message . I tried to trouble shoot from command prompt and got "could not load file or assembly Oracle.Dataacess ".
In my solution one of the project refers Oracle.Dataacess dll and that project is refered by the web project .I tried to use x64 version of the dll . But I still got the error .
Appreciate your suggestions to get rid of this pre compilation error .
Thanks,
Bala

My preferred method of debugging precompiler issues is to add this command into the post-build event of the web project in Visual Studio, that way the error shows up in the error list.
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe" -v / -p $(ProjectDir)
Another thing to keep in mind, if you have files that are not part of the solution but are part in the web projects directory, the aspnet_compiler will still read them.
I find this situation common when developers would excluded files from Visual Studio. This does not delete them. Or if they delete them, then delete through the Visual Studio interface but not from the underlying source code repository and they just get downloaded again on checkout.
An easy way to check this would be to turn on Show All Files in the Visual Studio Solution Explorer window.

Related

VS show alot of errors (E1696, E0020) and warnings (C26451, C4754) with a new project

When I starts a new project (Blank App (C++/WinRT)) on Windows10 1909 # VS2019(up to date) its shows up a lot of errors as if the extension wasn't installed. But after trying to compile and run its works - so why do I get the errors and how can I solve this? screenshot
Edit: I have fond a solution for that. its turns out that the project was needed an additional include directory:
under the project properties->C/C++->General->[Additional Include Directory]
I added the winRT folder:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\cppwinrt
screenshot2
and that's it now there's no errors (correction - after creating new project its still have the same errors)
edit2:
Update: I installed the last windows 10 SDK and was still getting the seam errors. Than I installed a package via cmd with the following command:
D:\vcpkg> vcpkg install cppwinrt:x86-windows
after this was done it seem to work now
edit3:
I'm sorry for the annoying newcomer questions...
its looks like I have another problem now with my project
in the packages.config file is says that the package is not declared with the following warning packages.config pic
thanks for any help in advance.
(edit4) I followed this thread:
nuget 'packages' element is not declared warning
and that's it, now all I have to do is to learn how to code :D
The 'standard' include paths for Visual C++ projects are the VC_IncludePath and WindowsSDK_IncludePath. The Windows SDK includes path already has all of the directories:
include\<10.0.build.0>\ucrt
include\<10.0.build.0>\shared
include\<10.0.build.0>\um
include\<10.0.build.0>\winrt
include\<10.0.build.0>\cppwinrt
"Blank App (C++/WinRT)" is not part of the standard VS 2019 template set. The name of the project in the screenshoot is "ConsoleApplication2", which would imply you created a Win32 console C++ project instead of a C++/WinRT project. Even still, you can reach the standard C++/WinRT headers from a Win32 console application since they are part of the standard path.
From the looks of the errors in your first screenshot, it appears you are using a generated C++/WinRT rather than the one in the Windows 10 SDK. With VS 2019, you must add the NuGet package Microsoft.Windows.CppWinRT to your project to get the MSBuild rules needed to build with the C++/WinRT VSIX installed, so that's likely a problem here. See VS Marketplace

Constant build failure (Roslyn/CodeAnalysis) since Visual Studio 2017 version 15.8. Any ideas?

Since Visual Studio 2017 version 15.8 we have on some computers in my team the following really weird build error.
Additionally Visual Studio recognizes it
but the IDE itself doesn't crash.
To check if it only happens to our own solutions I created a new simple, plain command line tool project which shows the same build behavior. So it isn't exclusive to our solutions.
I tried to get help from Microsoft but it seems they don't know what to do about it. The thread doesn't show all the material I provided to them. They got a lot of logs and a sample project from me. A crash dump wasn't possible to provide, because Visual Studio itself doesn't crash.
Repair and full uninstall, new install of Visual Studio didn't help either.
Edit: It is not only occurring on my development machine but on our build servers (there are two of them), too. Interestingly our VMs on the development machines does not seem to have this issue.
To me it seems, the problem has something to do with loading assembly from GAC, so I would suggest to try reinstalling Microsoft.CodeAnalysis assembly and see if it helps.
To Do that:
Install Microsoft.CodeAnalysis package to your project with it's required dependencies, make sure to note down all assemblies being downloaded.
Run Visual Studio Developer Command prompt as an Admin
Uninstall existing assemblies from GAC by using command gacutil /u [name of assembly] (do this for all assemblies from step 1)
Install newly downloaded dll using command gacutil /u [Path to Dll] for all dlls (do this for all assemblies from step 1)
Remove package from your project
I hope this helps!
Unfortunately in this case you have only three two options:
You could try to describe all the steps to reproduce this crash so much detailed as you could with a lot of screenshot images from this steps. Use for this DOC file format, PDF or some like that. This file you have to send to Visual Studio support.
You could try to create the crash dump. Each time Visual Studio crashes, it will create a dump file devenv.exe.[number].dmp file in the configured location. Each dump file produced by this method will be up to 4 GB. in size. Make sure to set DumpFolder to a location with adequate drive space or adjust the DumpCount appropriately. I know, you wrote already on MS forum that this error doesn't create one dump. But would you like to imagine that you have 10 crashes on a day and on each crash one dump file in size 4 GB. will be written? The dump creating is disabled normaly and you have to enable it. How to enable it you could find using search string in Google: "How to enable dump files in Windows" or for Windows 10 you could see this video. Alternatively or additionally you could use the programm tool "ADPlus" for creating memory dump files and log files with debug output from one or more processes. This tool is very detailed describen on this MS Support page.
You could try to debug by yourself. But in the case if you want do it you have to see "Tools listing Included in Debugging Tools for Windows".
Normaly by Visual Studio support do not work the Visual Studio developers. You have to be nice to them and they do what they can do. You could not expect from them that they all know. They do their job using some given instructions.
In your case the support worker has gived you the link Reporting Visual Studio crashes and performance issues in which you have to read the following part:
Directly reproducible crashes
Directly reproducible crashes are cases which have all of the
following characteristics:
Can be observed by following a known set of steps
Can be observed on multiple computers (if available)
If the steps involve opening a project or document, can be reproduced in sample code or a project which can be linked to or
provided as part of the feedback
For these issues, follow the steps in "How to Report a Problem"
and be sure to include:
The steps to reproduce the problem
A standalone repro project as described above. If this is not possible, then please include:
The language of the open projects (C#, C++, etc.)
The kind of project (Console Application, ASP.NET, etc.)
Any extensions that are installed.
Most valuable feedback: For this case, the most valuable feedback is the set of steps to reproduce the issue along with sample source
code.
Unknown crashes
If you're not sure what's causing your crashes or they seem random,
then you can capture dumps locally each time Visual Studio crashes and
attach those to separate feedback items. To save dumps locally when
Visual Studio crashes, set the following registry entries:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\devenv.exe]
"DumpFolder"="C:\\Crashdumps"
"DumpCount"=dword:00000005
"DumpType"=dword:00000002
⚠️ Each dump file produced by this method will be up to 4 GB. in size. Make sure to set DumpFolder to a location with adequate
drive space or adjust the DumpCount appropriately.
Each time Visual Studio crashes, it will create a dump file
devenv.exe.[number].dmp file in the configured location.
Then, use Visual Studio's "Report a Problem..." feature. It will
allow you to attach the appropriate dump.
Locate the dump file for the crash you are reporting (look for a file with the correct Creation time)
If possible, zip the file (*.zip) to reduce its size before submitting feedback
Follow the steps in "How to Report a Problem", and attach the heap dump to a new feedback item.
⚠️ Do not attach heap dumps to existing feedback items. Please create a new feedback item for each heap dump you would like to
submit. If you were requested to provide a heap dump in order to
resolve a previous feedback item, simply reply to the request with a
link to the new feedback item where the heap dump is attached.
Most valuable feedback: For this case, the most valuable feedback is the heap dump captured at the time of the crash.
Please read it very carefully and in best case two or even tree times successively.
I hope it will help you and I wish you good luck!
As suggested with Dipen in another answer problem seems to be in Microsoft.CodeAnalysis try reinstalling nuget package for that & re-register in GAC if missing.
If Issue still exists, you can try disabling code analysis on your project like:
In Project in VS 2017, open References & right click on Analyzers and click on Open Active Rule Set like:
Uncheck all rules so that no code analysis is done on your project like:
3 .Save All files and now try rebuilding & run the project to see if issue is resolved.
The issue was an older JustMock version installed. Could only solve it with the help of the Roslyn team.

How can I alter my solution to work on TFS Build that works locally, can't find .dll in search path

I've got a solution that builds locally on my developer box, and I've tried it using remote desktop on my TFS build server, which is server, controller, and agent. What is baffling is that when I queue a build, it fails, with this message in the log file.
Considered "..\..\..\..\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Coverage.Analysis.dll", but it didn't exist.
Part of what is so confusing is that If I navigate to that location, I can see the file that I need.
In further testing, I went to the build source folder and loaded the solution there. It shows that it can't located the reference. If I just remove the reference, and re add the exact reference again, it builds.
If you have a better title or want further clarification just ask or make suggestions.

Visual Studio 2012 fails to compile exe with no code errors

When running a project in Test or Debug configuration in VB.NET using Visual Studio 2012, sometimes it gives the following error as the reason for "Build Failed"
Error 1 Could not copy the file "obj\Debug\MyProgram.exe" because it was not found. MyProgram
There are no issues with the code as it was just compiled seconds before this (sometimes I start the program again just to see how everything gets laid out visually and then go back to the code to make Location adjustments)
What I found is this. If I wait , when I go to test compile again -- it just magically starts working again -- Only to fail again later.
Sometimes, I can get 10-15 good compiles before it wigs out.
About my system configuration:
I do not have any other version of Visual Studio or standalone .NET language installed
The paths are set correctly (else it would never compile in the first place.. not just occassionaly fail)
The program can be a simple program with absolutely no code added (aka... New > WinForms Project > Compile)
The project, language (and all requirements), and project output path are on a local drive that is connected directly to the PC internally (using C:\code* for projects and the standard install location for Visual Studio 2012)
I checked the smart data and scanned my hard drive for any errors ... none ever encountered. The temperature of my system (CPU), and the drive is around 25-30 degrees C.
I am really baffled as to why this happens and at random. I have also tried completely clearing out the bin/ folder, and even Moving the project or repointing where the compiled output path is.
Deleting the .suo file helps sometimes, but not all the time.
I believe this is something that may be able to be tweaked in the UI somehow, however I do not know anything about manually linking and compiling programs.
Lastly -- it does not matter whether I run VS in "Administrator" mode (elevated privileges) or as a user.
Some methods that may help you
Have you tried to reinstall Visual Studio. If that does not work you may need to install some of Windows Updates, the compiler may be missing some essential libraries/references to compile your application.
Check your .Net Target Framework, setting your application to a new framework that you don't have installed can stop the application from compiling yet even stop it from being debugged, having a compiler that is to low, this may come with errors for the compiler but not for the IDE/Visual Studio to notice.
Try cleaning your project solution's output folder by right clicking your solution then try to rebuild your project/solution.
Check your compilation references in your project's properties, check if a reference added is not on your computer
Reinstall/Update .Net Framework, same here some requirements may be missing from your installation
Try installing a newer version of Visual Studio, try Vs2013 - this contains various improvements and fixes, Visual Studio 2015 is fast approaching, a recommendation install VS2015 when the full version gets released it will contain a lot of useful features for future .net programming.
Create an new Administrator account and Run VS with Administrator rights and try compiling then, this fixes some of problems in vs and other microsoft products, it might work here.
Install all of the .Net Frameworks from the lowest to current 4.5, this may help when some of the used references/libraries are not on your local hard drive.
if none of these methods work, i would not know of the problem one last thing you could try is installing Windows to another hard drive and try using that installation of windows and see what happens... Hope this helps.
Best regards!
I faced this kind of problem because of my virus guard
blocked my application(but it is not have any harmful code :) )
exclude your project folder from virus guard
or
simply disable it(not recommended)

vb6 project saying crviewer9.dll is missing

I have a fairly old project in vb6. And when I am trying to open this project it says:
crviewer9.dll could not be loaded
so I presume I need crystal report 9 runtime, but I could not find any source to download this.
I checked Business Object site and downloaded the run time zip files but they do not have dll files.
I did find some links which 'claim' that they have crviewer9.dll files but I am not sure whether I can just download from those sites and nothing bad is going to happen.
I have installed visual studio 6, which contains vb6.
If there is anyone who has any idea how to rectify this or know where I can get this dll from please let us know.
And,
Merry Christmas!
Not sure this will help or not, but I have an older VB6 project that I inherited. It requires me to load "CRRedist2005_x86.msi" on the machine that will produce the reports. Perhaps you can find something similar to that on your machine. (It might just register the needed DLL). Did you happen to try registering the DLL via regsvr32.dll to see if that works?
Crystal Reports 9 is no longer available. However, the last version of Crystal that did have support for VB Active X controls, Crystal Reports 11, is still available from Business Objects. As of this writing (November 2012) it is still possible to get a copy of Crystal 11 by special request. You should be able to convert your CR9 VB project to a CR11 project fairly easily.
The Visual Studio redistributable files mentioned in the other answer to this question won't help you if your getting the error in the headline of this question.
Finally found it myself . In the path C:\Program Files\Common Files\Crystal Decisions\2.0\crystalreportviewers\ActiveXViewer I extracted avtiveXviewer.cab and replace it with my existing files in the same folder . Then I registered crviewer9.dll in cmd going to the same path usind cd and then using regsvr32 crviewer9.dll .Finally it is done .