nuget command Source Add started to fail out of nowhere with a warning asking for a unique source - msbuild

I have an c# wpf application and an additional installer project to create an installer of the application. Among many other files, the installer project has a installer.cmd file (I took over it from someone else) and a Product.wxs file. I was able to create an installer by running msbuild tools\installer.cmd /P:Library=net461 /P:Platform=x64 command on the developper comand prompt.
I was trying to create a desktop shortcut in all user's desktops and was playing with *.wxs file for that. I know you guys will roast me because of the following sentence but I don't know what else can I say. Something I did break something and somehow the msbuild starts to give error. I cannot say what I did because I tried many different things.. I went back to original project but it didn't help. So what is done is done. I will talk about the error now.
The error itself doesn't tell much:
C:\workspace\QToolInstaller\tools\installer.cmd(117,5): error MSB3073: The command "nuget Source Add -Name PkgSrc_638107674121812897 -Source C:\workspace\QToolInstaller\exports" exited with code 1.
I checked online to understand this error code but there wasn't much. However there is another line just before this erorr line:
The source specified has already been added to the list of available package sources. Provide a unique source.
Well, this wasn't in usual warning color or marked as a warning. But I think it is worth to investigate.
So the "source" mentioned here is PkgSrc_638107674121812897. I scanned the installer.cmd to see where is this coming form and saw that this file is named by using time ticks as:
<LocalSource>PkgSrc_$([System.DateTime]::UtcNow.Ticks)</LocalSource>
Although I ran the msbuild command multiple times, the name of the source is always different. I ran the command in diagnostic mode by using -verbosity:diag option. And I checked the file name among all the logs. There is no match. I tried to change the name to something ridicolous that cannot be listed anywhere but got the same error. Removed alll the files, created them again, restarted the PC etc. Nothing have changed. This name is really unique and but still I am getting this message. I wish I had logs form previous successfull runs. I cannot tell if this is the cause of the failure or not. Does any of these ring any bell fellas?

It is solved! Luckily a colleague of mine have faced with this before. I hope no one will have to deal with this problem again.
So apparently there is a bug(?). Altought that name is unique it thinks the opposite. When I do list the sources with thw followng command
nuget source
among the one that should be there, there is one extra line as PkgSrc_638107643440982987. Although my installer.cmd suppose to remove the source every time after it is done, it didn't for once. And although the new source is named differently, it doesn't care and gives that non-warning, non-error message followed by a meaningless error code 1 message. How to solve it?
We tried to remove the source by command prompt like this:
nuget source delete -Name PkgSrc_638107643440982987
But it is not deleted. So we went to the Visual Studio->Tools->NuGet Package Manager->Package Manager Settings->Package Sources. Found the guilty source and remove it. And then it is resolved.

Related

Compiled Access Program Runs Fine on 7 Computers but Crashes on 3 others

I have written a rather complex application in Microsoft Access. It is split into front end and back end files. To protect my code, I have compiled it and saved it as a runtime .accde file, which I then changed to an .accdr file to ensure it operated as a runtime. I have created two versions of the application: one for those with 32-bit Office installed and one for those with 64-bit office. I have used Inno Setup to package the application, the data file, and other files such as the icon file, the license file, etc., into an installable package, which works just fine.
Among my team of 27 beta testers of this application, so far 6 have downloaded it, and I have tested it on four of my own computers. On seven of these computers, the installation works perfectly and the application runs with no problems.
On the computers of three of my testers, when they try to run it, they get this error message:
The expression On Open you entered as the event property setting produced the following error: Bad file name or number.
* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
I'm pretty sure I know where the code is that's causing the problem, but cannot for the life of me figure out why the application crashes on those 2 computers but not on others.
The On Open event I suspect of causing the problem checks the linked tables, gets their connect string, then looks at the path for that string for the back end database. If it does not find it there, the procedure pops up a file selector dialog and instructs the user to find the data file, then it relinks all the tables.
If anyone could point me in the right direction to fixing this problem, I would be extremely grateful.
This is typically caused by a reference labelled as MISSING.
You have two (three) options:
Run the application on the offending machines with a full version of Access that lets you debug the code
Create a small test application that lists and verifies the references you use, and run this on the offending machines
Remove those two customers
Thanks to all the contributors here. Because of these folks and additional online research, the latest answer I can find is this:
This error occurs on a small percentage of computers on which the app is installed, and no one has yet figured out why, what causes it, or how to fix it. The workaround is to install the 2013 version of the Access runtime, as later versions will still cause the problem.
At least one of the offending computers is running the Click-to-Run version of Office. Still gathering information, but that's the status as of now.

