Hi I get an System.InvalidProgramException while trying to run the Example Project called "C# Example.WorkItemBrowser".
The Exception also apears when I try to execute these lines:
TeamFoundationServer tfserver = new TeamFoundationServer("http://localhost:8085");
tfserver.EnsureAuthenticated();
WorkItemStore store = new WorkItemStore(tfserver);
Console.WriteLine(store.Projects.Count);
I'm using the 2008 Visual Studio SDK for that.
PEverify for the assembly Microsoft.TeamFoundation.WorkItemTracking.Client.dll
got this otuput:
[MD]: Error: Value class has neither fields nor size parameter. [token:0x020000B3]
[MD]: Error: Value class has neither fields nor size parameter. [token:0x020000BF]
[MD]: Error: Value class has neither fields nor size parameter. [token:0x020000C4]
3 Error(s) Verifying Microsoft.TeamFoundation.WorkItemTracking.Client.dll
A fresh download and install of the SDK as well as deinstall and install as well as installing .net 3.5 sp1 again didn't help.
Is something wrong with the description of my problem or did it just not happen anywhere else?
I just a very similar question here.
Turns out, you have to have Team Explorer installed on the machine you are executing this code on.
Related
I have an UWP app written in C# which builds (VS 14.0.25425.01 Update 3 on Windows 10.0.14393, target version of the project is build 14393) and runs in Debug mode, but fails to build in Release mode with the following error:
Microsoft.NetNative.targets(640,5): error : MCG0004:InternalAssert Assert Failed: field not found during [UNKNOWN]
There are no further details, except for two warnings before, which I am not sure whether they are related to the problem:
Resources.System.Linq.Expressions.rd.xml(35): warning : ILTransform : warning ILT0027: Method 'CreateLambda' within 'System.Linq.Expressions.Expression' could not be found.
Resources.System.Linq.Expressions.rd.xml(91): warning : ILTransform : warning ILT0027: Method 'ParameterIsAssignable' within 'System.Linq.Expressions.Expression' could not be found.
Any suggestions what the issue could be related to?
This error will occur if you're using the Beta package for .NET UWP tools with VS 2015. The Beta package is only supported on 2017 as there are changes to how deployment/debugging work that we rely on. You should be able to avoid the issue by downgrading from "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.0-beta2" to "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"
edit: 5.3.0 has been published and works with VS2017 RC3+. More information here: https://blogs.msdn.microsoft.com/dotnet/2017/01/30/announcing-net-core-net-native-and-nuget-updates-in-vs-2017-rc/
Disclaimer: I work on the .NET Native compiler+runtime team.
I've been successfully using a database migration tool for .NET called DbUp in my Windows projects for a long time, and I recently had to make sure it worked on Mono (under Mac OS X).
I downloaded the latest releases of Mono (4.4.1.0) and Xamarin (5.10.1.6) studio, but the project build fails at this line of code:
SqlContext.Pipe.Send("INFO: " + string.Format(format, args));
The error is as follows:
Engine/Output/SqlContextUpgradeLog.cs(9,13): error CS0103: The name
`SqlContext' does not exist in the current context
This code compiles perfectly fine on Windows using Visual Studio. I can see that SqlContext is a class contained in System.Data.dll assembly.
However, it seems to be missing in Mono.
Is this .NET class just not implemented in mono or do I have to take some additional steps to get it working?
I bought a new computer recently and uploaded this project to a FTP server and then downloaded it to my new computer but now it is causing this error:
Unhandled Exception: System.InvalidProgramException: Common Language Runtime det
ected an invalid program.
at Nancy.Conventions.NancyConventions.<Validate>b__1(Tuple'2 result)
at System.Linq.Enumerable.WhereEnumerableIterator'1.MoveNext()
at Nancy.Conventions.NancyConventions.Validate()
at Nancy.Bootstrapper.NancyBootstrapperBase'1.Initialise()
at Nancy.Hosting.Self.NancyHost..ctor(INancyBootstrapper bootstrapper, HostCo
nfiguration configuration, Uri[] baseUris)
at Nancy.Hosting.Self.NancyHost..ctor(Uri baseUri, INancyBootstrapper bootstr
apper, HostConfiguration configuration)
at PokerServer.Program.startServer() in f:\Projects\Visual Studio\PokerServer
\PokerServer\Program.cs:line 93
at PokerServer.Program.Main() in f:\Projects\Visual Studio\PokerServer\PokerS
erver\Program.cs:line 23
It worked well on the old computer.
I have updated .NET (and all other updates under Windows Update as mentioned in another thread).
I have tried deactive and active "Code optimization" without any problems.
The directory is not the same as before, not sure if that can cause this problem?
I verify my code with peverify and if I understand it correctly everything looks good:
F:\Projects\Visual Studio\PokerServer\PokerServer\bin\Debug>peverify PokerServer
.exe /md /il
Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.33440
Copyright (c) Microsoft Corporation. All rights reserved.
All Classes and Methods in PokerServer.exe Verified.
Any help is highly appreciated!
Are you actually compiling the project on the new computer or just running the application?
If you're just running it, did you verify that the application assembly or assemblies are actually identical on both computers? I suggest, you first rule out the option, that something happened during the data transfer.
If you're compiling it, what are you compiling it with? VIsual Studio? Which version?
In any case, the error is not related to the file directory, the application is in. According to MSDN, the exception should only be thrown when the compiled application is invalid (i.e. in case of a bug in the compiler). You can find more info in this knowledge base article. Try running the PEVerify tool and rebuilding the application in debug configurtion as the article suggests.
I removed the old Nancy dependency and installed it again from Nuget and now it works.
I downloaded the sample LightSwitch app (Online Ordering) and i got an error that i couldnt figure out \ solve.
Error 1 The "SqlInstanceName" parameter is not supported by the "BuildSchema" task. Verify the parameter exists on the task, and it is a settable public instance property. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v1.0\Microsoft.LightSwitch.targets 160 23 OnlineOrdering
and
Error 2 The "BuildSchema" task could not be initialized with its input parameters. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v1.0\Microsoft.LightSwitch.targets 157 10 OnlineOrdering
the error is in the following section
<!--The Development Database is built in the same location - Bin\Data - for all configurations.-->
<BuildSchema Inputs="#(LightSwitchModel)"
ProjectPath="$(MSBuildProjectFullPath)"
OutputDirectory="Bin\Data"
SqlInstanceName="$(SqlInstanceName)"
ExternalDataSources="#(ServerExternalDataSources)"/>
Your help is much appreciated!
I wrote that sample. I know it works because I have installed it on a number of machines.
However, LightSwitch was just released today and I have not tested it on the released version of LightSwitch.
What version are you using?
I am using Windows Update API (WUApiLib) in a C# .NET 2.0 project.
I get the following error on Windows XP (in Windows 7 it works alright):
"System.MissingMethodException: Method not found: 'WUApiLib.UpdateSearcher WUApiLib.UpdateSessionClass.CreateUpdateSearcher()'."
This is my code:
WUApiLib.UpdateSessionClass session = new WUApiLib.UpdateSessionClass();
WUApiLib.IUpdateSearcher searcher = session.CreateUpdateSearcher();
WUApiLib.ISearchResult result = searcher.Search("Type='Software'");
if (result.Updates.Count > 0)
{
//do stuff
}
The error occurs at runtime, the compiler shows no errors...
Does anybody know why I get this error?
You are no doubt battling a version problem, the Win7 version is WUA version 2, XP is probably still stuck at 1. If you want to support XP then make sure to use an interop library that you generated with Tlbimp.exe on a XP machine. Keeps you out of trouble, you can't accidentally use an interface or method that isn't supported on XP.
I don't see much in the way of documentation for what's available in which version and to what degree version 2 is backwards compatible with version 1. Only this MSDN Library page seems relevant.