The specified procedure could not be found - how to identify?

I'm developing plugins for a program. Whenever I try to load my plugin in that program it crashes with an the specified procedure could not be foundbut nothing more.
Well to have an insight I tracked with Process Monitor (or ProcMon). I set the filter to just print messages for the process of my main program. However that application shows me including the libraries ends (after wandering through PATH) at the right file - i.e. Result: SUCCESS.
So my computer left me pretty clueless, yet refuses to work. Has anyone an idea how identify the missing procedure?
N.B.: Additionally I ran the DependencyWalker which gave me the usual error message because it's deprecated (dependency walker gives me errors on the system that runs correctly) - which could indicate that all dependencies are found.

Finding and running FindSQLInstall.vbs script file

I have the problem and I'm trying to resolve it by following this link
https://support.microsoft.com/en-ca/kb/969052
However, when it says
"To complete the steps in this procedure, you have to copy the FindSQLInstalls.vbs script from the "More Information" section to a local folder on the computer where you are trying to update your SQL Server installation."
I'm confused on how to find this "FindSQLInstall.vbs" file and how to run it.
I'm just a beginner, so any help would be greatly appreciated.
I encountered this error while trying to put SP3 on SQL 2008 R2. Some research lead me to the same article https://support.microsoft.com/en-ca/kb/969052 and the FindSQLInstall.vbs Script.
I also do not have a lot of experience with command prompt or .vbs I do have some coworkers who have previously worked through the same issue. If you have found the Microsofts kb/969052, in theory everything you need is there. But if you are like me you need a bit more. This is what I did.
Note that I was VERY Lucky, We have a share folder where we keep copies of all of the upgrade/updates that we install. The .vbs found and copied many of my missing things (though it took me a while to figure that out)
Create folder on the server for working on issue 'C:\Repair_msi' = This puts all my housekeeping in one place
Save FindSQLInstalls.vbs script from https://support.microsoft.com/en-us/kb/969052#bookmark-script in this folder
Create text doc, paste in the script and rename as 'FindSQLInstalls.vbs' you will probably need to show hidden extensions to convert from .txt > .vbs
In command prompt type cd C:\Repair_msi = cmd working in this folder
In command prompt type Cscript FindSQLInstalls.vbs ServerName_sql_install_details.txt
Open the new document 'ServerName_sql_install_details.txt' which is now in this folder
The document says the .vbs found and copied over several missing .msi files
Missing cache file replaced by copying....
Previously missing package C:\Windows\Installer\67fe40cc.msi now exists in the Installer cache.
Validated that .msi files that were reported as missing on first error, have been identified by the .vbs and are now in C:\Windows\Installer
DOES NOT exist, directions do occur, called out with
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! C:\Windows\Installer\4541a.msi DOES NOT exist in the Installer cache. !!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The path called out in action plan is temp folder on the PC of a coworker who did a previous install, no hope of recovery from there.
No action taken
Rename 'ServerName_sql_install_details.txt' > '1-ServerName_sql_install_details.txt'
In command prompt type Cscript FindSQLInstalls.vbs ServerName_sql_install_details.txt = Run the .vbs again
Open the new document 'ServerName_sql_install_details.txt' which is now in this folder
New document is essentially the same as old, except it now says the previously missing .msi are now present and gives some direction if you still get errors on update
The 'DOES NOT exist' item still exists. I used crtl+F to search the document and this is the only required thing listed.
Copy "C:\Users\NAME\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\LWRNT0CZ\SQLServer2005_BC[1].msi" C:\Windows\Installer\4541a.msi
We have a folder with pretty much every SQL install and upgrade, on searching I find multiple SQLServer2005_BC.msi but no 4541a.msi
More reading and I learn that we need to find the correct version of SQLServer2005_BC.msi; copy and rename it to 4541a.msi
Can't find version numbers for the 30+ versions we have on the share....
Maybe we don't really need that one?
Try the SP install, It does not error out, I get to the Install now step (first attempt errored very early)
Pending off hours time slot to apply SP to this production server
In summary
It turns out I could have just run the FindSQLInstalls.vbs Script and then run the SP install again. The .vbs will return results which include the place the file was when it was last used as well as the version number. If the .vbs does not find it there, you will need to find what it wants, copy it and rename it with the correct name and put it the correct place.

Receiving "DataReader.GetFieldType returned null." error.

I have designed a windows form application with a .NET 4.5 target. I am trying to install the program on a couple of co worker's systems and keep receiving the same error on both systems.
System.InvalidOperationException: DataReader.GetFieldType(60) returned null.
This program basically retrieves data from a database and stores them in an excel file. It performs some calculations on the data, but nothing with the geometry type column except for retrieving it.
-I have tried installing ENU\x64\SQLSysClrTypes.msi and ENU\x86\SQLSysClrTypes.msi on the target systems.
-I have tried referencing Microsoft.SqlServer.Types and including the DLL in the files
-I have tried referencing SqlServerSpatial.DLL and SqlServerSpatial100.DLL but it does not let me add the references.
I am now having trouble finding other resources to try. Does anyone have any ideas? Thanks ahead.
I was able to finally get this working by adding a reference to
C:\Program Files (x86)\Microsoft SQL Server\110\Shared\Microsoft.SqlServer.Types.dll
and setting Copy Local to true. Odd that the nuget package worked for me in a different project, but not this one. Anyway, hope this helps somebody!

"File Not Found" in MSBuild Community Tasks -- Which File?

I'm trying to use the VssGet task of the MSBuild Community Tasks, and the error message "File or project not found" is beating me with a stick. I can't figure out what in particular the error message is referring to. Here's the task:
<LocalFilePath Include="C:\Documents and Settings\michaelc\My Documents\Visual Studio 2005\Projects\Astronom\Astronom.sln" />
<VssGet DatabasePath="\\ofmapoly003\Individual\michaelc\VSS\Astronom_VSS\srcsafe.ini"
Path="$/Astronom_VSS"
LocalPath="#(LocalFilePath)"
UserName="build" Password="build"
Recursive="True" />
If I write a Streamreader to read to either the database path or the local path, it succeeds fine. So the path to everything appears to be accessible. Any ideas?
Two thoughts. One, sometimes a type load exception manifests as a FNF - let's hope that's not it. But if the code is actually being honest, you can track the problem using Procmon or Filemon. Start one of those utilities and then run your task again. You should be able to track down a record of a file that couldn't be located.
#famoushamsandwich that's a great response -- I had not previously heard of procmon or filemon. Tried procmon on the problem, but even after sifting through the relevant output (my gosh the machine does a lot more stuff behind the screen than I was aware of) I couldn't find where a file I'm referencing wasn't being found.
Procmon and Filemon are good suggestions - just make sure you filter the results to only show errors. Otherwise the success messages will bury the problem entries. Also, you can filter out processes that are not at fault (either through the filter dialog or by right-clicking the entry and choosing "Exclude Process".)
A couple other thoughts:
In the LocalFilePath, you are specifying a single file as opposed to a folder. The task, on the other hand, specifies to get files recursively. Perhaps you need to remove "\Astronom.sln" from the LocalFilePath?
Is the build task being run under your account or another? It's possible you have a permissions issue
Do you already have a copy of the code pulled down in the same location? Perhaps there is a failure to overwrite an existing file/folder?